Skip to content

Commit f6e230e

Browse files
authored
New version (#659)
* Update CI configuration and dependencies for improved compatibility and performance
1 parent 95159ef commit f6e230e

173 files changed

Lines changed: 4084 additions & 4475 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.flake8

Lines changed: 0 additions & 30 deletions
This file was deleted.

.github/workflows/ci.yml

Lines changed: 84 additions & 243 deletions
Original file line numberDiff line numberDiff line change
@@ -1,263 +1,104 @@
11
name: CI
22

3-
# trigger
43
on:
54
push:
6-
branches:
7-
- main
8-
- develop
5+
branches: [main, develop]
96
pull_request:
107
schedule:
11-
# run Monday at 03:18 UTC
12-
- cron: '18 15 * * MON'
8+
- cron: "18 15 * * MON"
139

1410
jobs:
15-
16-
base:
17-
runs-on: ubuntu-latest
18-
strategy:
19-
matrix:
20-
python-version: ['3.12', '3.11', '3.10']
21-
22-
steps:
23-
- name: Check out repository
24-
uses: actions/checkout@v4
25-
26-
- name: Prepare python ${{ matrix.python-version }}
27-
uses: actions/setup-python@v4
28-
with:
29-
python-version: ${{ matrix.python-version }}
30-
31-
- name: Cache
32-
uses: actions/cache@v4
33-
with:
34-
path: ~/.cache
35-
key: ci-${{ runner.os }}-${{ matrix.python-version }}-base
36-
37-
- name: Install dependencies
38-
run: .github/workflows/install_deps.sh base R
39-
40-
- name: Run tests
41-
timeout-minutes: 15
42-
run: tox -e base
43-
44-
- name: Run visualization tests
45-
timeout-minutes: 3
46-
run: tox -e visualization
47-
48-
- name: Coverage
49-
uses: codecov/codecov-action@v2
50-
with:
51-
token: ${{ secrets.CODECOV_TOKEN }}
52-
file: ./coverage.xml
53-
54-
external:
55-
runs-on: ubuntu-latest
56-
strategy:
57-
matrix:
58-
python-version: ['3.11']
59-
60-
steps:
61-
- name: Check out repository
62-
uses: actions/checkout@v4
63-
64-
- name: Prepare python ${{ matrix.python-version }}
65-
uses: actions/setup-python@v4
66-
with:
67-
python-version: ${{ matrix.python-version }}
68-
69-
- name: Install julia
70-
uses: julia-actions/setup-julia@v1
71-
with:
72-
version: 1.7
73-
74-
- name: Cache
75-
uses: actions/cache@v4
76-
with:
77-
path: ~/.cache
78-
key: ci-${{ runner.os }}-${{ matrix.python-version }}-external
79-
80-
- name: Install dependencies
81-
run: .github/workflows/install_deps.sh base R
82-
83-
- name: Run tests
84-
timeout-minutes: 15
85-
run: tox -e external
86-
87-
- name: Coverage
88-
uses: codecov/codecov-action@v2
89-
with:
90-
token: ${{ secrets.CODECOV_TOKEN }}
91-
file: ./coverage.xml
92-
93-
petab:
94-
runs-on: ubuntu-latest
95-
strategy:
96-
matrix:
97-
python-version: ['3.11']
98-
99-
steps:
100-
- name: Check out repository
101-
uses: actions/checkout@v4
102-
103-
- name: Prepare python ${{ matrix.python-version }}
104-
uses: actions/setup-python@v4
105-
with:
106-
python-version: ${{ matrix.python-version }}
107-
108-
- name: Cache
109-
uses: actions/cache@v4
110-
with:
111-
path: ~/.cache
112-
key: ci-${{ runner.os }}-${{ matrix.python-version }}-petab
113-
114-
- name: Install dependencies
115-
run: .github/workflows/install_deps.sh amici
116-
117-
- name: Run tests
118-
timeout-minutes: 20
119-
run: |
120-
tox -e petab
121-
122-
- name: Coverage
123-
uses: codecov/codecov-action@v4
124-
with:
125-
token: ${{ secrets.CODECOV_TOKEN }}
126-
file: ./coverage.xml
127-
128-
mac:
129-
runs-on: macos-latest
11+
tests:
12+
name: ${{ matrix.toxenv }} (${{ matrix.python }} • ${{ matrix.os }})
13+
runs-on: ${{ matrix.os }}
13014
strategy:
15+
fail-fast: false
13116
matrix:
132-
python-version: ['3.11']
17+
include:
18+
# Fast PR matrix
19+
- os: ubuntu-latest
20+
python: "3.13"
21+
toxenv: base
22+
#- os: ubuntu-latest
23+
# python: "3.12"
24+
# toxenv: base
25+
- os: ubuntu-latest
26+
python: "3.11"
27+
toxenv: base
28+
- os: ubuntu-latest
29+
python: "3.10"
30+
toxenv: base
31+
- os: ubuntu-latest
32+
python: "3.11"
33+
toxenv: visualization
34+
35+
# macOS sanity
36+
- os: macos-latest
37+
python: "3.11"
38+
toxenv: mac
39+
40+
# Quality
41+
- os: ubuntu-latest
42+
python: "3.11"
43+
toxenv: quality
44+
- os: ubuntu-latest
45+
python: "3.11"
46+
toxenv: project
47+
- os: ubuntu-latest
48+
python: "3.11"
49+
toxenv: doc
50+
- os: ubuntu-latest
51+
python: "3.11"
52+
toxenv: migrate
53+
54+
- os: ubuntu-latest
55+
python: "3.11"
56+
toxenv: external-R
57+
- os: ubuntu-latest
58+
python: "3.11"
59+
toxenv: external-other-simulators
60+
- os: ubuntu-latest
61+
python: "3.11"
62+
toxenv: petab
63+
- os: ubuntu-latest
64+
python: "3.11"
65+
toxenv: base-notebooks
66+
- os: ubuntu-latest
67+
python: "3.11"
68+
toxenv: external-notebooks
13369

13470
steps:
135-
- name: Check out repository
136-
uses: actions/checkout@v4
71+
- uses: actions/checkout@v4
13772

138-
- name: Prepare python ${{ matrix.python-version }}
139-
uses: actions/setup-python@v4
73+
- uses: actions/setup-python@v5
14074
with:
141-
python-version: ${{ matrix.python-version }}
75+
python-version: ${{ matrix.python }}
76+
cache: pip
14277

143-
- name: Cache
144-
uses: actions/cache@v4
78+
- name: Install Julia
79+
if: ${{ startsWith(matrix.toxenv, 'external-') }}
80+
uses: julia-actions/setup-julia@v2
14581
with:
146-
path: ~/Library/Caches/pip
147-
key: ci-${{ runner.os }}-${{ matrix.python-version }}-mac
82+
version: "1.11"
14883

14984
- name: Install dependencies
150-
run: .github/workflows/install_deps.sh
151-
152-
- name: Run tests
153-
timeout-minutes: 10
154-
run: tox -e mac
155-
156-
- name: Coverage
157-
uses: codecov/codecov-action@v2
85+
run: |
86+
case "${{ matrix.toxenv }}" in
87+
base|visualization|mac|base-notebooks) .github/workflows/install_deps.sh base R ;;
88+
petab) .github/workflows/install_deps.sh amici ;;
89+
external-*) .github/workflows/install_deps.sh base R amici ;;
90+
lint|project|doc|migrate) .github/workflows/install_deps.sh doc ;;
91+
esac
92+
python -m pip install -U pip tox
93+
94+
- name: Run tox
95+
run: tox -e ${{ matrix.toxenv }}
96+
97+
# If each tox env generates coverage.xml, include flags; otherwise combine explicitly
98+
- name: Upload coverage
99+
if: ${{ always() && matrix.os == 'ubuntu-latest' }} # optional
100+
uses: codecov/codecov-action@v4
158101
with:
159102
token: ${{ secrets.CODECOV_TOKEN }}
160-
file: ./coverage.xml
161-
162-
notebooks1:
163-
runs-on: ubuntu-latest
164-
strategy:
165-
matrix:
166-
python-version: ['3.11']
167-
168-
steps:
169-
- name: Check out repository
170-
uses: actions/checkout@v4
171-
172-
- name: Prepare python ${{ matrix.python-version }}
173-
uses: actions/setup-python@v4
174-
with:
175-
python-version: ${{ matrix.python-version }}
176-
177-
- name: Cache
178-
uses: actions/cache@v4
179-
with:
180-
path: ~/.cache
181-
key: ci-${{ runner.os }}-${{ matrix.python-version }}-notebooks1
182-
183-
- name: Install dependencies
184-
run: .github/workflows/install_deps.sh
185-
186-
- name: Run notebooks
187-
timeout-minutes: 15
188-
run: tox -e notebooks1
189-
190-
notebooks2:
191-
runs-on: ubuntu-latest
192-
strategy:
193-
matrix:
194-
python-version: ['3.11']
195-
196-
steps:
197-
- name: Check out repository
198-
uses: actions/checkout@v4
199-
200-
- name: Prepare python ${{ matrix.python-version }}
201-
uses: actions/setup-python@v4
202-
with:
203-
python-version: ${{ matrix.python-version }}
204-
205-
- name: Cache
206-
uses: actions/cache@v4
207-
with:
208-
path: ~/.cache
209-
key: ci-${{ runner.os }}-${{ matrix.python-version }}-notebooks2
210-
211-
- name: Install dependencies
212-
run: .github/workflows/install_deps.sh R amici
213-
214-
- name: Run notebooks
215-
timeout-minutes: 15
216-
run: tox -e notebooks2
217-
218-
quality:
219-
runs-on: ubuntu-latest
220-
strategy:
221-
matrix:
222-
python-version: ['3.11']
223-
224-
steps:
225-
- name: Check out repository
226-
uses: actions/checkout@v4
227-
228-
- name: Prepare python ${{ matrix.python-version }}
229-
uses: actions/setup-python@v4
230-
with:
231-
python-version: ${{ matrix.python-version }}
232-
233-
- name: Cache
234-
uses: actions/cache@v4
235-
with:
236-
path: ~/.cache
237-
key: ci-${{ runner.os }}-${{ matrix.python-version }}-quality
238-
239-
- name: Install dependencies
240-
run: |
241-
.github/workflows/install_deps.sh doc
242-
pip install tox
243-
pip install pypandoc
244-
python .github/workflows/generate_readme_rst.py
245-
246-
247-
- name: Run quality checks
248-
timeout-minutes: 5
249-
run: tox -e project,flake8
250-
251-
- name: Build docs
252-
timeout-minutes: 5
253-
run: tox -e doc
254-
255-
- name: Test migration
256-
timeout-minutes: 5
257-
run: tox -e migrate
258-
259-
- name: Coverage
260-
uses: codecov/codecov-action@v2
261-
with:
262-
token: ${{ secrets.CODECOV_TOKEN }}
263-
file: ./coverage.xml
103+
files: ./coverage.xml
104+
flags: ${{ matrix.toxenv }}

0 commit comments

Comments
 (0)