Repository navigation
76 lines (64 loc) · 2 KB
/
Copy pathci_tests.yml
File metadata and controls
76 lines (64 loc) · 2 KB
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
name: CI
on:
push:
branches:
- main
pull_request:
merge_group:
workflow_dispatch:
schedule:
- cron: '48 4 * * *'
jobs:
build:
strategy:
matrix:
platform: [windows-latest, macos-latest, ubuntu-latest]
python-version: ["3.12", "3.14"]
runs-on: ${{ matrix.platform }}
env:
# Coverage is only uploaded from one job. Elsewhere, it would only slow
# down the tests (substantially on Python < 3.14).
COVERAGE_ARGS: ${{ matrix.platform == 'ubuntu-latest' && matrix.python-version == '3.14' && '--cov=petab --cov-report=xml' || '' }}
steps:
- name: Check out repository
uses: actions/checkout@v7
- name: Install uv and python ${{ matrix.python-version }}
uses: astral-sh/setup-uv@v10.0.1
with:
enable-cache: true
python-version: ${{ matrix.python-version }}
- name: Quality tests
run: uvx pre-commit run --all-files
if: matrix.platform == 'ubuntu-latest'
- name: Fetch BNGL test corpus
run: uv run --no-project python -P tests/v1/fetch_bngl_corpus.py
- name: Unit tests
run: |
uv sync --no-default-groups --group test
uv pip list
uv run pytest ${{ env.COVERAGE_ARGS }} --durations=10 tests
- name: Coverage
uses: codecov/codecov-action@v7
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage.xml
if: env.COVERAGE_ARGS != ''
doc:
# Read the Docs covers PRs. Skipped jobs count as passing, so this can
# be a required check.
if: >-
github.event_name == 'merge_group'
|| github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v7
- name: Install uv and python
uses: astral-sh/setup-uv@v10.0.1
with:
enable-cache: true
python-version: "3.12"
- name: Build documentation
run: |
uv sync --no-default-groups --group doc
uv run --no-sync make -C doc html