Skip to content

Commit 5493889

Browse files
committed
refactor(ci): simplify reusable workflow with aligned defaults
- Add 🔎 Check job (combined lint + type via `pnpm run check --all`) - Keep 🧹 Lint and 🏷️ Type Check as opt-in standalone jobs - Update defaults: test-setup-script=`pnpm run build`, test-script=`pnpm test`, os-versions includes macos, node-versions=25.9.0 - Remove retention-days input
1 parent d523848 commit 5493889

2 files changed

Lines changed: 63 additions & 28 deletions

File tree

.github/workflows/_local-not-for-reuse-ci.yml

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,9 @@ jobs:
1919
name: Run CI Pipeline
2020
uses: SocketDev/socket-registry/.github/workflows/ci.yml@b86b2cb3fefa4ffa6c1a702476f9785f6c3bb887 # main
2121
with:
22-
fail-fast: false
23-
lint-script: 'pnpm run lint --all'
24-
lint-setup-script: 'pnpm run build'
25-
node-versions: '[22, 24]'
26-
os-versions: '["ubuntu-latest", "windows-latest"]'
2722
test-script: 'pnpm run test --all --fast'
28-
test-setup-script: 'pnpm run build'
29-
type-check-script: 'pnpm run check'
30-
type-check-setup-script: 'pnpm run build'
23+
node-versions: '["22", "24"]'
24+
os-versions: '["ubuntu-latest", "windows-latest"]'
3125
secrets:
3226
SOCKET_API_KEY: ${{ secrets.SOCKET_API_KEY }}
3327

.github/workflows/ci.yml

Lines changed: 61 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
name: 🔗 CI
22

3-
# Comprehensive CI orchestrator that runs lint, type checks, and tests.
4-
# Orchestrates multiple quality checks in parallel for efficient CI execution.
3+
# CI orchestrator that runs checks and tests.
4+
#
5+
# By default runs `pnpm run check --all` (lint + type) as a single job.
6+
# Set `run-check: false` and enable `run-lint`/`run-type-check` to split them.
57
#
68
# Dependencies:
79
# - SocketDev/socket-registry/.github/actions/setup-and-install
@@ -10,6 +12,26 @@ name: 🔗 CI
1012
on:
1113
workflow_call:
1214
inputs:
15+
check-node-version:
16+
description: 'Node.js version for checks'
17+
required: false
18+
type: string
19+
default: '25.9.0'
20+
check-script:
21+
description: 'Check command — runs lint + type checks (e.g., "pnpm run check --all")'
22+
required: false
23+
type: string
24+
default: 'pnpm run check --all'
25+
check-setup-script:
26+
description: 'Setup script before checks'
27+
required: false
28+
type: string
29+
default: ''
30+
check-timeout-minutes:
31+
description: 'Timeout for check job in minutes'
32+
required: false
33+
type: number
34+
default: 10
1335
debug:
1436
description: 'Enable debug output (e.g., "1" for verbose logging)'
1537
required: false
@@ -46,45 +68,45 @@ on:
4668
type: number
4769
default: 4
4870
node-versions:
49-
description: 'Node.js versions for testing (e.g., ''[20, 22, 24]'')'
71+
description: 'Node.js versions for testing (e.g., ''["22", "24"]'')'
5072
required: false
5173
type: string
52-
default: '[20, 22, 24]'
74+
default: '["25.9.0"]'
5375
os-versions:
5476
description: 'Operating systems for testing (e.g., ''["ubuntu-latest", "windows-latest"]'')'
5577
required: false
5678
type: string
57-
default: '["ubuntu-latest", "windows-latest"]'
58-
retention-days:
59-
description: 'Days to retain artifacts'
79+
default: '["ubuntu-latest", "macos-latest", "windows-latest"]'
80+
run-check:
81+
description: 'Include combined check job (lint + type)'
6082
required: false
61-
type: number
62-
default: 7
83+
type: boolean
84+
default: true
6385
run-lint:
64-
description: 'Include lint check job'
86+
description: 'Include standalone lint job'
6587
required: false
6688
type: boolean
67-
default: true
89+
default: false
6890
run-test:
6991
description: 'Include test matrix job'
7092
required: false
7193
type: boolean
7294
default: true
7395
run-type-check:
74-
description: 'Include type check job'
96+
description: 'Include standalone type check job'
7597
required: false
7698
type: boolean
77-
default: true
99+
default: false
78100
test-script:
79-
description: 'Test command (e.g., "pnpm run test --all")'
101+
description: 'Test command (e.g., "pnpm test")'
80102
required: false
81103
type: string
82-
default: 'pnpm run test --all'
104+
default: 'pnpm test'
83105
test-setup-script:
84106
description: 'Setup script before tests (e.g., "pnpm run build")'
85107
required: false
86108
type: string
87-
default: ''
109+
default: 'pnpm run build'
88110
test-timeout-minutes:
89111
description: 'Timeout for test jobs in minutes'
90112
required: false
@@ -96,10 +118,10 @@ on:
96118
type: string
97119
default: '25.9.0'
98120
type-check-script:
99-
description: 'Type check command (e.g., "pnpm run check")'
121+
description: 'Type check command (e.g., "pnpm run type")'
100122
required: false
101123
type: string
102-
default: 'pnpm run check'
124+
default: 'pnpm run type'
103125
type-check-setup-script:
104126
description: 'Setup script before type checking'
105127
required: false
@@ -128,9 +150,28 @@ concurrency:
128150
cancel-in-progress: true
129151

130152
jobs:
153+
check:
154+
if: inputs.run-check
155+
name: 🔎 Check
156+
runs-on: ubuntu-latest
157+
timeout-minutes: ${{ inputs.check-timeout-minutes }}
158+
steps:
159+
- uses: SocketDev/socket-registry/.github/actions/setup-and-install@f9f6e265d2fb36f7d1c6b557bde308d92151a670 # main
160+
with:
161+
debug: ${{ inputs.debug }}
162+
node-version: ${{ inputs.check-node-version }}
163+
socket-api-key: ${{ secrets.SOCKET_API_KEY }}
164+
working-directory: ${{ inputs.working-directory }}
165+
166+
- uses: SocketDev/socket-registry/.github/actions/run-script@f9f6e265d2fb36f7d1c6b557bde308d92151a670 # main
167+
with:
168+
main-script: ${{ inputs.check-script }}
169+
setup-script: ${{ inputs.check-setup-script }}
170+
working-directory: ${{ inputs.working-directory }}
171+
131172
lint:
132173
if: inputs.run-lint
133-
name: 🧹 Lint Check
174+
name: 🧹 Lint
134175
runs-on: ubuntu-latest
135176
timeout-minutes: ${{ inputs.lint-timeout-minutes }}
136177
steps:
@@ -149,7 +190,7 @@ jobs:
149190

150191
type-check:
151192
if: inputs.run-type-check
152-
name: 🔍 Type Check
193+
name: 🏷️ Type Check
153194
runs-on: ubuntu-latest
154195
timeout-minutes: ${{ inputs.type-check-timeout-minutes }}
155196
steps:

0 commit comments

Comments
 (0)