-
Notifications
You must be signed in to change notification settings - Fork 0
202 lines (190 loc) · 7.79 KB
/
Copy pathci.yml
File metadata and controls
202 lines (190 loc) · 7.79 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
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
name: CI
# SHA-pinning policy: actions are pinned to the tagged releases below; the
# maintainers must replace the tags with full commit SHAs (with a version
# comment) via Dependabot/Renovate PRs before any release. Never accept a
# dependency-update PR that moves an action to an untagged ref.
on:
push:
branches: [main]
pull_request:
workflow_dispatch:
concurrency:
group: ci-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
fast-tests-windows:
runs-on: windows-latest
timeout-minutes: 60
strategy:
matrix:
python-version: ['3.10', '3.11']
steps:
- name: Checkout
uses: actions/checkout@v7.0.1 # v7.0.1 - pin to full SHA before release
- name: Install uv
uses: astral-sh/setup-uv@v9.0.0 # v9.0.0
with:
python-version: ${{ matrix.python-version }}
enable-cache: true
- name: Sync locked environment
run: uv sync --locked --all-groups --python ${{ matrix.python-version }}
- name: Run deterministic tests
run: uv run --python ${{ matrix.python-version }} pytest -q
- name: Parse PowerShell scripts
shell: powershell
run: |
$parseErrors = @()
Get-ChildItem -Recurse -Filter *.ps1 | ForEach-Object {
$errors = $null
[void][System.Management.Automation.Language.Parser]::ParseFile(
$_.FullName, [ref]$null, [ref]$errors
)
if ($errors) { $parseErrors += $errors }
}
if ($parseErrors.Count -gt 0) {
$parseErrors | ForEach-Object { Write-Error $_.Message }
exit 1
}
- name: Benchmark table drift check
run: |
uv run --python ${{ matrix.python-version }} python scripts/render_benchmark_tables.py
git diff --exit-code -- README.md README.zh-CN.md
- name: Benchmark evidence + adapter manifest validation
run: |
uv run --python ${{ matrix.python-version }} python scripts/validate_benchmark_index.py
uv run --python ${{ matrix.python-version }} python scripts/validate_adapter_manifest.py --adapter paddleocr-vl-1.6 --strict
uv run --python ${{ matrix.python-version }} python scripts/validate_adapter_manifest.py --adapter mineru --strict
fast-tests-ubuntu:
runs-on: ubuntu-latest
timeout-minutes: 40
strategy:
matrix:
python-version: ['3.10', '3.11']
steps:
- name: Checkout
uses: actions/checkout@v7.0.1 # v7.0.1 - pin to full SHA before release
- name: Install uv
uses: astral-sh/setup-uv@v9.0.0 # v9.0.0
with:
python-version: ${{ matrix.python-version }}
enable-cache: true
- name: Sync locked environment
run: uv sync --locked --all-groups --python ${{ matrix.python-version }}
- name: Run pure-Python tests (PowerShell tests auto-skip)
run: uv run --python ${{ matrix.python-version }} pytest -q
- name: "Ruff lint (safety-critical rules: E9 syntax errors, F63/F7 undefined names, F82 invalid literals)"
run: |
uv run --python ${{ matrix.python-version }} --with ruff ruff check --select E9,F63,F7,F82 scripts tests --exclude 'eval-infra/01-omnidocbench'
- name: Pyright typecheck
run: |
uv run --python ${{ matrix.python-version }} --with pyright pyright scripts tests
continue-on-error: true
psscriptanalyzer:
runs-on: windows-latest
timeout-minutes: 30
steps:
- name: Checkout
uses: actions/checkout@v7.0.1 # v7.0.1 - pin to full SHA before release
- name: Lint PowerShell
shell: pwsh
run: |
Install-Module PSScriptAnalyzer -RequiredVersion 1.24.0 -Scope CurrentUser -Force -Repository PSGallery
$errors = Invoke-ScriptAnalyzer -Path . -Recurse -Severity Error
if ($errors) {
$errors | Format-Table ScriptName, Line, RuleName, Message -AutoSize | Out-String | Write-Host
exit 1
}
Write-Host "PSScriptAnalyzer: 0 errors"
bash-syntax:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout
uses: actions/checkout@v7.0.1 # v7.0.1 - pin to full SHA before release
- name: Parse our Bash scripts (repo-owned .sh only; the cloned upstream OmniDocBench tree is excluded)
run: |
find eval-infra/02-cdm-environment eval-infra/03-scoring adapters -type f -name '*.sh' -print0 | xargs -0 -n1 bash -n
- name: "ShellCheck (SC1090: dynamic source is a known false positive)"
run: |
sudo apt-get update -qq && sudo apt-get install -y -qq shellcheck
find eval-infra/02-cdm-environment eval-infra/03-scoring adapters -type f -name '*.sh' -print0 | xargs -0 -n1 shellcheck -S warning -e SC1090
actionlint:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout
uses: actions/checkout@v7.0.1 # v7.0.1 - pin to full SHA before release
- name: Run actionlint
run: |
go run github.com/rhysd/actionlint/cmd/actionlint@v1.7.7 -config-file actionlint.yaml .github/workflows/*.yml
shell: bash
markdown-links:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Checkout
uses: actions/checkout@v7.0.1 # v7.0.1 - pin to full SHA before release
- name: Install uv
uses: astral-sh/setup-uv@v9.0.0 # v9.0.0
with:
python-version: '3.11'
enable-cache: true
- name: Validate internal markdown links
run: |
uv sync --locked --all-groups --python 3.11
uv run --python 3.11 python -m pytest tests/test_markdown_links.py -q
dependency-review:
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
timeout-minutes: 10
permissions:
contents: read
pull-requests: write
steps:
- name: Checkout
uses: actions/checkout@v7.0.1 # v7.0.1 - pin to full SHA before release
- name: Check Dependency Graph availability
id: depgraph
shell: bash
run: |
ENABLED=$(gh api repos/${{ github.repository }} --jq '.security_and_analysis.dependency_graph.enabled // false' 2>/dev/null || echo false)
echo "enabled=$ENABLED" >> "$GITHUB_OUTPUT"
if [ "$ENABLED" = "true" ]; then
echo "Dependency Graph enabled - running Dependency Review"
else
echo "Dependency Graph not enabled on this repository - skipping Dependency Review (enable at Settings -> Code security and analysis)"
fi
- name: Dependency Review
if: steps.depgraph.outputs.enabled == 'true'
uses: actions/dependency-review-action@v5.0.0 # v5.0.0 - pin to full SHA before release
with:
fail-on-severity: high
scorecard:
if: github.event_name == 'push'
runs-on: ubuntu-latest
timeout-minutes: 20
permissions:
security-events: write
id-token: write
steps:
- name: Checkout
uses: actions/checkout@v7.0.1 # v7.0.1 - pin to full SHA before release
with:
persist-credentials: false
- name: Run OpenSSF Scorecard
uses: ossf/scorecard-action@v2.4.1 # v2.4.1 - pin to full SHA before release
with:
results_file: results.sarif
results_format: sarif
publish_results: true
- name: Upload SARIF
uses: actions/upload-artifact@v4.6.2 # v4.6.2 - pin to full SHA before release
with:
name: scorecard-sarif
path: results.sarif
# CI intentionally excludes WSL provisioning, AMD GPU inference, model/dataset
# downloads, TeX/ImageMagick CDM, scoring, and benchmarks. Those require the
# dated physical-machine evidence documented under docs/ (see
# .github/workflows/amd-gpu.yml for the manual self-hosted HIP smoke path).