forked from quarkusio/quarkus
-
Notifications
You must be signed in to change notification settings - Fork 0
140 lines (137 loc) · 5.61 KB
/
jdk-early-access-build.yml
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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
name: Quarkus Early Access JDK Build
on:
schedule:
# midnight every weekday + saturday
- cron: '0 0 * * 1-6'
workflow_dispatch:
inputs:
jdkVersion:
description: 'JDK version'
required: true
# make sure to keep the matrix entries (see below) in sync!
default: '21'
jdkDistribution:
description: 'JDK distribution'
required: true
# make sure to keep the matrix entries (see below) in sync!
default: 'jdk.java.net'
env:
# Workaround testsuite locale issue
LANG: en_US.UTF-8
MAVEN_OPTS: -Xmx2g -XX:MaxMetaspaceSize=1g
JVM_TEST_MAVEN_OPTS: "-e -B --settings .github/mvn-settings.xml -Dtest-containers -Dstart-containers -Dtest-resteasy-reactive-large-files -Dformat.skip"
DB_USER: hibernate_orm_test
DB_PASSWORD: hibernate_orm_test
DB_NAME: hibernate_orm_test
jobs:
linux-jvm-test:
name: JVM Tests - Early Access JDK ${{ matrix.version }} Build - ${{ matrix.dist }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
# This is complex because we want to use a different matrix when using workflow_dispatch.
# See https://docs.github.com/en/actions/learn-github-actions/expressions#example-returning-a-json-object
# for the code that inspired this.
# The first matrix (with a single entry) gets executed when using workflow_dispatch only.
# The second matrix (with multiple entries) get executed when NOT using workflow_dispatch.
# When adding a newer JDK here, make sure to update the defaults of workflow_dispatch inputs (see top of this file).
matrix: >-
${{
fromJSON(
github.event_name == 'workflow_dispatch'
&& format( '{{ "include": [{{ "version": "{0}", "dist": "{1}" }}] }}',
github.event.inputs.jdkVersion, github.event.inputs.jdkDistribution )
|| '{ "include": [{ "version": 20, "dist": "jdk.java.net" }, { "version": 21, "dist": "jdk.java.net" }] }'
)
}}
if: "github.repository == 'quarkusio/quarkus' || github.event_name == 'workflow_dispatch'"
timeout-minutes: 360
env:
MAVEN_OPTS: -Xmx2048m -XX:MaxMetaspaceSize=1000m
steps:
- name: Set up JDK from jdk.java.net
if: matrix.dist == 'jdk.java.net'
uses: oracle-actions/setup-java@v1
with:
website: jdk.java.net
release: ${{ matrix.version }}
- name: Set up JDK from other provider than jdk.java.net
if: matrix.dist != 'jdk.java.net'
uses: actions/setup-java@v4
with:
distribution: ${{ matrix.dist }}
java-version: ${{ matrix.version }}
- name: Print Java version
shell: bash
run: java -version
- name: Stop mysql
shell: bash
run: |
ss -ln
sudo service mysql stop || true
- uses: actions/checkout@v4
with:
ref: ${{ github.event_name == 'workflow_dispatch' && github.event.ref || 'main' }}
- name: Reclaim Disk Space
run: .github/ci-prerequisites.sh
- name: Get Date
id: get-date
run: |
echo "date=$(/bin/date -u "+%Y-%m")" >> $GITHUB_OUTPUT
shell: bash
- name: Cache Maven Repository
id: cache-maven
uses: actions/cache@v4
with:
path: ~/.m2/repository
# refresh cache every month to avoid unlimited growth
# also add JDK version to key to avoid poisioning of the CI cache
key: q2maven-${{ steps.get-date.outputs.date }}-${{ matrix.version }}
- name: Build with Maven
# -fae to try to gather as many failures as possible
# (but not maven.test.failure.ignore because test report generation is buggy)
run: |
./mvnw $JVM_TEST_MAVEN_OPTS -Dtcks install -fae
# Test reports disabled due to: https://github.com/ScaCap/action-surefire-report/issues/39
#- name: Publish Test Report
# if: always()
# uses: scacap/action-surefire-report@v1
# with:
# github_token: ${{ secrets.GITHUB_TOKEN }}
# # fail required to upload failure archive in subsequent actions
# fail_on_test_failures: true
#- name: Publish Gradle Test Report
# if: always()
# uses: scacap/action-surefire-report@v1
# with:
# github_token: ${{ secrets.GITHUB_TOKEN }}
# # fail required to upload failure archive in subsequent actions
# fail_on_test_failures: true
# check_name: 'Test Report for Gradle'
# report_paths: '**/build/test-results/test/TEST-*.xml'
- name: Prepare failure archive (if maven failed)
if: failure()
shell: bash
run: find . -name '*-reports' -type d -o -name '*.log' | tar -czf test-reports.tgz -T -
- name: Upload failure Archive (if maven failed)
uses: actions/upload-artifact@v3
if: failure()
with:
name: test-reports-linux-jvm${{ matrix.version }}
path: 'test-reports.tgz'
- name: Delete Local Artifacts From Cache
if: always()
shell: bash
run: rm -r ~/.m2/repository/io/quarkus
- name: Report status
if: "always() && github.repository == 'quarkusio/quarkus' && github.event_name != 'workflow_dispatch'"
shell: bash
run: |
curl -Ls https://sh.jbang.dev | bash -s - app setup
~/.jbang/bin/jbang .github/NativeBuildReport.java \
issueNumber=15867 \
runId=${{ github.run_id }} \
status=${{ job.status }} \
token=${{ secrets.GITHUB_API_TOKEN }} \
issueRepo=${{ github.repository }} \
thisRepo=${{ github.repository }}