Skip to content

Commit 2bc6d06

Browse files
committed
Report test result to GitHub Actions summary and checks
1 parent 73f3ea3 commit 2bc6d06

File tree

2 files changed

+23
-1
lines changed

2 files changed

+23
-1
lines changed

.github/workflows/build.yml

+22-1
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,33 @@ jobs:
3939
- name: npm test
4040
run: npm test
4141

42+
- name: npm run tap-junit-report
43+
run: npm run tap-junit-report || true
44+
45+
- name: upload artifact
46+
uses: actions/upload-artifact@v4
47+
if: success() || failure()
48+
with:
49+
name: 'qrcode-tests-report-nodejs_${{ matrix.node }}'
50+
path: 'test-results.xml'
51+
compression-level: 0
52+
53+
- name: test report
54+
uses: dorny/test-reporter@eaa763f6ffc21c7a37837f56cd5f9737f27fc6c8 # 1.8.0
55+
if: success() || failure()
56+
with:
57+
name: 'qrcode-tests-nodejs_${{ matrix.node }}'
58+
path: 'test-results.xml'
59+
reporter: jest-junit
60+
fail-on-error: false
61+
4262
- name: npm pack
63+
if: always()
4364
run: npm pack
4465

4566
- name: upload artifact
4667
uses: actions/upload-artifact@v4
4768
with:
4869
name: qrcode_nodejs_${{ matrix.node }}
4970
path: '*.tgz'
50-
compression-level: 0
71+
compression-level: 0

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
"lint": "standard",
3232
"pretest": "npm run lint",
3333
"test": "node --throw-deprecation test.js",
34+
"tap-junit-report": "tap replay -R junit --coverage-report=none --allow-empty-coverage --allow-incomplete-coverage 'test/**/*.test.js' > test-results.xml",
3435
"build": "rollup -c",
3536
"prepublish": "npm run build",
3637
"browser": "node examples/clientsideserver.js"

0 commit comments

Comments
 (0)