-
-
Notifications
You must be signed in to change notification settings - Fork 0
105 lines (105 loc) · 3.45 KB
/
ci.yml
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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
# Run static analysis, tests, and sync
name: "ci"
concurrency:
group: "${{ github.workflow }}-${{ github.ref }}"
cancel-in-progress: true
on:
workflow_dispatch:
pull_request:
push:
branches: ["main"]
defaults:
run:
shell: "pwsh"
env:
UV_SYSTEM_PYTHON: "true"
jobs:
ruff:
runs-on: "ubuntu-22.04"
steps:
- uses: "actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11" # v4.1.1
with:
submodules: True
- uses: "actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c" # v5.0.0
with:
python-version: "3.11"
- run: "scripts/Sync-Py.ps1"
- run: "ruff check --no-fix --output-format github ."
fawltydeps:
runs-on: "ubuntu-22.04"
steps:
- uses: "actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11" # v4.1.1
with:
submodules: True
- uses: "actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c" # v5.0.0
with:
python-version: "3.11"
- run: "scripts/Sync-Py.ps1"
- run: "fawltydeps"
pyright:
runs-on: "ubuntu-22.04"
steps:
- uses: "actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11" # v4.1.1
with:
submodules: True
- uses: "actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c" # v5.0.0
with:
python-version: "3.11"
- run: "scripts/Sync-Py.ps1"
- run: pyright
test:
strategy:
matrix:
runner:
- "macos-13"
- "macos-14"
- "ubuntu-22.04"
- "windows-2022"
python:
# - "3.10" # `scripts` currently requires `tomllib`, which is > 3.10
- "3.11"
- "3.12"
# - "3.13.0-alpha.5" # https://github.com/PyO3/pyo3/issues/3555
runs-on: "${{ matrix.runner }}"
steps:
- uses: "actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11" # v4.1.1
with:
submodules: True
- uses: "actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c" # v5.0.0
with:
python-version: "${{ matrix.python }}"
- run: "scripts/Sync-Py.ps1 -Version '${{ matrix.python }}'"
# ! https://github.com/pytest-dev/pytest-cov/issues/479#issuecomment-1247444988
- run: "pytest --cov --cov-config pyproject.toml"
- if: startsWith(matrix.runner, 'ubuntu') && matrix.python == '3.11'
uses: "codecov/codecov-action@54bcd8715eee62d40e33596ef5e8f0f48dbbccab" # v4.1.0
env:
CODECOV_TOKEN: "${{ secrets.CODECOV_TOKEN }}"
- uses: "actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3" # v4.3.1
with:
path: ".comps"
name: "requirements_${{ matrix.runner }}_${{ matrix.python }}"
sync:
permissions:
contents: "write"
needs:
- "ruff"
- "fawltydeps"
- "pyright"
- "test"
runs-on: "ubuntu-22.04"
steps:
- uses: "actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11" # v4.1.1
with:
submodules: True
- uses: "actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c" # v5.0.0
with:
python-version: "3.11"
- uses: "actions/download-artifact@c850b930e6ba138125429b7e5c93fc707a7f8427" # v4.1.4
with:
path: ".comps"
merge-multiple: True
- run: "scripts/Sync-Py.ps1 -Lock"
- uses: "stefanzweifel/git-auto-commit-action@8756aa072ef5b4a080af5dc8fef36c5d586e521d" # v5.0.0
with:
commit_message: "Sync and lock"