-
Notifications
You must be signed in to change notification settings - Fork 1k
191 lines (188 loc) · 6.51 KB
/
ci.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
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
# This workflow will build a Java project with Maven
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-maven
name: Undertow CI
on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
workflow_dispatch:
jobs:
build-all:
name: Compile (no tests) with JDK 8
runs-on: ubuntu-latest
steps:
- uses: n1hility/cancel-previous-runs@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/cache@v1
with:
path: ~/.m2/repository
key: m2-${{ hashFiles('**/pom.xml') }}
restore-keys: |
m2-
- uses: actions/checkout@v2
- name: Set up JDK 8
uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 8
- name: Generate settings.xml for Maven Builds
uses: whelk-io/maven-settings-xml-action@v20
with:
repositories: '[{ "id": "jboss", "name": "JBoss", "url": "https://repository.jboss.org/nexus/content/groups/public" }]'
- name: Print Version
run: mvn -v
- name: Build
run: mvn -U -B -fae -DskipTests -Dfindbugs clean install
- name: Tar Maven Repo
shell: bash
run: tar -czf maven-repo.tgz -C ~ .m2/repository
- name: Persist Maven Repo
uses: actions/upload-artifact@v4
with:
name: maven-repo
path: maven-repo.tgz
- uses: actions/upload-artifact@v4
if: failure()
with:
name: surefire-reports-build
path: |
**/surefire*-reports/*.txt
**/*.dump*
test-matrix:
name: JDK ${{ matrix.jdk }} - ${{ matrix.module }} - ${{ matrix.os }}
runs-on: ${{ matrix.os }}
needs: build-all
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
module: [core, servlet, websockets-jsr]
jdk: [11, 17]
openjdk_impl: [ temurin ]
include:
- jdk: 8
os: ubuntu-latest
module: core
openjdk_impl: temurin
- jdk: 8
os: ubuntu-latest
module: servlet
openjdk_impl: temurin
- jdk: 8
os: ubuntu-latest
module: websockets-jsr
openjdk_impl: temurin
- jdk: 8
os: windows-latest
module: core
openjdk_impl: temurin
- jdk: 8
os: windows-latest
module: servlet
openjdk_impl: temurin
- jdk: 8
os: windows-latest
module: websockets-jsr
openjdk_impl: temurin
steps:
- name: Update hosts - linux
if: matrix.os == 'ubuntu-latest'
run: |
cat /etc/hosts
sudo bash -c "echo '127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4' > /etc/hosts"
sudo bash -c "echo '::1 localhost localhost.localdomain localhost6 localhost6.localdomain6' >> /etc/hosts"
sudo sysctl -w fs.file-max=2097152
- name: Update hosts - windows
if: matrix.os == 'windows-latest'
run: |
type %SystemRoot%\System32\drivers\etc\hosts
echo '127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4' > %SystemRoot%\System32\drivers\etc\hosts
echo '::1 localhost localhost.localdomain localhost6 localhost6.localdomain6' >> %SystemRoot%\System32\drivers\etc\hosts
shell: cmd
- uses: n1hility/cancel-previous-runs@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Host information
run: |
hostname || true
- uses: actions/checkout@v2
- name: Download Maven Repo
uses: actions/download-artifact@v4
with:
name: maven-repo
path: .
- name: Extract Maven Repo
shell: bash
run: tar -xzf maven-repo.tgz -C ~
- name: Set up JDK ${{ matrix.java }}
uses: actions/setup-java@v3
with:
distribution: ${{ matrix.openjdk_impl }}
java-version: ${{ matrix.jdk }}
- name: Generate settings.xml for Maven Builds
uses: whelk-io/maven-settings-xml-action@v20
with:
repositories: '[{ "id": "jboss", "name": "JBoss", "url": "https://repository.jboss.org/nexus/content/groups/public" }]'
- name: Print Version
run: mvn -v
- name: Run Tests
run: mvn -U -B -fae test -Pproxy '-DfailIfNoTests=false' -pl ${{ matrix.module }}
- uses: actions/upload-artifact@v4
if: failure()
with:
name: surefire-reports-${{ matrix.jdk }}-${{ matrix.module }}-${{ matrix.os }}
path: |
**/surefire*-reports/*.txt
**/*.dump*
test-matrix-ipv6:
name: JDK ${{ matrix.jdk }} - ipv6 - ${{ matrix.module }} ${{ matrix.proxy }} - ${{ matrix.os }}
runs-on: ${{ matrix.os }}
needs: build-all
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
module: [core, servlet, websockets-jsr]
proxy: ['-Pproxy', '']
jdk: [11]
steps:
- name: Update hosts - linux
if: matrix.os == 'ubuntu-latest'
run: |
sudo bash -c "echo '127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4' > /etc/hosts"
sudo bash -c "echo '::1 localhost localhost.localdomain localhost6 localhost6.localdomain6' >> /etc/hosts"
sudo sysctl -w fs.file-max=2097152
- uses: n1hility/cancel-previous-runs@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Host information
run: |
hostname || true
- uses: actions/checkout@v2
- name: Download Maven Repo
uses: actions/download-artifact@v4
with:
name: maven-repo
path: .
- name: Extract Maven Repo
shell: bash
run: tar -xzf maven-repo.tgz -C ~
- name: Set up JDK ${{ matrix.java }}
uses: joschi/setup-jdk@v2
with:
java-version: ${{ matrix.jdk }}
- name: Generate settings.xml for Maven Builds
uses: whelk-io/maven-settings-xml-action@v20
with:
repositories: '[{ "id": "jboss", "name": "JBoss", "url": "https://repository.jboss.org/nexus/content/groups/public" }]'
- name: Print Version
run: mvn -v
- name: Run Tests
run: mvn -U -B -fae test ${{ matrix.proxy }} '-DfailIfNoTests=false' -pl ${{ matrix.module }} -Dtest.ipv6=true
- uses: actions/upload-artifact@v4
if: failure()
with:
name: surefire-reports-${{ matrix.jdk }}-ipv6-${{ matrix.module }}${{ matrix.proxy }}-${{ matrix.os }}
path: |
**/surefire*-reports/*.txt
**/*.dump*