Skip to content

Commit 3c13d7f

Browse files
feat(CI): add Codecov Test Analytics for flaky and failed tests
ps.: the action that uploads the test results doesn't have a great time differentiating 'linux' from 'linux-arm64', so I had to add the matrix values for the `os:` option
1 parent e8d58af commit 3c13d7f

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

.github/workflows/tests.yml

+17-1
Original file line numberDiff line numberDiff line change
@@ -52,30 +52,39 @@ jobs:
5252
python-version: '3.11'
5353
extra-requirements: '-c requirements/testing/minver.txt'
5454
delete-font-cache: true
55+
codecov-test-results-action-os: 'linux'
5556
- os: ubuntu-22.04
5657
python-version: '3.11'
5758
CFLAGS: "-fno-lto" # Ensure that disabling LTO works.
5859
extra-requirements: '-r requirements/testing/extra.txt'
60+
codecov-test-results-action-os: 'linux'
5961
- os: ubuntu-22.04-arm
6062
python-version: '3.12'
63+
codecov-test-results-action-os: 'linux-arm64'
6164
- os: ubuntu-22.04
6265
python-version: '3.13'
66+
codecov-test-results-action-os: 'linux'
6367
- name-suffix: "Free-threaded"
6468
os: ubuntu-22.04
6569
python-version: '3.13t'
70+
codecov-test-results-action-os: 'linux'
6671
- os: ubuntu-24.04
6772
python-version: '3.12'
73+
codecov-test-results-action-os: 'linux'
6874
- os: macos-13 # This runner is on Intel chips.
6975
# merge numpy and pandas install in nighties test when this runner is dropped
7076
python-version: '3.10'
77+
codecov-test-results-action-os: 'macos'
7178
- os: macos-14 # This runner is on M1 (arm64) chips.
7279
python-version: '3.12'
7380
# https://github.com/matplotlib/matplotlib/issues/29732
7481
pygobject-ver: '<3.52.0'
82+
codecov-test-results-action-os: 'macos'
7583
- os: macos-14 # This runner is on M1 (arm64) chips.
7684
python-version: '3.13'
7785
# https://github.com/matplotlib/matplotlib/issues/29732
7886
pygobject-ver: '<3.52.0'
87+
codecov-test-results-action-os: 'macos'
7988

8089
steps:
8190
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
@@ -326,8 +335,15 @@ jobs:
326335
fi
327336
pytest -rfEsXR -n auto \
328337
--maxfail=50 --timeout=300 --durations=25 \
329-
--cov-report=xml --cov=lib --log-level=DEBUG --color=yes
338+
--cov-report=xml --cov=lib --log-level=DEBUG --color=yes \
339+
--junitxml=junit.xml -o junit_family=legacy
330340
341+
- name: Upload test results to Codecov
342+
if: ${{ !cancelled() }} # Run even if tests fail
343+
uses: codecov/test-results-action@v1
344+
with:
345+
token: ${{ secrets.CODECOV_TOKEN }}
346+
os: ${{ matrix.codecov-test-results-action-os }}
331347
- name: Cleanup non-failed image files
332348
if: failure()
333349
run: |

0 commit comments

Comments
 (0)