Fix test #911
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Test Pipeline | |
on: [ push, pull_request ] | |
permissions: | |
contents: read | |
actions: read | |
checks: write | |
jobs: | |
soundness-check: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'zulu' | |
java-version: 17 | |
- name: Setup Gradle and run 'generateOpenApiDocs' task | |
uses: gradle/actions/setup-gradle@v3 | |
with: | |
arguments: generateOpenApiDocs | |
- name: Verify that OpenApi documentation in git is up-to-date | |
uses: tj-actions/verify-changed-files@v18 | |
id: verify-open-api-documentation | |
with: | |
files: | | |
docs/swagger.json | |
- name: Alert that OpenApi documentation changed | |
if: steps.verify-open-api-documentation.outputs.files_changed == 'true' | |
run: | | |
echo "Changed files: ${{ steps.verify-open-api-documentation.outputs.changed_files }}" | |
for FILE in ${{ steps.verify-open-api-documentation.outputs.changed_files }} | |
do | |
git diff $FILE | |
done | |
exit 1 | |
- name: Regenerate webapp API client | |
uses: gradle/actions/setup-gradle@v3 | |
with: | |
arguments: openApiGenerate | |
- name: Verify that webapp API client in git is up-to-date | |
uses: tj-actions/verify-changed-files@v18 | |
id: verify-webapp-api-client | |
with: | |
files: | | |
webapp/src/api/* | |
!webapp/src/api/.openapi-generator/* | |
- name: Alert that webapp API client changed | |
if: steps.verify-webapp-api-client.outputs.files_changed == 'true' | |
run: | | |
echo "Changed files: ${{ steps.verify-webapp-api-client.outputs.changed_files }}" | |
for FILE in ${{ steps.verify-open-api-documentation.outputs.changed_files }} | |
do | |
git diff $FILE | |
done | |
exit 1 | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'zulu' | |
java-version: 17 | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '18.x' | |
- name: Start MongoDB | |
uses: supercharge/[email protected] | |
with: | |
mongodb-version: '6.0' | |
mongodb-username: admin | |
mongodb-password: admin | |
- name: Download Webapp dependencies | |
working-directory: ./webapp | |
run: npm install | |
- name: Build Webapp into the Server | |
working-directory: ./webapp | |
run: npm run build | |
- name: Instrument WebApp | |
if: github.event_name != 'pull_request' | |
working-directory: ./webapp | |
run: npm exec -c "javascript-instrumenter ../server/src/main/resources/static/assets/** --in-place --include-origin 'webapp/src/**' --exclude-origin 'node_modules/**' --collector localhost:54321" | |
- name: Setup playwright | |
uses: gradle/actions/setup-gradle@v3 | |
with: | |
arguments: playwright --args "install --with-deps" | |
- name: Start Coverage Collector | |
if: github.event_name != 'pull_request' | |
working-directory: ./webapp | |
run: npm exec -c 'coverage-collector --dump-after-mins 3 --port 54321 --dump-to-folder ../js-profiler-coverage/' & echo $! > ../collector.pid | |
- name: Setup and execute Gradle 'test' task | |
uses: gradle/actions/setup-gradle@v3 | |
with: | |
arguments: test | |
env: | |
RUNNING_IN_CI: true | |
- name: Stop Coverage Collector | |
if: github.event_name != 'pull_request' | |
run: | | |
if [ -f ./collector.pid ]; then | |
kill -SIGINT $(cat ./collector.pid) || echo "Collector was already stopped." | |
sleep 5 | |
rm ./collector.pid | |
fi | |
- name: Upload Backend Coverage to Teamscale | |
uses: 'cqse/[email protected]' | |
if: github.event_name != 'pull_request' | |
with: | |
server: 'https://pnp-nexus.de/teamscale/' | |
project: 'pnp-nexus' | |
user: 'build' | |
accesskey: ${{ secrets.TEAMSCALE_BUILD_ACCESS_KEY }} | |
partition: 'Github Action > JaCoCo' | |
format: 'JACOCO' | |
message: 'Uploading coverage of the server.' | |
files: 'server/build/reports/jacoco/test/jacocoTestReport.xml' | |
- name: Upload Fronted Coverage to Teamscale | |
uses: 'cqse/[email protected]' | |
if: github.event_name != 'pull_request' | |
with: | |
server: 'https://pnp-nexus.de/teamscale/' | |
project: 'pnp-nexus' | |
user: 'build' | |
accesskey: ${{ secrets.TEAMSCALE_BUILD_ACCESS_KEY }} | |
partition: 'Github Action > Typescript' | |
format: 'SIMPLE' | |
message: 'Uploading coverage of the webapp.' | |
files: 'js-profiler-coverage/**.simple' | |
- name: Test Report | |
uses: dorny/test-reporter@v1 | |
if: always() | |
with: | |
name: Server Tests | |
path: server/build/test-results/**/*.xml | |
reporter: java-junit | |
- name: Upload Junit Results | |
uses: actions/upload-artifact@v4 | |
if: always() | |
with: | |
name: test-report-server | |
path: server/build/reports/tests/test | |
- name: Upload Jacoco Reports | |
uses: actions/upload-artifact@v4 | |
if: always() | |
with: | |
name: coverage-report-server | |
path: server/build/reports/jacoco/test |