Skip to content

Commit 4cf4e93

Browse files
committed
CI: Revamp testing
1 parent 00bd01b commit 4cf4e93

File tree

1 file changed

+61
-25
lines changed

1 file changed

+61
-25
lines changed

.github/workflows/testing.yml

Lines changed: 61 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
name: build
22

3-
on: [push, pull_request]
3+
on:
4+
push:
5+
branches:
6+
- '*'
7+
tags-ignore:
8+
- 'v[0-9]*'
9+
pull_request:
10+
workflow_call:
411

512
jobs:
613
# Unittests
@@ -13,44 +20,44 @@ jobs:
1320

1421
strategy:
1522
matrix:
16-
python-version: ["3.8", "3.10"]
23+
include:
24+
- python-version: "3.10"
25+
resolution: "lowest-direct"
26+
- python-version: 3.13
27+
resolution: "highest"
1728

1829
steps:
1930
- name: Checkout Code
20-
uses: actions/checkout@v3
31+
uses: actions/checkout@v4
2132

22-
- name: Setup Python
23-
uses: actions/setup-python@v2
33+
- name: Install a specific version of uv
34+
uses: astral-sh/setup-uv@v6
2435
with:
2536
python-version: ${{ matrix.python-version }}
2637

2738
- name: Install Packages
28-
shell: bash -l {0}
2939
run: |
3040
sudo apt-get install gnuplot
31-
pip install -e ".[test]"
32-
pip install coveralls
41+
# Install as an editable so that the coverage path
42+
# is predicable
43+
uv run uv pip install --resolution=${{ matrix.resolution }} -e ".[dev]"
3344
3445
- name: Environment Information
35-
shell: bash -l {0}
3646
run: |
3747
gnuplot --version
38-
pip list
48+
uv pip list
3949
4050
- name: Run Tests
41-
shell: bash -l {0}
4251
run: |
43-
coverage erase
4452
make test
4553
4654
- name: Upload coverage to Codecov
47-
uses: codecov/codecov-action@v1
55+
uses: codecov/codecov-action@v5
4856
with:
4957
fail_ci_if_error: true
5058
name: "py${{ matrix.python-version }}"
5159

52-
# Linting
53-
lint:
60+
lint-and-format:
5461
runs-on: ubuntu-latest
5562

5663
# We want to run on external PRs, but not on our own internal PRs as they'll be run
@@ -59,24 +66,53 @@ jobs:
5966

6067
strategy:
6168
matrix:
62-
python-version: ["3.10"]
69+
python-version: [3.13]
6370
steps:
6471
- name: Checkout Code
65-
uses: actions/checkout@v3
72+
uses: actions/checkout@v4
6673

67-
- name: Setup Python
68-
uses: actions/setup-python@v2
74+
- name: Install a specific version of uv
75+
uses: astral-sh/setup-uv@v6
6976
with:
7077
python-version: ${{ matrix.python-version }}
7178

7279
- name: Install Packages
73-
shell: bash -l {0}
74-
run: pip install flake8
80+
run: uv run uv pip install ruff
7581

7682
- name: Environment Information
77-
shell: bash -l {0}
78-
run: pip list
83+
run: uv pip list
7984

80-
- name: Run Tests
81-
shell: bash -l {0}
85+
- name: Check lint with Ruff
8286
run: make lint
87+
88+
- name: Check format with Ruff
89+
run: make format
90+
91+
typecheck:
92+
runs-on: ubuntu-latest
93+
94+
# We want to run on external PRs, but not on our own internal PRs as they'll be run
95+
# by the push to the branch.
96+
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
97+
98+
strategy:
99+
matrix:
100+
python-version: [3.13]
101+
102+
steps:
103+
- name: Checkout Code
104+
uses: actions/checkout@v4
105+
106+
- name: Install a specific version of uv
107+
uses: astral-sh/setup-uv@v6
108+
with:
109+
python-version: ${{ matrix.python-version }}
110+
111+
- name: Install Packages
112+
run: uv run uv pip install ".[dev]"
113+
114+
- name: Environment Information
115+
run: uv pip list
116+
117+
- name: Run Tests
118+
run: make typecheck

0 commit comments

Comments
 (0)