Skip to content

Commit 052b6b5

Browse files
committed
HV-2130 Add a GitHub workflow to prepare TCK results (for certification)
Signed-off-by: marko-bekhta <[email protected]>
1 parent 8c0cbe6 commit 052b6b5

File tree

2 files changed

+201
-13
lines changed

2 files changed

+201
-13
lines changed
Lines changed: 176 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,176 @@
1+
# SPDX-License-Identifier: Apache-2.0
2+
# Copyright Red Hat Inc. and Hibernate Authors
3+
4+
name: "GH Actions TCK report"
5+
6+
on:
7+
push:
8+
tags:
9+
- '[0-9]+.[0-9]+.[0-9]+*'
10+
11+
concurrency:
12+
group: "workflow = ${{ github.workflow }}, ref = ${{ github.event.ref }}, pr = ${{ github.event.pull_request.id }}"
13+
cancel-in-progress: false
14+
15+
defaults:
16+
run:
17+
shell: bash
18+
19+
env:
20+
MAVEN_ARGS: "-e -B --settings .github/mvn-settings.xml --fail-at-end -Pci-build --no-transfer-progress -Dscan=false -Dno-build-cache -Denforcer.skip=true"
21+
REPORT_FILE: "Hibernate-Validator-${{github.ref_name}}-${{matrix.java-version}}-Jakarta-Validation-TCK-Results.asciidoc"
22+
23+
permissions:
24+
contents: read
25+
26+
jobs:
27+
build:
28+
name: JDK ${{ matrix.java-version }} on ${{ matrix.os }}
29+
runs-on: ${{ matrix.os }}
30+
strategy:
31+
fail-fast: false
32+
matrix:
33+
os: [ ubuntu-latest ]
34+
java-version: [ '17', '21' ]
35+
36+
steps:
37+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # 4.2.2
38+
with:
39+
persist-credentials: false
40+
41+
- name: Set up Java ${{ matrix.java-version }}
42+
uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 # 4.7.1
43+
with:
44+
java-version: ${{ matrix.java-version }}
45+
distribution: temurin
46+
47+
- name: Start building the asciidoc report
48+
id: init-report
49+
run: |
50+
echo "== Hibernate Validator ${{github.ref_name}} Jakarta Validation 3.1 TCK Results" > ${{ env.REPORT_FILE }}
51+
echo "" >> ${{ env.REPORT_FILE }}
52+
echo "The following sections contain the test results and environment information for this TCK run." >> ${{ env.REPORT_FILE }}
53+
echo "" >> ${{ env.REPORT_FILE }}
54+
echo "=== The build system information" >> ${{ env.REPORT_FILE }}
55+
echo "" >> ${{ env.REPORT_FILE }}
56+
57+
echo ".Operating system details" >> ${{ env.REPORT_FILE }}
58+
echo "[source,bash]" >> ${{ env.REPORT_FILE }}
59+
echo "----" >> ${{ env.REPORT_FILE }}
60+
uname -a >> ${{ env.REPORT_FILE }}
61+
echo "----" >> ${{ env.REPORT_FILE }}
62+
echo "" >> ${{ env.REPORT_FILE }}
63+
64+
echo ".JDK information" >> ${{ env.REPORT_FILE }}
65+
echo "[source,bash]" >> ${{ env.REPORT_FILE }}
66+
echo "----" >> ${{ env.REPORT_FILE }}
67+
echo "$(java -version 2>&1)" >> ${{ env.REPORT_FILE }}
68+
echo "----" >> ${{ env.REPORT_FILE }}
69+
echo "" >> ${{ env.REPORT_FILE }}
70+
71+
echo ".Maven information" >> ${{ env.REPORT_FILE }}
72+
echo "[source,bash]" >> ${{ env.REPORT_FILE }}
73+
echo "----" >> ${{ env.REPORT_FILE }}
74+
mvn -v >> ${{ env.REPORT_FILE }}
75+
echo "----" >> ${{ env.REPORT_FILE }}
76+
echo "" >> ${{ env.REPORT_FILE }}
77+
78+
echo "=== Test results" >> ${{ env.REPORT_FILE }}
79+
echo "" >> ${{ env.REPORT_FILE }}
80+
81+
- name: TCK in standalone mode
82+
id: tck-standalone
83+
run: |
84+
./mvnw $MAVEN_ARGS clean verify -pl :hibernate-validator-tck-runner
85+
86+
echo ".TCK tests in the standalone mode" >> ${{ env.REPORT_FILE }}
87+
echo "[source,bash]" >> ${{ env.REPORT_FILE }}
88+
echo "----" >> ${{ env.REPORT_FILE }}
89+
echo "$(cat tck-runner/target/surefire-reports/TestSuite-default.txt)" >> ${{ env.REPORT_FILE }}
90+
echo "----" >> ${{ env.REPORT_FILE }}
91+
echo "" >> ${{ env.REPORT_FILE }}
92+
echo "Test results available for the download are link:tck-standalone-report-${{github.ref_name}}-${{matrix.java-version}}.html[here]." >> ${{ env.REPORT_FILE }}
93+
echo "" >> ${{ env.REPORT_FILE }}
94+
95+
- name: Upload TCK Report as an Artifact
96+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # 4.6.2
97+
with:
98+
name: tck-standalone-report-html-${{matrix.java-version}}
99+
path: tck-runner/target/surefire-reports/emailable-report.html
100+
101+
- name: TCK in container mode
102+
id: tck-container
103+
run: |
104+
./mvnw $MAVEN_ARGS clean verify -pl :hibernate-validator-tck-runner -Dincontainer -Dincontainer-prepared
105+
106+
echo ".TCK tests in the container mode" >> ${{ env.REPORT_FILE }}
107+
echo "[source,bash]" >> ${{ env.REPORT_FILE }}
108+
echo "----" >> ${{ env.REPORT_FILE }}
109+
echo "$(cat tck-runner/target/surefire-reports/TestSuite-default.txt)" >> ${{ env.REPORT_FILE }}
110+
echo "----" >> ${{ env.REPORT_FILE }}
111+
echo "" >> ${{ env.REPORT_FILE }}
112+
echo "Test results available for the download are link:tck-container-report-${{github.ref_name}}-${{matrix.java-version}}.html[here]." >> ${{ env.REPORT_FILE }}
113+
echo "" >> ${{ env.REPORT_FILE }}
114+
115+
- name: Upload TCK Report as an Artifact
116+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # 4.6.2
117+
with:
118+
name: tck-container-report-html-${{matrix.java-version}}
119+
path: tck-runner/target/surefire-reports/emailable-report.html
120+
121+
- name: Signature test
122+
id: tck-sigtest
123+
run: |
124+
./mvnw $MAVEN_ARGS clean verify -pl :hibernate-validator-tck-runner -Psigtest
125+
126+
echo ".Signature test results" >> ${{ env.REPORT_FILE }}
127+
echo "[source,bash]" >> ${{ env.REPORT_FILE }}
128+
echo "----" >> ${{ env.REPORT_FILE }}
129+
echo "$(cat tck-runner/target/surefire-reports/sigtest/report.xml)" >> ${{ env.REPORT_FILE }}
130+
echo "----" >> ${{ env.REPORT_FILE }}
131+
echo "" >> ${{ env.REPORT_FILE }}
132+
echo "Test results available for the download are link:tck-signature-report-${{github.ref_name}}-${{matrix.java-version}}.xml[here]." >> ${{ env.REPORT_FILE }}
133+
echo "" >> ${{ env.REPORT_FILE }}
134+
135+
- name: Upload TCK Report as an Artifact
136+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # 4.6.2
137+
with:
138+
name: tck-signature-report-xml-${{matrix.java-version}}
139+
path: tck-runner/target/surefire-reports/sigtest/report.xml
140+
141+
- name: Finish asciidoc report
142+
id: final-report
143+
run: |
144+
echo "=== File signatures" >> ${{ env.REPORT_FILE }}
145+
echo "" >> ${{ env.REPORT_FILE }}
146+
147+
echo ".SHA256 validation-tck-distribution.zip" >> ${{ env.REPORT_FILE }}
148+
echo "[source,bash]" >> ${{ env.REPORT_FILE }}
149+
echo "----" >> ${{ env.REPORT_FILE }}
150+
echo "$(sha256sum tck-runner/target/tck-dependencies/validation-tck-distribution.zip)" >> ${{ env.REPORT_FILE }}
151+
echo "----" >> ${{ env.REPORT_FILE }}
152+
echo "" >> ${{ env.REPORT_FILE }}
153+
154+
echo ".SHA256 validation-tck-tests.jar" >> ${{ env.REPORT_FILE }}
155+
echo "[source,bash]" >> ${{ env.REPORT_FILE }}
156+
echo "----" >> ${{ env.REPORT_FILE }}
157+
echo "$(sha256sum tck-runner/target/tck-dependencies/validation-tck-tests.jar)" >> ${{ env.REPORT_FILE }}
158+
echo "----" >> ${{ env.REPORT_FILE }}
159+
echo "" >> ${{ env.REPORT_FILE }}
160+
161+
echo ".SHA256 jakarta.validation-api.jar" >> ${{ env.REPORT_FILE }}
162+
echo "[source,bash]" >> ${{ env.REPORT_FILE }}
163+
echo "----" >> ${{ env.REPORT_FILE }}
164+
echo "$(sha256sum tck-runner/target/tck-dependencies/jakarta.validation-api.jar)" >> ${{ env.REPORT_FILE }}
165+
echo "----" >> ${{ env.REPORT_FILE }}
166+
echo "" >> ${{ env.REPORT_FILE }}
167+
168+
echo "Report output:"
169+
cat ${{ env.REPORT_FILE }}
170+
171+
- name: Upload Final Report as an Artifact
172+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # 4.6.2
173+
with:
174+
name: final-report-${{matrix.java-version}}
175+
path: ${{ env.REPORT_FILE }}
176+

