-
Notifications
You must be signed in to change notification settings - Fork 0
122 lines (104 loc) · 3.7 KB
/
ci.yml
File metadata and controls
122 lines (104 loc) · 3.7 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
name: CI
on:
push:
branches: [main]
tags: ['*']
pull_request:
branches: [main]
workflow_dispatch:
inputs:
force:
description: 'Force rebuild (ignore cache)'
type: boolean
default: false
node-versions:
description: 'Node.js versions to test (JSON array)'
required: false
type: string
# Default should match .node-version at monorepo root
default: '["24.12.0"]'
debug:
description: 'Debug (0|1|namespace[,...])'
required: false
default: '0'
type: string
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
# Platform-agnostic checks run once on Ubuntu
checks:
name: Lint, Type, Validation
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
submodules: recursive
- name: Setup Node.js
uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
with:
node-version-file: .node-version
package-manager-cache: false # Explicitly disable automatic caching (prevents cache poisoning)
- name: Setup pnpm
uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4.2.0
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Lint
run: pnpm run lint
- name: Lint and format checks
run: pnpm run check
- name: Validate cache-versions.json
run: |
if ! jq empty .github/cache-versions.json 2>/dev/null; then
echo "::error::cache-versions.json is not valid JSON"
exit 1
fi
for pkg in $(jq -r '.versions | keys[]' .github/cache-versions.json); do
VERSION=$(jq -r ".versions[\"$pkg\"]" .github/cache-versions.json)
if ! echo "$VERSION" | grep -qE '^v[0-9]+$'; then
echo "::error::Invalid version format for $pkg: $VERSION (expected: v<number>)"
exit 1
fi
done
echo "√ cache-versions.json valid"
- name: Validate checkpoint alignment
run: node scripts/validate-checkpoint-alignment.mjs
- name: Run build-infra tests
run: pnpm run test:build-infra
# Platform-specific tests run on all platforms
test:
name: Test (${{ matrix.os }})
needs: checks
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
submodules: recursive
- name: Setup Node.js
uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
with:
node-version-file: .node-version
package-manager-cache: false # Explicitly disable automatic caching (prevents cache poisoning)
- name: Setup pnpm
uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4.2.0
- name: Install dependencies
run: pnpm install --frozen-lockfile
env:
DEBUG: ${{ inputs.debug && '1' || '' }}
# Platform-specific tests go here
# Package-specific build/test workflows:
# - binject/binflate/binpress: binsuite.yml
# - node-smol-builder: node-smol.yml
# - model builders: models.yml, onnxruntime.yml, yoga-layout.yml
- name: Verify pnpm install works
run: pnpm ls --depth=0