-
Notifications
You must be signed in to change notification settings - Fork 2
192 lines (182 loc) · 6.4 KB
/
ci.yml
File metadata and controls
192 lines (182 loc) · 6.4 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
name: 🔗 CI
# Comprehensive CI orchestrator that runs lint, type checks, and tests.
# Orchestrates multiple quality checks in parallel for efficient CI execution.
#
# Dependencies:
# - SocketDev/socket-registry/.github/actions/setup-and-install
# - SocketDev/socket-registry/.github/actions/run-script
on:
workflow_call:
inputs:
debug:
description: 'Enable debug output (e.g., "1" for verbose logging)'
required: false
type: string
default: '0'
fail-fast:
description: 'Cancel all matrix jobs if one fails'
required: false
type: boolean
default: false
lint-node-version:
description: 'Node.js version for linting'
required: false
type: string
default: '25.9.0'
lint-script:
description: 'Lint command (e.g., "pnpm run lint --all")'
required: false
type: string
default: 'pnpm run lint --all'
lint-setup-script:
description: 'Setup script before linting'
required: false
type: string
default: ''
lint-timeout-minutes:
description: 'Timeout for lint job in minutes'
required: false
type: number
default: 10
max-parallel:
description: 'Maximum parallel test jobs'
required: false
type: number
default: 4
node-versions:
description: 'Node.js versions for testing (e.g., ''[20, 22, 24]'')'
required: false
type: string
default: '[20, 22, 24]'
os-versions:
description: 'Operating systems for testing (e.g., ''["ubuntu-latest", "windows-latest"]'')'
required: false
type: string
default: '["ubuntu-latest", "windows-latest"]'
retention-days:
description: 'Days to retain artifacts'
required: false
type: number
default: 7
run-lint:
description: 'Include lint check job'
required: false
type: boolean
default: true
run-test:
description: 'Include test matrix job'
required: false
type: boolean
default: true
run-type-check:
description: 'Include type check job'
required: false
type: boolean
default: true
test-script:
description: 'Test command (e.g., "pnpm run test --all")'
required: false
type: string
default: 'pnpm run test --all'
test-setup-script:
description: 'Setup script before tests (e.g., "pnpm run build")'
required: false
type: string
default: ''
test-timeout-minutes:
description: 'Timeout for test jobs in minutes'
required: false
type: number
default: 15
type-check-node-version:
description: 'Node.js version for type checking'
required: false
type: string
default: '25.9.0'
type-check-script:
description: 'Type check command (e.g., "pnpm run check")'
required: false
type: string
default: 'pnpm run check'
type-check-setup-script:
description: 'Setup script before type checking'
required: false
type: string
default: ''
type-check-timeout-minutes:
description: 'Timeout for type check job in minutes'
required: false
type: number
default: 10
working-directory:
description: 'Working directory (e.g., "packages/core" for monorepos)'
required: false
type: string
default: '.'
secrets:
SOCKET_API_KEY:
description: 'Socket API key — when provided, uses sfw-enterprise instead of sfw-free'
required: false
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
lint:
if: inputs.run-lint
name: 🧹 Lint Check
runs-on: ubuntu-latest
timeout-minutes: ${{ inputs.lint-timeout-minutes }}
steps:
- uses: SocketDev/socket-registry/.github/actions/setup-and-install@df5b9b3a12a88953eaa4b925e8684cb9a3b6b53b # main
with:
debug: ${{ inputs.debug }}
node-version: ${{ inputs.lint-node-version }}
socket-api-key: ${{ secrets.SOCKET_API_KEY }}
working-directory: ${{ inputs.working-directory }}
- uses: SocketDev/socket-registry/.github/actions/run-script@df5b9b3a12a88953eaa4b925e8684cb9a3b6b53b # main
with:
main-script: ${{ inputs.lint-script }}
setup-script: ${{ inputs.lint-setup-script }}
working-directory: ${{ inputs.working-directory }}
type-check:
if: inputs.run-type-check
name: 🔍 Type Check
runs-on: ubuntu-latest
timeout-minutes: ${{ inputs.type-check-timeout-minutes }}
steps:
- uses: SocketDev/socket-registry/.github/actions/setup-and-install@df5b9b3a12a88953eaa4b925e8684cb9a3b6b53b # main
with:
debug: ${{ inputs.debug }}
node-version: ${{ inputs.type-check-node-version }}
socket-api-key: ${{ secrets.SOCKET_API_KEY }}
working-directory: ${{ inputs.working-directory }}
- uses: SocketDev/socket-registry/.github/actions/run-script@df5b9b3a12a88953eaa4b925e8684cb9a3b6b53b # main
with:
main-script: ${{ inputs.type-check-script }}
setup-script: ${{ inputs.type-check-setup-script }}
working-directory: ${{ inputs.working-directory }}
test:
if: inputs.run-test
name: 🧪 Test Matrix
strategy:
fail-fast: ${{ inputs.fail-fast }}
max-parallel: ${{ inputs.max-parallel }}
matrix:
node-version: ${{ fromJson(inputs.node-versions) }}
os: ${{ fromJson(inputs.os-versions) }}
runs-on: ${{ matrix.os }}
timeout-minutes: ${{ inputs.test-timeout-minutes }}
steps:
- uses: SocketDev/socket-registry/.github/actions/setup-and-install@df5b9b3a12a88953eaa4b925e8684cb9a3b6b53b # main
with:
debug: ${{ inputs.debug }}
node-version: ${{ matrix.node-version }}
socket-api-key: ${{ secrets.SOCKET_API_KEY }}
working-directory: ${{ inputs.working-directory }}
- uses: SocketDev/socket-registry/.github/actions/run-script@df5b9b3a12a88953eaa4b925e8684cb9a3b6b53b # main
with:
main-script: ${{ inputs.test-script }}
setup-script: ${{ inputs.test-setup-script }}
working-directory: ${{ inputs.working-directory }}