-
Notifications
You must be signed in to change notification settings - Fork 1
65 lines (58 loc) · 1.79 KB
/
test.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
name: test-workflow
on:
# when any branch in the repository is pushed
push:
# when a pull request is created
pull_request:
# when manually triggered to run
workflow_dispatch:
# when scheduled
schedule:
- cron: '0 0 * * 0' # weekly
jobs:
# run tests
test:
strategy:
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
os: ['ubuntu-latest', 'macos-latest', 'windows-latest']
# do not cancel any jobs when a single job fails
fail-fast: false
name: Python ${{ matrix.python-version }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: true
- name: Setup python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: pip
cache-dependency-path: requirements-dev.txt
- name: Install dependencies
run: |
pip install --no-cache-dir --upgrade pip
pip install --no-cache-dir --requirement requirements-dev.txt
pip install setuptools
- name: Run code linting checks
run: make ci-lint
- name: Run tests with code coverage
run: make coverage
- name: Upload coverage data to coveralls.io
uses: coverallsapp/github-action@v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
flag-name: ${{ matrix.python-version }} on ${{ matrix.os }}
parallel: true
coveralls:
name: Indicate completion to coveralls.io when all parallel jobs finished
needs: test
runs-on: ubuntu-latest
steps:
- name: Finished
uses: coverallsapp/github-action@v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
parallel-finished: true