-
Notifications
You must be signed in to change notification settings - Fork 14
63 lines (59 loc) · 2.08 KB
/
ci.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
name: CI
on: [push, pull_request]
env:
PROJECT_NAME: "gnatss"
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
unit_test:
name: ${{ matrix.python-version }}-unit-test
runs-on: ubuntu-22.04
continue-on-error: ${{ matrix.experimental }}
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11"]
experimental: [false]
steps:
- name: Checkout Repo
uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetch all history for all branches and tags.
- name: Setup Python
uses: actions/[email protected]
with:
python-version: ${{ matrix.python-version }}
- name: Print system platform
shell: python
run: |
import platform
print(platform.machine().lower())
# We only want to install this on one run, because otherwise we'll have
# duplicate annotations.
- name: Install error reporter
if: ${{ matrix.python-version == '3.10' }}
run: |
python -m pip install pytest-github-actions-annotate-failures
- name: Install nox
run: pip install nox
- name: Run unit tests
env:
FORCE_COLOR: 3
run: |
set -o pipefail
nox --verbose -s tests -- --cov=${{ env.PROJECT_NAME }} --cov-report=xml --cov-report=term tests/ |& tee unit_test_log${{ matrix.python-version }}.log
- name: Upload unit test log
if: ${{ success() || failure() }}
uses: actions/upload-artifact@v4
with:
name: unit_test_log${{ matrix.python-version }}
path: unit_test_log${{ matrix.python-version }}.log
- name: Upload coverage reports to Codecov with GitHub Action
uses: codecov/codecov-action@v5
# Don't run coverage on merge queue CI to avoid duplicating reports
# to codecov. See https://github.com/matplotlib/napari-matplotlib/issues/155
if: github.event_name != 'merge_group'
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: false