-
Notifications
You must be signed in to change notification settings - Fork 0
106 lines (93 loc) · 3.18 KB
/
ci.yml
File metadata and controls
106 lines (93 loc) · 3.18 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
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:
- uses: SocketDev/socket-registry/.github/actions/setup-and-install@4edf2e3c3beff7d536e79ce43dfb61abba7cb537 # main
- name: Lint checks
shell: bash
run: |
pnpm run check
- name: Validate cache-versions.json
run: |
# Validate JSON is parseable
if ! jq empty .github/cache-versions.json 2>/dev/null; then
echo "::error::cache-versions.json is not valid JSON"
exit 1
fi
# Validate required schema structure exists
if ! jq -e '.versions | type == "object"' .github/cache-versions.json >/dev/null 2>&1; then
echo "::error::cache-versions.json missing required 'versions' object"
exit 1
fi
# Validate each version entry format
for pkg in $(jq -r '.versions | keys[]' .github/cache-versions.json); do
VERSION=$(jq -r ".versions[\"$pkg\"]" .github/cache-versions.json)
if [ -z "$VERSION" ] || [ "$VERSION" = "null" ]; then
echo "::error::Missing or null version for package: $pkg"
exit 1
fi
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 "[OK] cache-versions.json valid"
- name: Validate checkpoint alignment
shell: bash
run: |
node scripts/validate-checkpoint-alignment.mjs
- name: Run build-infra tests
shell: bash
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:
- uses: SocketDev/socket-registry/.github/actions/setup-and-install@4edf2e3c3beff7d536e79ce43dfb61abba7cb537 # main
# 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
shell: bash
run: |
pnpm ls --depth=0