-
-
Notifications
You must be signed in to change notification settings - Fork 129
125 lines (112 loc) · 3.68 KB
/
ci_workflows.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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
name: CI
on:
push:
pull_request:
schedule:
# run every Wednesday at 5pm UTC
- cron: '17 0 * * 3'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
tests:
name: ${{ matrix.name }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- name: Code style checks
os: ubuntu-latest
python: 3.x
toxenv: codestyle
- name: Python 3.11 with remote data and coverage
os: ubuntu-latest
python: '3.11'
toxenv: py311-test-cov
toxargs: -v
toxposargs: --remote-data=any
- name: Python 3.12 (Windows)
os: windows-latest
python: '3.12'
toxenv: py312-test
- name: Python 3.10 (MacOS)
os: macos-latest
python: '3.10'
toxenv: py310-test
- name: Python 3.10 with oldest supported version of key dependencies
os: ubuntu-latest
python: '3.10'
toxenv: py310-test-oldestdeps
steps:
- name: Checkout code
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5.2.0
with:
python-version: ${{ matrix.python }}
- name: Install Python dependencies
run: python -m pip install --upgrade tox
- name: Run tests
run: tox ${{ matrix.toxargs }} -e ${{ matrix.toxenv }} -- ${{ matrix.toxposargs }}
# TODO: Do we need --gcov-glob "*cextern*" ?
- name: Upload coverage to artifacts
if: ${{ contains(matrix.toxenv,'-cov') }}
uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0
with:
name: coverage_${{ matrix.toxenv }}.xml
path: coverage.xml
if-no-files-found: error
upload-codecov:
needs: [ tests ]
permissions:
contents: none
runs-on: ubuntu-latest
name: Upload Coverage
steps:
- name: Download coverage artifacts
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
path: coverage
pattern: coverage_*
merge-multiple: true
- name: Upload report to Codecov
if: ${{ hashFiles('coverage/') != '' }}
uses: codecov/codecov-action@b9fd7d16f6d7d1b5d2bec1a2887e65ceed900238 # v4.6.0
with:
token: ${{ secrets.CODECOV_TOKEN }}
directory: coverage
fail_ci_if_error: true
verbose: true
allowed_failures:
name: ${{ matrix.name }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- name: (Allowed Failure) Python 3.12 with remote data and dev version of key dependencies
os: ubuntu-latest
python: '3.12'
toxenv: py312-test-devdeps
toxposargs: --remote-data=any
# doctest failure due to different no. of significant digits on arm64 (#1146)
- name: Python 3.12 (macOS)
os: macos-latest
python: '3.12'
toxenv: py312-test
steps:
- name: Checkout code
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5.2.0
with:
python-version: ${{ matrix.python }}
- name: Install Python dependencies
run: python -m pip install --upgrade tox
- name: Run tests
run: tox ${{ matrix.toxargs }} -e ${{ matrix.toxenv }} -- ${{ matrix.toxposargs }}