Skip to content

Commit

Permalink
chore(gh): publish test reports (#972)
Browse files Browse the repository at this point in the history
  • Loading branch information
timonback authored Sep 14, 2024
1 parent 58c0390 commit aacd4a3
Show file tree
Hide file tree
Showing 6 changed files with 84 additions and 1 deletion.
12 changes: 12 additions & 0 deletions .github/workflows/springwolf-core.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ on:
types: [ opened, synchronize, ready_for_review ]
workflow_dispatch:

permissions:
contents: read
checks: write
id-token: write

jobs:
build:

Expand All @@ -32,6 +37,13 @@ jobs:
- name: Run build, check, analyzeDependencies
run: ./gradlew -p springwolf-core build

- name: Publish Test Report
uses: mikepenz/action-junit-report@v4
if: success() || failure()
with:
check_name: test-core
report_paths: '**/build/test-results/test/TEST-*.xml'

- name: Publish package
if: github.ref == 'refs/heads/master'
run: ./gradlew -p springwolf-core publish
Expand Down
15 changes: 14 additions & 1 deletion .github/workflows/springwolf-plugins.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ on:
types: [ opened, synchronize, ready_for_review ]
workflow_dispatch:

permissions:
contents: read
checks: write
id-token: write

jobs:
build:

Expand Down Expand Up @@ -53,14 +58,22 @@ jobs:
- name: Run build, check, analyzeDependencies on example
run: ./gradlew -p ${{ env.example }} build

- name: Publish Test Report
uses: mikepenz/action-junit-report@v4
if: success() || failure()
with:
check_name: test-${{ matrix.plugin }}-junit
require_tests: true
report_paths: '**/build/test-results/test/TEST-*.xml'

- name: Run e2e tests
run: ./gradlew -p springwolf-examples/e2e npm_run_test
env:
SPRINGWOLF_EXAMPLE: ${{ matrix.plugin }}
- uses: actions/upload-artifact@v4
if: always()
with:
name: playwright-report-${{ matrix.plugin }}
name: test-${{ matrix.plugin }}-playwright
path: springwolf-examples/e2e/playwright-report/
retention-days: 14

Expand Down
11 changes: 11 additions & 0 deletions .github/workflows/springwolf-ui.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ on:
types: [ opened, synchronize, ready_for_review ]
workflow_dispatch:

permissions:
contents: read
checks: write
id-token: write

env:
project: springwolf-ui

Expand All @@ -34,6 +39,12 @@ jobs:

- name: Test
run: ./gradlew -p ${{ env.project }} npm_run_test
- name: Publish Test Report
uses: mikepenz/action-junit-report@v4
if: success() || failure()
with:
check_name: test-ui-jest
report_paths: '**/build/test-results/test/*.xml'

- name: Build
run: ./gradlew -p ${{ env.project }} build
Expand Down
4 changes: 4 additions & 0 deletions springwolf-ui/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ const esModules = ['@angular', 'jsonpath-plus', '@stoplight', 'nimma', 'prism-co

const config = {
preset: 'jest-preset-angular',
reporters: [
"default",
"jest-junit"
],
setupFilesAfterEnv: ['<rootDir>/setup-jest.ts'],
"modulePathIgnorePatterns": [
"<rootDir>/build/"
Expand Down
34 changes: 34 additions & 0 deletions springwolf-ui/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions springwolf-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,16 @@
"angular-in-memory-web-api": "^0.18.0",
"esbuild": "^0.23.1",
"jest": "^29.7.0",
"jest-junit": "^16.0.0",
"jest-preset-angular": "^14.2.2",
"typescript": "^5.5.4"
},
"jest-junit": {
"ancestorSeparator": "",
"outputDirectory": "build/test-results/test",
"uniqueOutputName": "false",
"suiteNameTemplate": "{filepath}",
"classNameTemplate": "{classname}",
"titleTemplate": "{title}"
}
}

0 comments on commit aacd4a3

Please sign in to comment.