-
Notifications
You must be signed in to change notification settings - Fork 250
80 lines (67 loc) · 2.15 KB
/
Copy pathpr-module-functional-tests.yml
File metadata and controls
80 lines (67 loc) · 2.15 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
name: Module functional tests
on:
pull_request:
paths-ignore:
- 'docs/**'
- '.github/**'
branches:
- master
release:
types:
- created
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
java: [ 21 ]
steps:
- uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v3
with:
distribution: 'temurin'
cache: 'maven'
java-version: ${{ matrix.java }}
- name: Build with Maven
run: mvn package -Dcheckstyle.skip -DskipUnitTests=true --file extra/pom.xml
- name: Run module tests
id: build
run: |
set +e
mvn -B verify \
-DskipUnitTests=true \
-DskipFunctionalTests=true \
-DskipModuleFunctionalTests=false \
-Dtests.max-container-count=5 \
-DdockerfileName=Dockerfile-modules \
-Dcheckstyle.skip \
--file extra/pom.xml | tee build_output.txt
result=${PIPESTATUS[0]}
echo "exit_code=$result" >> "$GITHUB_OUTPUT"
- name: Format build output for PR comment
if: steps.build.outputs.exit_code != '0'
run: |
sed -n '/\[ERROR\] Failures:/,/\[ERROR\] Tests run:/p' build_output.txt > test_failures.txt
summary=$(grep 'Tests run:' build_output.txt | tail -1)
cat <<EOF > comment.txt
${author}, could you please take a look at the functional test failures?
❌ **Module Test Failures**
${summary}
<details>
<summary>Show failed tests details</summary>
\`\`\`
$(cat test_failures.txt)
\`\`\`
</details>
EOF
- name: Comment on PR with build failure output
if: steps.build.outputs.exit_code != '0'
uses: peter-evans/create-or-update-comment@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
issue-number: ${{ github.event.pull_request.number }}
body-path: comment.txt
- name: Fail if error is found in logs
if: steps.build.outputs.exit_code != '0'
run: exit 1