forked from NVIDIA/SOL-ExecBench
-
Notifications
You must be signed in to change notification settings - Fork 0
175 lines (164 loc) · 6.5 KB
/
Copy pathcode-quality.yml
File metadata and controls
175 lines (164 loc) · 6.5 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
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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
name: Python Quality
on:
pull_request:
push:
branches: ["**"]
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
UV_NO_PROGRESS: "1"
defaults:
run:
shell: bash
jobs:
dependency-review:
name: Dependency review
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: actions/dependency-review-action@05fe4576374b728f0c523d6a13d64c25081e0803 # v4.8.3
quality:
name: Static quality
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version-file: .python-version
- uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0
with:
version: "0.11.31"
enable-cache: true
cache-dependency-glob: |
pyproject.toml
uv.lock
- name: Install package
run: uv sync --locked --all-groups
- name: Run Ruff
run: |
uv run --no-sync ruff check . --output-format github
uv run --no-sync ruff format --check . --output-format github
- name: Run Ty
run: uv run --no-sync ty check --output-format github
- name: Run architecture guardrails
run: |
uv run --no-sync python scripts/check_coupling.py
uv run --no-sync python scripts/check_readability.py
uv run --no-sync python scripts/check_production_reachability.py
uv run --no-sync python scripts/check_current_docs.py
uv run --no-sync python scripts/check_schema_versions.py
uv run --no-sync python scripts/check_non_canonical_artifacts.py
uv run --no-sync python scripts/check_python_reuse.py
uv run --no-sync python scripts/check_diagnostic_store_consistency.py
package-tests:
name: Package tests
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version-file: .python-version
- uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0
with:
version: "0.11.31"
enable-cache: true
cache-dependency-glob: |
pyproject.toml
uv.lock
- name: Install package
run: uv sync --locked --all-groups
- name: Run sol-execbench tests
run: |
uv run --no-sync coverage erase
uv run --no-sync coverage run -m pytest -n 0 tests/sol_execbench
uv run --no-sync coverage combine
uv run --no-sync coverage json -o sol-execbench-coverage.json
uv run --no-sync python scripts/check_solar_coverage.py \
sol-execbench-coverage.json \
--policy scripts/sol_execbench_coverage_policy.json
- name: Run tools tests
run: uv run --no-sync pytest tests/tools tests/scripts
default-parallel-tests:
name: Default eight-worker suite
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version-file: .python-version
- uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0
with:
version: "0.11.31"
enable-cache: true
cache-dependency-glob: |
pyproject.toml
uv.lock
- name: Install package
run: uv sync --locked --all-groups
- name: Run the configured test command
run: uv run --no-sync pytest tests/
- name: Verify wheel resources outside the checkout
run: |
uv build --wheel --out-dir "$RUNNER_TEMP/wheel"
python -m zipfile -e "$RUNNER_TEMP"/wheel/*.whl "$RUNNER_TEMP/wheel-root"
cd "$RUNNER_TEMP"
PYTHONPATH="$RUNNER_TEMP/wheel-root" "$GITHUB_WORKSPACE/.venv/bin/python" -c \
'from pathlib import Path; import solar; from sol_execbench.core.platform.docker_matrix import load_docker_target_manifest; assert Path(solar.__file__).is_relative_to(Path.cwd() / "wheel-root"); assert load_docker_target_manifest().default_target_id'
macos-development:
name: macOS development surface
runs-on: macos-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version-file: .python-version
- uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0
with:
version: "0.11.31"
enable-cache: true
cache-dependency-glob: |
pyproject.toml
uv.lock
- name: Install package
run: uv sync --locked --all-groups
- name: Verify macOS-safe development paths
run: |
uv run --no-sync ty check
uv run --no-sync pytest -n 0 \
tests/sol_execbench/core/process \
tests/sol_execbench/core/platform/test_docker_matrix_targets.py \
tests/sol_execbench/core/bench/test_safetensors_io_unit.py \
tests/solar/test_orojenesis.py
solar-tests:
name: Solar tests and coverage
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version-file: .python-version
- uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0
with:
version: "0.11.31"
enable-cache: true
cache-dependency-glob: |
pyproject.toml
uv.lock
- name: Install package
run: uv sync --locked --all-groups
- name: Run Solar tests with branch coverage
run: |
uv run --no-sync coverage erase
uv run --no-sync coverage run -m pytest -n 0 tests/solar
uv run --no-sync coverage combine
uv run --no-sync coverage json -o coverage.json
uv run --no-sync python scripts/check_solar_coverage.py coverage.json