-
Notifications
You must be signed in to change notification settings - Fork 0
168 lines (142 loc) · 4.81 KB
/
Copy pathci.yml
File metadata and controls
168 lines (142 loc) · 4.81 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
name: cpu-validation
on:
push:
pull_request:
permissions:
contents: read
concurrency:
group: evalforge-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
PIP_DISABLE_PIP_VERSION_CHECK: "1"
PIP_NO_INPUT: "1"
PYTHONUTF8: "1"
jobs:
quality-and-smoke:
name: ${{ matrix.os }} / Python ${{ matrix.python-version }}
runs-on: ${{ matrix.os }}
timeout-minutes: 15
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
python-version: '3.11'
- os: ubuntu-latest
python-version: '3.12'
- os: ubuntu-latest
python-version: '3.13'
- os: windows-latest
python-version: '3.11'
steps:
- uses: actions/checkout@v6
- uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
cache: pip
cache-dependency-path: pyproject.toml
- name: Install package and CI tools
run: |
python -m pip install --upgrade pip
python -m pip install -e ".[dev]"
python -m pip check
- name: Validate CI workflow contract
run: python scripts/validate_ci_contract.py
- name: Parse checked-in PowerShell scripts
shell: pwsh
run: pwsh -NoProfile -ExecutionPolicy Bypass -File scripts/verify_powershell_syntax.ps1
- name: Verify Python file invocation contract
shell: pwsh
run: pwsh -NoProfile -ExecutionPolicy Bypass -File scripts/verify_python_file_invocation.ps1 -PythonExe python
- name: Runtime origin diagnostics
run: python -m evalforge doctor --json
- name: Lint
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.11'
run: ruff check .
- name: Check formatting
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.11'
run: ruff format --check .
- name: Run test suite
run: python -m pytest --junitxml=junit.xml
- name: Run CPU smoke pipeline
run: python -m evalforge run --config configs/smoke.yaml
- name: Verify installed CLI entry point
run: evalforge --help
- name: Upload validation evidence
if: always()
uses: actions/upload-artifact@v4
with:
name: cpu-validation-${{ matrix.os }}-py${{ matrix.python-version }}
path: |
junit.xml
outputs/runs/
if-no-files-found: warn
retention-days: 7
package-build:
name: build-and-check-distributions
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v6
- uses: actions/setup-python@v6
with:
python-version: '3.11'
cache: pip
cache-dependency-path: pyproject.toml
- name: Build wheel and source distribution
run: |
python -m pip install --upgrade pip build twine
python -m build --sdist --wheel --outdir dist
python -m twine check dist/*
- name: Upload distributions
uses: actions/upload-artifact@v4
with:
name: python-distributions
path: dist/
if-no-files-found: error
retention-days: 7
package-install:
name: ${{ matrix.os }} / clean-${{ matrix.distribution }}-install
needs: package-build
runs-on: ${{ matrix.os }}
timeout-minutes: 15
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
distribution: wheel
- os: windows-latest
distribution: wheel
- os: ubuntu-latest
distribution: sdist
steps:
- uses: actions/checkout@v6
- uses: actions/setup-python@v6
with:
python-version: '3.11'
cache: pip
cache-dependency-path: pyproject.toml
- name: Download built distribution
uses: actions/download-artifact@v4
with:
name: python-distributions
path: dist
- name: Verify clean distribution install outside source tree
run: >-
python scripts/verify_distribution_install.py
--dist-dir dist
--distribution ${{ matrix.distribution }}
--packaged-smoke-config
--work-dir distribution-validation-${{ matrix.os }}-${{ matrix.distribution }}
- name: Upload distribution-install evidence
if: always()
uses: actions/upload-artifact@v4
with:
name: distribution-install-${{ matrix.os }}-${{ matrix.distribution }}
path: |
dist/
distribution-validation-${{ matrix.os }}-${{ matrix.distribution }}/distribution_validation.json
distribution-validation-${{ matrix.os }}-${{ matrix.distribution }}/outside_source_tree/outputs/
if-no-files-found: warn
retention-days: 7