-
Notifications
You must be signed in to change notification settings - Fork 1
executable file
·52 lines (42 loc) · 1.35 KB
/
python-test.yml
File metadata and controls
executable file
·52 lines (42 loc) · 1.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# Based on: GitHub Actions "Python application" template
#
# GitHub Actions workflow to build, lint, and test a python app
# Author: Wolf Paulus (https://wolfpaulus.com)
#
# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
# Your sources need to be in the "./src" folder, your tests in the "./tests" folder
name: run-tests
env:
PYTHON_VERSION: "3.13"
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
permissions:
contents: read
jobs:
build:
env:
PYTHONPATH: "./src"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ env.PYTHON_VERSION }}
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Create and start virtual environment
run: |
python -m venv venv
source venv/bin/activate
- name: Install dependencies
run: |
pip install -r tests/requirements.txt
pip install -r ./requirements.txt
- name: Lint with autopep8
run: |
autopep8 --exit-code --recursive --diff --aggressive --max-line-length 120 ./src
- name: Test with pytest
run: pytest