Skip to content

Commit

Permalink
ci: Publish the test reports on GitHub Checks
Browse files Browse the repository at this point in the history
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
  • Loading branch information
mugifly committed May 8, 2022
1 parent e7236d8 commit 062662a
Show file tree
Hide file tree
Showing 9 changed files with 1,812 additions and 333 deletions.
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ client/node_modules/
server/node_modules/
client/dist/
server/dist/
client/TESTS-*.xml
server/junit.xml

# VCS files
.git/
Expand Down
18 changes: 17 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,20 @@ jobs:
CI: true

- name: Test app
run: npm run test-ci
run: npm run test:ci

- name: Upload test report for client
uses: mikepenz/action-junit-report@41a3188dde10229782fd78cd72fc574884dd7686
if: always()
with:
check_name: 'Test Report - Client'
report_paths: 'client/TESTS-*.xml'
require_tests: True

- name: Upload test report for server
uses: mikepenz/action-junit-report@41a3188dde10229782fd78cd72fc574884dd7686
if: always()
with:
check_name: 'Test Report - Server'
report_paths: 'server/junit.xml'
require_tests: True
2 changes: 2 additions & 0 deletions client/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,12 @@ yarn-error.log
/libpeerconnection.log
testem.log
/typings
TESTS-*.xml

# System files
.DS_Store
Thumbs.db

# API Client
.api-client/

1 change: 1 addition & 0 deletions client/karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ module.exports = function (config) {
require('karma-chrome-launcher'),
require('karma-jasmine-html-reporter'),
require('karma-coverage'),
require('karma-junit-reporter'),
require('@angular-devkit/build-angular/plugins/karma'),
],
client: {
Expand Down
4 changes: 3 additions & 1 deletion client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
"start:dev": "ng serve --proxy-config .proxy.conf.json",
"build": "ng build",
"watch": "ng build --watch --configuration development",
"test": "ng test"
"test": "ng test",
"test:ci": "ng test --browsers=ChromeHeadless --reporters=progress,junit --watch=false"
},
"private": true,
"dependencies": {
Expand Down Expand Up @@ -37,6 +38,7 @@
"karma-coverage": "~2.1.0",
"karma-jasmine": "~4.0.0",
"karma-jasmine-html-reporter": "~1.7.0",
"karma-junit-reporter": "^2.0.1",
"typescript": "~4.6.2"
}
}
Loading

0 comments on commit 062662a

Please sign in to comment.