tck-runner/pom.xml

Lines changed: 25 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -107,43 +107,54 @@
107107
<artifactId>maven-dependency-plugin</artifactId>
108108
<executions>
109109
<execution>
110-
<id>copy-tck-bv-api-signature-file</id>
110+
<id>copy-tck-test-suite-file</id>
111111
<phase>generate-test-sources</phase>
112112
<goals>
113-
<goal>unpack</goal>
113+
<goal>copy</goal>
114114
</goals>
115115
<configuration>
116+
<stripVersion>true</stripVersion>
116117
<artifactItems>
117118
<artifactItem>
118119
<groupId>jakarta.validation</groupId>
119120
<artifactId>validation-tck-tests</artifactId>
120-
<version>${version.jakarta.validation.validation-tck}</version>
121-
<type>jar</type>
122-
<overWrite>true</overWrite>
121+
<type>xml</type>
122+
<classifier>suite</classifier>
123+
<overWrite>false</overWrite>
123124
</artifactItem>
124125
</artifactItems>
125-
<!-- We just need the signature file and nothing else -->
126-
<includes>**/*.sig</includes>
127-
<outputDirectory>${project.build.directory}/api-signature</outputDirectory>
128126
</configuration>
129127
</execution>
130128
<execution>
131-
<id>copy-tck-test-suite-file</id>
129+
<id>copy-tck-dependencies</id>
132130
<phase>generate-test-sources</phase>
133131
<goals>
134132
<goal>copy</goal>
135133
</goals>
136134
<configuration>
137-
<stripVersion>true</stripVersion>
135+
<outputDirectory>${project.build.directory}/tck-dependencies</outputDirectory>
138136
<artifactItems>
137+
<artifactItem>
138+
<groupId>jakarta.validation</groupId>
139+
<artifactId>jakarta.validation-api</artifactId>
140+
</artifactItem>
141+
<artifactItem>
142+
<groupId>jakarta.validation</groupId>
143+
<artifactId>validation-tck-distribution</artifactId>
144+
<version>${version.jakarta.validation.validation-tck}</version>
145+
<type>zip</type>
146+
</artifactItem>
139147
<artifactItem>
140148
<groupId>jakarta.validation</groupId>
141149
<artifactId>validation-tck-tests</artifactId>
142-
<type>xml</type>
143-
<classifier>suite</classifier>
144-
<overWrite>false</overWrite>
150+
<version>${version.jakarta.validation.validation-tck}</version>
151+
</artifactItem>
152+
<artifactItem>
153+
<groupId>jakarta.validation</groupId>
154+
<artifactId>jakarta.validation-api</artifactId>
145155
</artifactItem>
146156
</artifactItems>
157+
<stripVersion>true</stripVersion>
147158
</configuration>
148159
</execution>
149160
</executions>
@@ -379,6 +390,7 @@
379390
jakarta.validation.valueextraction
380391
</packages>
381392
<sigfile>${sigtest.signature-file}</sigfile>
393+
<report>${project.build.directory}/surefire-reports/sigtest/report.xml</report>
382394
</configuration>
383395
</plugin>
384396
</plugins>

0 commit comments

Comments
 (0)