Skip to content

Commit 062662a

Browse files
committed
ci: Publish the test reports on GitHub Checks
Squashed commit of the following: commit c238850 Author: mugifly <mp@ohgita.info> Date: Sun May 8 19:35:10 2022 +0900 chore: Ignore CI files on Docker commit a867081 Author: mugifly <mp@ohgita.info> Date: Sun May 8 19:25:48 2022 +0900 ci: Publish the test reports to GitHub Checks on GitHub Actions commit fafa93f Author: mugifly <mp@ohgita.info> Date: Sun May 8 19:08:54 2022 +0900 ci: `test:ci` npm script - It runs tests and generates JUnit report
1 parent e7236d8 commit 062662a

File tree

9 files changed

+1812
-333
lines changed

9 files changed

+1812
-333
lines changed

.dockerignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ client/node_modules/
44
server/node_modules/
55
client/dist/
66
server/dist/
7+
client/TESTS-*.xml
8+
server/junit.xml
79

810
# VCS files
911
.git/

.github/workflows/build.yml

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,20 @@ jobs:
2121
CI: true
2222

2323
- name: Test app
24-
run: npm run test-ci
24+
run: npm run test:ci
25+
26+
- name: Upload test report for client
27+
uses: mikepenz/action-junit-report@41a3188dde10229782fd78cd72fc574884dd7686
28+
if: always()
29+
with:
30+
check_name: 'Test Report - Client'
31+
report_paths: 'client/TESTS-*.xml'
32+
require_tests: True
33+
34+
- name: Upload test report for server
35+
uses: mikepenz/action-junit-report@41a3188dde10229782fd78cd72fc574884dd7686
36+
if: always()
37+
with:
38+
check_name: 'Test Report - Server'
39+
report_paths: 'server/junit.xml'
40+
require_tests: True

client/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,12 @@ yarn-error.log
3636
/libpeerconnection.log
3737
testem.log
3838
/typings
39+
TESTS-*.xml
3940

4041
# System files
4142
.DS_Store
4243
Thumbs.db
4344

4445
# API Client
4546
.api-client/
47+

client/karma.conf.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ module.exports = function (config) {
1010
require('karma-chrome-launcher'),
1111
require('karma-jasmine-html-reporter'),
1212
require('karma-coverage'),
13+
require('karma-junit-reporter'),
1314
require('@angular-devkit/build-angular/plugins/karma'),
1415
],
1516
client: {

client/package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
"start:dev": "ng serve --proxy-config .proxy.conf.json",
88
"build": "ng build",
99
"watch": "ng build --watch --configuration development",
10-
"test": "ng test"
10+
"test": "ng test",
11+
"test:ci": "ng test --browsers=ChromeHeadless --reporters=progress,junit --watch=false"
1112
},
1213
"private": true,
1314
"dependencies": {
@@ -37,6 +38,7 @@
3738
"karma-coverage": "~2.1.0",
3839
"karma-jasmine": "~4.0.0",
3940
"karma-jasmine-html-reporter": "~1.7.0",
41+
"karma-junit-reporter": "^2.0.1",
4042
"typescript": "~4.6.2"
4143
}
4244
}

0 commit comments

Comments
 (0)