-
Notifications
You must be signed in to change notification settings - Fork 1
91 lines (88 loc) · 2.67 KB
/
tests.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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
name: Tests, linting, etc.
on:
push:
branches:
- "main"
- "feature/*"
- "hotfix/*"
- "release/*"
pull_request:
env:
PYTHON_VERSIONS: 3.8 3.9 3.10 3.11 3.12 3.13
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
jobs:
linters:
runs-on: ubuntu-latest
steps:
- name: Begin async installations
id: install
run: |
pyright_change="$(sudo snap install --no-wait --classic pyright)"
shellcheck_change="$(sudo snap install --no-wait shellcheck)"
uv_change="$(sudo snap install --no-wait --classic astral-uv)"
ruff_change="$(sudo snap install --no-wait ruff)"
echo snap_changes="$pyright_change $shellcheck_change $uv_change $ruff_change" >> "$GITHUB_OUTPUT"
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Configure environment
run: |
echo "::group::Wait for snap to complete"
for change in ${{ steps.install.outputs.snap_changes }}; do
snap watch $change
done
echo "::endgroup::"
- name: Run Linters
run: |
make lint
tests:
strategy:
matrix:
platform: [ubuntu-latest, macos-latest, windows-latest]
fail-fast: false
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install the latest version of uv
uses: astral-sh/setup-uv@v5
with:
version: "latest"
- name: Install test dependencies
run: |
make install-test-deps
- name: Test across all Python versions
shell: bash
run: |
# shellcheck disable=SC2086
for python_version in $PYTHON_VERSIONS; do
echo ::group::Python $python_version
make test UV_PYTHON=$python_version
echo ::endgroup::
done
env:
PYTEST_ADDOPTS: "--no-header -vv -rN"
- name: Test with the lowest supported libraries
shell: bash
run: |
# shellcheck disable=SC2086
for python_version in $PYTHON_VERSIONS; do
echo ::group::Python $python_version
make test UV_PYTHON=$python_version UV_RESOLUTION=lowest
echo ::endgroup::
done
- name: Upload code coverage
uses: codecov/codecov-action@v5
with:
directory: ./results/
files: coverage*.xml
- name: Upload test results
if: success() || failure()
uses: actions/upload-artifact@v4
with:
name: test-results-${{ matrix.platform }}
path: results/