forked from netty/netty
-
Notifications
You must be signed in to change notification settings - Fork 0
227 lines (195 loc) · 8.42 KB
/
ci-pr.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
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
# ----------------------------------------------------------------------------
# Copyright 2021 The Netty Project
#
# The Netty Project licenses this file to you under the Apache License,
# version 2.0 (the "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at:
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
# ----------------------------------------------------------------------------
name: Build PR
on:
pull_request:
branches: [ "4.1"]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
permissions:
contents: read
env:
MAVEN_OPTS: -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.http.retryhandler.count=5 -Dmaven.wagon.httpconnectionManager.ttlSeconds=240
jobs:
verify-pr:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up JDK 8
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: '8'
# Cache .m2/repository
- name: Cache local Maven repository
uses: actions/cache@v3
continue-on-error: true
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-verify-pr-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-verify-pr-
${{ runner.os }}-maven-
- name: Verify with Maven
run: ./mvnw -B -ntp --file pom.xml verify -DskipTests=true
- name: Checking bom dependency versions
run: ./.github/scripts/check_bom_dependencies.sh
- name: print JVM thread dumps when cancelled
uses: ./.github/actions/thread-dump-jvms
if: cancelled()
build-pr-windows:
runs-on: windows-2019
name: windows-x86_64-java11-boringssl
needs: verify-pr
steps:
- uses: actions/checkout@v4
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: '11'
# Cache .m2/repository
# Caching of maven dependencies
- uses: actions/cache@v3
continue-on-error: true
with:
path: ~/.m2/repository
key: pr-windows-x86_64-maven-cache-${{ hashFiles('**/pom.xml') }}
restore-keys: |
pr-windows-x86_64-maven-cache-
- name: Build project
run: ./mvnw.cmd -B -ntp --file pom.xml clean package -Pboringssl -DskipHttp2Testsuite=true -DskipAutobahnTestsuite=true
- name: print JVM thread dumps when cancelled
uses: ./.github/actions/thread-dump-jvms
if: cancelled()
- name: Upload Test Results
if: always()
uses: actions/upload-artifact@v3
with:
name: test-results-windows-x86_64-java11-boringssl
path: '**/target/surefire-reports/TEST-*.xml'
- uses: actions/upload-artifact@v3
if: ${{ failure() }}
with:
name: build-pr-windows-target
path: |
**/target/surefire-reports/
**/hs_err*.log
build-pr-aarch64:
name: linux-aarch64-verify-native
# The host should always be Linux
runs-on: ubuntu-20.04
permissions:
contents: read # for actions/checkout to fetch code
packages: write # for uraimo/run-on-arch-action to cache docker images
needs: verify-pr
steps:
- uses: actions/checkout@v4
# Cache .m2/repository
- name: Cache local Maven repository
uses: actions/cache@v3
continue-on-error: true
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-build-pr-aarch64-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-build-pr-aarch64-
${{ runner.os }}-maven-
- uses: uraimo/[email protected]
name: Run commands
id: runcmd
with:
arch: aarch64
distro: ubuntu20.04
# Not required, but speeds up builds by storing container images in
# a GitHub package registry.
githubToken: ${{ github.token }}
# Mount the .m2/repository
dockerRunArgs: |
--volume "/home/runner/.m2/repository/:/root/.m2/repository"
# Install dependencies
install: |
apt-get update -q -y
apt-get install -q -y openjdk-11-jdk autoconf automake libtool make tar maven git
# Compile native code and the modules it depend on and run NativeLoadingTest. This is enough to ensure
# we can load the native module on aarch64
#
# Use tcnative.classifier that is empty as we don't support using the shared lib version on ubuntu.
run: |
JAVA_HOME=/usr/lib/jvm/java-11-openjdk-arm64 ./mvnw -B -ntp -pl testsuite-native -am clean package -DskipTests=true -Dcheckstyle.skip=true -DskipNativeTestsuite=false -Dtcnative.classifier=
build-pr:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- setup: linux-x86_64-java8
docker-compose-build: "-f docker/docker-compose.yaml -f docker/docker-compose.centos-6.18.yaml build"
docker-compose-run: "-f docker/docker-compose.yaml -f docker/docker-compose.centos-6.18.yaml run build-leak"
- setup: linux-x86_64-java11
docker-compose-build: "-f docker/docker-compose.yaml -f docker/docker-compose.centos-6.111.yaml build"
docker-compose-run: "-f docker/docker-compose.yaml -f docker/docker-compose.centos-6.111.yaml run build-leak"
- setup: linux-x86_64-java11-graal
docker-compose-build: "-f docker/docker-compose.yaml -f docker/docker-compose.centos-6.graalvm111.yaml build"
docker-compose-run: "-f docker/docker-compose.yaml -f docker/docker-compose.centos-6.graalvm111.yaml run build-leak"
- setup: linux-x86_64-java17
docker-compose-build: "-f docker/docker-compose.yaml -f docker/docker-compose.centos-7.117.yaml build"
docker-compose-run: "-f docker/docker-compose.yaml -f docker/docker-compose.centos-7.117.yaml run build-leak"
- setup: linux-x86_64-java21
docker-compose-build: "-f docker/docker-compose.yaml -f docker/docker-compose.centos-6.21.yaml build"
docker-compose-run: "-f docker/docker-compose.yaml -f docker/docker-compose.centos-6.21.yaml run build-leak"
- setup: linux-x86_64-java11-boringssl
docker-compose-build: "-f docker/docker-compose.yaml -f docker/docker-compose.centos-6.111.yaml build"
docker-compose-run: "-f docker/docker-compose.yaml -f docker/docker-compose.centos-6.111.yaml run build-leak-boringssl-static"
name: ${{ matrix.setup }} build
needs: verify-pr
steps:
- uses: actions/checkout@v4
# Cache .m2/repository
- name: Cache local Maven repository
uses: actions/cache@v3
continue-on-error: true
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ matrix.setup }}-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-${{ matrix.setup }}-
${{ runner.os }}-maven-
- name: Build docker image
run: docker-compose ${{ matrix.docker-compose-build }}
- name: Build project with leak detection
run: docker-compose ${{ matrix.docker-compose-run }} | tee build-leak.output
- name: Checking for test failures
run: ./.github/scripts/check_build_result.sh build-leak.output
- name: Checking for detected leak
run: ./.github/scripts/check_leak.sh build-leak.output
- name: print JVM thread dumps when cancelled
uses: ./.github/actions/thread-dump-jvms
if: cancelled()
- name: Upload Test Results
if: always()
uses: actions/upload-artifact@v3
with:
name: test-results-${{ matrix.setup }}
path: '**/target/surefire-reports/TEST-*.xml'
- uses: actions/upload-artifact@v3
if: ${{ failure() }}
with:
name: build-${{ matrix.setup }}-target
path: |
**/target/surefire-reports/
**/target/autobahntestsuite-reports/
**/hs_err*.log
**/core.*