-
Notifications
You must be signed in to change notification settings - Fork 0
54 lines (45 loc) · 1.48 KB
/
unit-tests.yml
File metadata and controls
54 lines (45 loc) · 1.48 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
---
name: Unit-Tests
on: workflow_call
jobs:
unit-tests:
strategy:
fail-fast: false # Allows for matrix sub-jobs to fail without cancelling the rest
matrix:
platform: [ubuntu-latest, windows-latest]
python-version: ["3.9", "3.14"]
runs-on: ${{ matrix.platform }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup uv
uses: astral-sh/setup-uv@v5
with:
version: "latest"
python-version: ${{ matrix.python-version }}
enable-cache: true
cache-suffix: "test-py${{ matrix.python-version }}"
- name: Install dependencies
run: |
uv sync --no-default-groups --group test
- name: Run pytest
shell: bash
run: pytest -vv
# This job is used purely to provide a workflow status, which we can mark as a
# required action in branch protection rules. This is a better option than marking
# the unit-tests jobs manually, since their names change as the supported python
# versions change. This job provides an easy single action that can be marked required.
tests-done:
needs: [unit-tests]
if: always() && !cancelled()
runs-on: ubuntu-latest
steps:
- name: Set status based on required jobs
env:
RESULTS: ${{ join(needs.*.result, ' ') }}
run: |
for result in $RESULTS; do
if [ "$result" != "success" ]; then
exit 1
fi
done