-
Notifications
You must be signed in to change notification settings - Fork 14
55 lines (52 loc) · 1.73 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
name: CI
on: [push, pull_request]
env:
PROJECT_NAME: 'gnatss'
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.9', '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 project
run: pip install ".[test]"
- name: Prepare fortran modules
run: cd tests/fortran && f2py -c -m flib *.f && cd -
- name: Run unit tests
env:
FORCE_COLOR: 3
run: |
set -o pipefail
pytest -vvv --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/[email protected]
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@v3