-
Notifications
You must be signed in to change notification settings - Fork 0
80 lines (66 loc) · 2.05 KB
/
ci.yaml
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
name: Python CI
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
build-and-test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
env:
CI: 'true' # Setting an environment variable 'CI' to 'true' - skip plot visualisation
PYTHON_VERSION: '3.12' # Define the Python version in single place
steps:
- name: Check out the repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Set up dependencies (Linux)
if: runner.os == 'Linux'
run: |
cd prj/script
./venv_create.sh ${{ env.PYTHON_VERSION }}
cd ../..
- name: Set up dependencies (Windows)
if: runner.os == 'Windows'
run: |
cd prj\script
.\venv_create.cmd ${{ env.PYTHON_VERSION }}
cd ..\..
- name: Install dependencies (Linux)
if: runner.os == 'Linux'
run: |
cd prj/script
./pip_reqs_install.sh
cd ../..
- name: Install dependencies (Windows)
if: runner.os == 'Windows'
run: |
cd prj\script
.\pip_reqs_install.cmd
cd ..\..
- name: Run tests with pytest (Linux)
if: runner.os == 'Linux'
run: ./prj/venv/bin/pytest test/
- name: Run tests with pytest (Windows)
if: runner.os == 'Windows'
run: .\prj\venv\Scripts\pytest.exe test\
- name: Run type checking with mypy (Linux)
if: runner.os == 'Linux'
run: ./prj/venv/bin/mypy --check-untyped-defs -p test -p src
- name: Run type checking with mypy (Windows)
if: runner.os == 'Windows'
run: .\prj\venv\Scripts\mypy.exe --check-untyped-defs -p test -p src
#- name: Run linter with pylint (Linux)
# if: runner.os == 'Linux'
# run: ./prj/script/venv/bin/python -m pylint src
#- name: Run linter with pylint (Windows)
# if: runner.os == 'Windows'
# run: .\prj\venv\Scripts\python.exe -m pylint src