-
Notifications
You must be signed in to change notification settings - Fork 0
117 lines (105 loc) · 4.62 KB
/
run-integration-tests.yml
File metadata and controls
117 lines (105 loc) · 4.62 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
name: Run integration tests
on:
workflow_dispatch:
push:
branches: [ develop ]
paths-ignore:
- '**.md'
- '.config/**'
- '.github/**'
- '.idea/**'
- 'assets/**'
pull_request:
branches: [ develop ]
paths-ignore:
- '**.md'
- '.config/**'
- '.github/**'
- '.idea/**'
- 'assets/**'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
jobs:
run-integration-tests:
strategy:
fail-fast: false
matrix:
project: [persistence-it, webapp-it]
parallel: [0, 2]
pre-start: [false, true]
java: [21]
include:
- project: webapp-it
jacoco: true
video: true
name: "run-integration-tests (${{matrix.project}}, ${{matrix.parallel}}, ${{matrix.pre-start}}, ${{matrix.java}})"
runs-on: ubuntu-latest
if: ${{ !(github.event_name == 'pull_request' && startsWith(github.head_ref, 'renovate/')) }}
permissions:
contents: read
checks: write # JaCoCo Coverage Report check
steps:
- uses: actions/checkout@v6
- name: Set up JDK
uses: actions/setup-java@v5
with:
distribution: temurin
java-version: ${{ matrix.java }}
- name: Cache Maven
uses: actions/cache@v5
with:
path: ~/.m2/repository
key: ${{ runner.os }}-mvn-it-build-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-mvn-it-build-
${{ runner.os }}-mvn-build-
- name: Test
run: |
./mvnw -B test \
-pl "advanced-demo/integration-tests/${{ matrix.project }}" -am \
-P run-it${{ matrix.jacoco && ',jacoco' || '' }} \
${{ matrix.pre-start && '-Dinfra-pre-start.enabled=1 ' || '' }} \
${{ matrix.parallel > 0 && format('-Djunit.jupiter.execution.parallel.enabled=true -Djunit.jupiter.execution.parallel.mode.default=concurrent -Djunit.jupiter.execution.parallel.mode.classes.default=concurrent -Djunit.jupiter.execution.parallel.config.strategy=fixed -Djunit.jupiter.execution.parallel.config.fixed.parallelism=2 -Djunit.jupiter.execution.parallel.config.fixed.max-pool-size={0} ', matrix.parallel) || '' }}
# Replace '/' with '-'
- name: Normalize project name
if: ${{ !cancelled() }}
env:
PROJECT: ${{ matrix.project }}
run: echo PROJECT_NORMALIZED=${PROJECT/\//-} >> $GITHUB_ENV
- name: Upload videos of test failures
if: ${{ matrix.video && failure() }}
uses: actions/upload-artifact@v7
with:
name: test-fail-videos-${{ matrix.java }}-${{ env.PROJECT_NORMALIZED }}-${{ matrix.parallel }}-${{ matrix.pre-start }}
path: advanced-demo/integration-tests/${{ matrix.project }}/target/records
if-no-files-found: ignore
- name: Aggregate WebApp JaCoCo report
if: ${{ matrix.jacoco && success() }}
# Important: Also run compile (if not already done) so that we have all class files - otherwise the report will be incomplete
run: |
./mvnw -B compile jacoco-aggregator:report-aggregate-all -pl "advanced-demo/webapp" -am -T2C
- name: Upload WebApp JaCoCo report
if: ${{ matrix.jacoco && success() }}
uses: actions/upload-artifact@v7
with:
name: webapp-jacoco-report-${{ matrix.java }}-${{ env.PROJECT_NORMALIZED }}-${{ matrix.parallel }}-${{ matrix.pre-start }}
path: advanced-demo/target/site/jacoco-aggregate
if-no-files-found: ignore
- name: WebApp JaCoCo Code Coverage Report
if: ${{ matrix.jacoco && success() }}
id: jacoco_reporter
uses: PavanMudigonda/jacoco-reporter@e8b54bfea6a667d1a68624dae8a06ba31670667d # v5.1
with:
coverage_results_path: advanced-demo/target/site/jacoco-aggregate/jacoco.xml
coverage_report_name: WebApp Coverage (${{matrix.parallel}}, ${{matrix.pre-start}}, ${{matrix.java}})
coverage_report_title: JaCoCo
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Add WebApp JaCoCo report to workflow run summary
if: ${{ matrix.jacoco && success() }}
run: |
echo "| Outcome | Value |" >> $GITHUB_STEP_SUMMARY
echo "| --- | --- |" >> $GITHUB_STEP_SUMMARY
echo "| Code Coverage % | ${{ steps.jacoco_reporter.outputs.coverage_percentage }} |" >> $GITHUB_STEP_SUMMARY
echo "| :heavy_check_mark: Number of Lines Covered | ${{ steps.jacoco_reporter.outputs.covered_lines }} |" >> $GITHUB_STEP_SUMMARY
echo "| :x: Number of Lines Missed | ${{ steps.jacoco_reporter.outputs.missed_lines }} |" >> $GITHUB_STEP_SUMMARY
echo "| Total Number of Lines | ${{ steps.jacoco_reporter.outputs.total_lines }} |" >> $GITHUB_STEP_SUMMARY