61 lines (58 loc) · 1.8 KB
/
continuous-integration-workflow.yml
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
name: CI
on: [push]
jobs:
formatting-check:
name: Formatting Check
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v3.0.2
- name: Run YAPF
uses: AlexanderMelde/yapf-action@v1.0
with:
args: --verbose --exclude '**/tests/**' --exclude '**/venv/**' --exclude '**/build/**' --exclude '**/.eggs/**'
tests:
name: pytest tests
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v3.0.2
- name: Set up Python 3.8
uses: actions/setup-python@v4
with:
python-version: 3.8
- name: Run pytest
uses: fylein/python-pytest-github-action@v2
with:
args: |
pip3 install -r test-requirements.txt &&
pytest tests -vvv --cov=./ --cov-report=xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3.1.0
with:
file: ./coverage.xml
flags: unittests
fail_ci_if_error: true
verbose: true
tests-os:
name: pytest tests across multiple OS and python versions
if: ${{ github }} # a hack to prevent this running on self hosted
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ["3.7", "3.8", "3.9", "3.10"]
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
- name: Checkout Code
uses: actions/checkout@v3.0.2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install pip==21.0.1
pip install -r test-requirements.txt
- name: Test with pytest
run: pytest -vvv