@@ -25,142 +25,57 @@ concurrency:
2525 group : ${{ github.workflow }}-${{ github.ref }}
2626 cancel-in-progress : true
2727
28+ env :
29+ NODE_VERSION : 20
30+
2831jobs :
2932 test :
3033 if : github.event_name == 'push' || github.event.pull_request.draft == false
3134 timeout-minutes : 15
3235 runs-on : ubuntu-latest
3336 steps :
34- <<<<<<< HEAD
37+ - name : Harden runner
38+ uses : step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7
39+ with :
40+ egress-policy : audit
41+
3542 - name : ⬇️ Checkout code
3643 uses : actions/checkout@v4
3744 with :
3845 persist-credentials : false
3946 fetch-depth : 1
47+
4048 - name : 🟢 Setup Node.js
4149 uses : actions/setup-node@v4
4250 with :
4351 node-version : ${{ env.NODE_VERSION }}
4452 cache : npm
4553 registry-url : https://registry.npmjs.org/
4654 cache-dependency-path : package-lock.json
55+
4756 - name : 📦 Install dependencies
4857 run : npm ci
4958 shell : bash
50- - name : 🔧 Fix Node.js module exports
51- shell : bash
52- run : |
53- set -e
54- set -o pipefail
55- set -Eeuo pipefail
56- echo "Fixing Node.js module export issues..."
57- # Safe file processing without shell injection risks
58- find src/ -name "*.js" -exec grep -l "module.exports" {} \; | while IFS= read -r file; do
59- if [[ -f "$file" ]] && [[ ! $(tail -1 "$file") =~ module\.exports ]]; then
60- echo "// Ensure module.exports is properly defined" >> "$file"
61- echo "Fixed exports in: $file"
62- fi
63- done
64- - name : 🧹 Lint (Resilient)
65- id : lint
66- shell : bash
67- env :
68- EVENT_NAME : " \" ${{ github.event_name }}\" "
69- run : |
70- set -e
71- set -o pipefail
72- set -Eeuo pipefail
73- if [[ ""$EVENT_NAME"" == "pull_request" ]]; then
74- echo "📝 PR Mode: Warnings allowed, errors reported"
75- npm run lint:errors-only || echo "::warning::Lint errors found but not blocking PR"
76- else
77- echo "🔒 Main branch: Strict linting enforced"
78- npm run lint:strict
79- fi
80- continue-on-error : ${{ github.event_name == 'pull_request' }}
81- - name : ✅ Core Tests
82- id : test
83- shell : bash
84- run : |
85- set -e
86- set -o pipefail
87- set -Eeuo pipefail
88- echo "Running critical test suite..."
89- npm test -- --testPathPattern="(core|pipeline|cli)" --maxWorkers=2
90- continue-on-error : false
91- timeout-minutes : 15
92- diagnostics :
93- name : 📊 Quality Diagnostics
94- runs-on : ubuntu-latest
95- timeout-minutes : 20
96- needs :
97- - critical-checks
98- if : always()
99- steps :
100- - name : ⬇️ Checkout code
101- uses : actions/checkout@v4
102- with :
103- persist-credentials : false
104- fetch-depth : 1
105- - name : 🟢 Setup Node.js
106- uses : actions/setup-node@v4
107- with :
108- node-version : ${{ env.NODE_VERSION }}
109- =======
110- - name : Harden runner
111- uses : step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7
112- with :
113- egress-policy : audit
114-
115- - uses : actions/checkout@v4
116- - uses : actions/setup-node@v4
117- with :
118- node-version : 20
119- >>>>>>> develop
120- cache : npm
121- cache-dependency-path : package-lock.json
12259
123- - name : Install
124- run : npm ci
125- <<<<<<< HEAD
126- shell : bash
127- - name : 📊 Full Lint Report
128- shell : bash
129- run : |
130- set -e
131- set -o pipefail
132- set -Eeuo pipefail
133- npm run lint:diagnostic
134- continue-on-error : true
135- - name : 📈 Coverage Report
136- shell : bash
137- run : |
138- set -e
139- set -o pipefail
140- set -Eeuo pipefail
141- npm test -- --coverage --testPathPattern="(core|pipeline)" || echo "Partial coverage generated"
142- continue-on-error : true
143- - name : 📊 Upload Partial Coverage
144- uses : codecov/codecov-action@v4
145- =======
146- - name : Lint
60+ - name : 🧹 Lint
14761 run : npm run lint --if-present
148- - name : Type check
62+
63+ - name : 🔍 Type check
14964 run : npm run typecheck --if-present
150- - name : Test
65+
66+ - name : ✅ Test
15167 run : npm test -- --ci --reporters=default --reporters=jest-junit --passWithNoTests
15268
15369 - name : Upload JUnit
154- >>>>>>> develop
15570 if : always()
156- uses : actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874
71+ uses : actions/upload-artifact@v4
15772 with :
15873 name : junit
15974 path : junit.xml
16075
16176 - name : Upload coverage
16277 if : always()
163- uses : actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874
78+ uses : actions/upload-artifact@v4
16479 with :
16580 name : coverage
16681 path : coverage
@@ -171,105 +86,20 @@ jobs:
17186 timeout-minutes : 5
17287 runs-on : ubuntu-latest
17388 steps :
174- <<<<<<< HEAD
175- - name : ⬇️ Checkout code
176- uses : actions/checkout@v4
177- with :
178- persist-credentials : false
179- fetch-depth : 1
180- - name : 🟢 Setup Node.js
181- uses : actions/setup-node@v4
182- =======
18389 - name : Harden runner
18490 uses : step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7
18591 with :
18692 egress-policy : audit
187- - uses : actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16
188- >>>>>>> develop
93+
94+ - name : Download coverage
95+ uses : actions/download-artifact@v4
18996 with :
19097 name : coverage
19198 path : coverage
19299 continue-on-error : true
193- <<<<<<< HEAD
194- timeout-minutes : ${{ matrix.test-suite.timeout }}
195- deploy :
196- name : 🚀 Deploy & Release
197- runs-on : ubuntu-latest
198- timeout-minutes : 45
199- permissions :
200- contents : write
201- packages : write
202- id-token : write
203- needs :
204- - critical-checks
205- if : |
206- github.ref == 'refs/heads/main' &&
207- needs.critical-checks.outputs.lint-status == 'success' &&
208- needs.critical-checks.outputs.test-status == 'success' &&
209- github.actor != 'github-actions[bot]'
210- steps :
211- - name : ⬇️ Checkout code
212- uses : actions/checkout@v4
213- with :
214- fetch-depth : 0
215- persist-credentials : false
216- - name : 🟢 Setup Node.js
217- uses : actions/setup-node@v4
218- with :
219- node-version : ${{ env.NODE_VERSION }}
220- cache : npm
221- registry-url : https://registry.npmjs.org/
222- cache-dependency-path : package-lock.json
223- - name : 📦 Install dependencies
224- run : npm ci
225- shell : bash
226- - name : ✅ Run tests with coverage
227- shell : bash
228- run : |
229- set -e
230- set -o pipefail
231- set -Eeuo pipefail
232- npm test
233- timeout-minutes : 20
234- - name : 🧪 Validate Fixtures (Non-blocking)
235- shell : bash
236- run : |
237- set -e
238- set -o pipefail
239- set -Eeuo pipefail
240- npm run validate-fixtures || echo "Fixtures validation failed but continuing..."
241- continue-on-error : true
242- - name : 📊 Upload coverage to Codecov
243- uses : codecov/codecov-action@v4
244- =======
100+
245101 - name : Upload to Codecov
246- uses : codecov/codecov-action@015f24e6818733317a2da2edd6290ab26238649a
247- >>>>>>> develop
102+ uses : codecov/codecov-action@v4
248103 with :
249104 token : ${{ secrets.CODECOV_TOKEN }}
250105 fail_ci_if_error : false
251- <<<<<<< HEAD
252- - name : 🚀 Semantic Release
253- shell : bash
254- env :
255- GITHUB_TOKEN : " \" ${{ secrets.GITHUB_TOKEN }}\" "
256- GH_TOKEN : " \" ${{ secrets.GH_TOKEN }}\" "
257- NPM_TOKEN : " \" ${{ secrets.NPM_TOKEN }}\" "
258- NODE_AUTH_TOKEN : " \" ${{ secrets.NPM_TOKEN }}\" "
259- run : |
260- set -e
261- set -o pipefail
262- set -Eeuo pipefail
263- npx semantic-release
264- timeout-minutes : 15
265- - name : 📋 Upload Release Artifacts
266- if : failure()
267- uses : actions/upload-artifact@v4
268- with :
269- name : release-failure-logs
270- path : |
271- npm-debug.log*
272- .npm/_logs/*
273- retention-days : 7
274- =======
275- >>>>>>> develop
0 commit comments