@@ -52,74 +52,42 @@ jobs:
5252 continue-on-error : true
5353
5454 - name : Build
55+ uses : ./.github/actions/run-npm-script
5556 id : build
56- continue-on-error : true
57- run : |
58- if ! [ -f package.json ] || ! jq -e '.scripts.build' package.json > /dev/null; then
59- echo "No build script found in package.json."
60- echo "build_status=notpresent" >> $GITHUB_OUTPUT
61- exit 0
62- fi
63- if npm run build; then
64- echo "build_status=success" >> $GITHUB_OUTPUT
65- else
66- echo "build_status=failure" >> $GITHUB_OUTPUT
67- fi
57+ with :
58+ working-directory : ' .'
59+ script : build
6860
6961 - name : Lint
62+ uses : ./.github/actions/run-npm-script
7063 id : lint
71- continue-on-error : true
72- run : |
73- if ! [ -f package.json ] || ! jq -e '.scripts.["lint:check"]' package.json > /dev/null; then
74- echo "No lint script found in package.json."
75- echo "lint_status=notpresent" >> $GITHUB_OUTPUT
76- exit 0
77- fi
78- if npm run lint:check; then
79- echo "lint_status=success" >> $GITHUB_OUTPUT
80- else
81- echo "lint_status=failure" >> $GITHUB_OUTPUT
82- fi
64+ with :
65+ working-directory : ' .'
66+ script : lint:check
8367
8468 - name : Format
69+ uses : ./.github/actions/run-npm-script
8570 id : format
86- continue-on-error : true
87- run : |
88- if ! [ -f package.json ] || ! jq -e '.scripts.["format:check"]' package.json > /dev/null; then
89- echo "No format script found in package.json."
90- echo "format_status=notpresent" >> $GITHUB_OUTPUT
91- exit 0
92- fi
93- if npm run format:check; then
94- echo "format_status=success" >> $GITHUB_OUTPUT
95- else
96- echo "format_status=failure" >> $GITHUB_OUTPUT
97- fi
71+ with :
72+ working-directory : ' .'
73+ script : format:check
9874
9975 - name : Test
76+ uses : ./.github/actions/run-npm-script
10077 id : test
101- continue-on-error : true
102- run : |
103- if ! [ -f package.json ] || ! jq -e '.scripts.test' package.json > /dev/null; then
104- echo "No test script found in package.json."
105- echo "test_status=notpresent" >> $GITHUB_OUTPUT
106- exit 0
107- fi
108- if npm test; then
109- echo "test_status=success" >> $GITHUB_OUTPUT
110- else
111- echo "test_status=failure" >> $GITHUB_OUTPUT
112- fi
78+ with :
79+ working-directory : ' .'
80+ script : test
11381
11482 - name : Job Summary
11583 if : always()
11684 env :
11785 AUDIT_STATUS : ${{ steps.audit-npm.outputs.gate_passed == 'true' && 'success' || 'failure' }}
11886 AUDIT_SUMMARY : ${{ steps.audit-npm.outputs.gate_summary }}
119- BUILD_STATUS : ${{ steps.build.outputs.build_status || steps.build.outcome }}
120- LINT_STATUS : ${{ steps.lint.outputs.lint_status || steps.lint.outcome }}
121- FORMAT_STATUS : ${{ steps.format.outputs.format_status || steps.format.outcome }}
122- TEST_STATUS : ${{ steps.test.outputs.test_status || steps.test.outcome }}
87+ BUILD_STATUS : ${{ steps.build.outputs.status || steps.build.outcome }}
88+ LINT_STATUS : ${{ steps.lint.outputs.status || steps.lint.outcome }}
89+ FORMAT_STATUS : ${{ steps.format.outputs.status || steps.format.outcome }}
90+ TEST_STATUS : ${{ steps.test.outputs.status || steps.test.outcome }}
12391 run : |
12492 status_emoji () {
12593 case "$1" in
0 commit comments