-
Notifications
You must be signed in to change notification settings - Fork 8
46 lines (42 loc) · 1.75 KB
/
test.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
# Based off https://github.com/Electrostatics/mmcif_pdbx/blob/master/.github/workflows/python-package.yml
# Also credit to https://github.com/commitizen-tools/commitizen/tree/master/.github/workflows
# Coverage only required for pytest
# We don't need these checks in both python versions
name: Tests
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11']
test-section: [dependencies, format, pytest, type-checking]
exclude: # See https://github.community/t/improve-matrix-exclusion-feature/16340
- {test-section: dependencies, python-version: '3.7'}
- {test-section: dependencies, python-version: '3.8'}
- {test-section: dependencies, python-version: '3.9'}
- {test-section: dependencies, python-version: '3.10'}
- {test-section: format, python-version: '3.7'}
- {test-section: format, python-version: '3.8'}
- {test-section: format, python-version: '3.9'}
- {test-section: format, python-version: '3.10'}
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/[email protected]
with:
python-version: ${{ matrix.python-version }}
architecture: x64
- name: Install dependencies
run: |
python -m pip install -U pip poetry
poetry --version
poetry install
- name: Test ${{ matrix.test-section }}
run: make ${{ matrix.test-section }}
- name: Upload coverage to Codecov
if: matrix.test-section == 'pytest'
uses: codecov/[email protected]
with:
file: ./coverage.xml
flags: unittests