-
Notifications
You must be signed in to change notification settings - Fork 1k
138 lines (134 loc) · 4.79 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
# 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:
# Only run the latest job
concurrency:
group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}'
cancel-in-progress: true
jobs:
build-all:
name: Compile (no tests) with JDK 11
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up JDK 11
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 11
- name: Build
run: mvn -V -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]
jdk: [11, 17, 21]
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
- name: Host information
run: |
hostname || true
- uses: actions/checkout@v4
- 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@v4
with:
distribution: ${{ matrix.openjdk_impl }}
java-version: ${{ matrix.jdk }}
- name: Run Tests
run: mvn -V -U -B -fae test -Pproxy '-DfailIfNoTests=false' -pl ${{ matrix.module }} '-P-java${{ matrix.jdk }}-test-classpath'
- 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
- name: Host information
run: |
hostname || true
- uses: actions/checkout@v4
- 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@v4
with:
java-version: ${{ matrix.jdk }}
- name: Run Tests
run: mvn -V -U -B -fae test ${{ matrix.proxy }} '-DfailIfNoTests=false' -pl ${{ matrix.module }} -Dtest.ipv6=true '-P-java${{ matrix.jdk }}-test-classpath'
- 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*