Skip to content

Commit

Permalink
ci: Keep package.json close to the Angular CLI / NestJS CLI defaults
Browse files Browse the repository at this point in the history
  • Loading branch information
mugifly committed Jun 21, 2024
1 parent 69d69aa commit 49a8c9c
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 12 deletions.
41 changes: 33 additions & 8 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,27 +16,52 @@ jobs:
node-version: 20

- name: Install dependencies
id: install_deps
run: npm install
env:
CI: true

- name: Test app
run: npm run test:ci
- name: Test for server (Unit)
run: npm run test --workspace=server -- --ci --reporters=default --reporters=jest-junit
env:
JEST_JUNIT_OUTPUT_NAME: 'junit-unit.xml'
continue-on-error: true

- name: Upload test report for client
- name: Test for server (E2E)
run: npm run test:e2e --workspace=server -- --ci --reporters=default --reporters=jest-junit
env:
JEST_JUNIT_OUTPUT_NAME: 'junit-e2e.xml'
continue-on-error: true

- name: Test for client
run: |
npm run build-api-client
npm run test --workspace=client -- --browsers=ChromeHeadless --reporters=progress,junit --watch=false
continue-on-error: true

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

- name: Upload test report for server (E2E)
uses: mikepenz/action-junit-report@41a3188dde10229782fd78cd72fc574884dd7686
if: always()
with:
check_name: 'Test Report - Server (E2E)'
report_paths: 'server/junit-e2e.xml'
fail_on_failure: True
require_tests: True

- name: Upload test report for server
- name: Upload test report for client
uses: mikepenz/action-junit-report@41a3188dde10229782fd78cd72fc574884dd7686
if: always()
with:
check_name: 'Test Report - Server'
report_paths: 'server/junit.xml'
check_name: 'Test Report - Client'
report_paths: 'client/TESTS-*.xml'
fail_on_failure: True
require_tests: True
3 changes: 1 addition & 2 deletions client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@
"start:dev": "ng serve --proxy-config .proxy.conf.json",
"build": "ng build",
"watch": "ng build --watch --configuration development",
"test": "ng test",
"test:ci": "ng test --browsers=ChromeHeadless --reporters=progress,junit --watch=false"
"test": "ng test"
},
"private": true,
"dependencies": {
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
"build": "npm run build --workspace=server && npm run build-api-client && npm run build --workspace=client",
"build-api-client": "node .utils/api-client-generator-launcher.js",
"test": "npm run test --workspace=server && npm run build-api-client && npm run test --workspace=client",
"test:ci": "concurrently --max-processes=1 --raw --success=all \"npm run test:ci --workspace=server\" \"npm run build-api-client && npm run test:ci --workspace=client\"",
"generate-dev-dummy-page": "node .utils/dev-dummy-page-generator.js",
"ng": "npx --workspace=client ng",
"nest": "npx --workspace=server nest"
Expand Down
1 change: 0 additions & 1 deletion server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
"start:prod": "node dist/main",
"lint": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix",
"test": "jest",
"test:ci": "jest --ci --reporters=default --reporters=jest-junit",
"test:watch": "jest --watch",
"test:cov": "jest --coverage",
"test:debug": "node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand",
Expand Down

0 comments on commit 49a8c9c

Please sign in to comment.