-
Notifications
You must be signed in to change notification settings - Fork 8.8k
92 lines (89 loc) · 3.08 KB
/
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
name: "build"
on:
push:
branches: [ 2.x, develop, master ]
pull_request:
branches: [ 2.x, develop, master ]
jobs:
# job 1: Test based on java 8 and 17. Do not checkstyle.
build:
name: "build"
services:
redis:
image: redis:7.2
ports:
- 6379:6379
options: --health-cmd="redis-cli ping" --health-interval=10s --health-timeout=5s --health-retries=3
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
java: [ 8, 17 ]
steps:
# step 1
- name: "Checkout"
uses: actions/checkout@v3
# step 2
- name: "Use Python 3.x"
uses: actions/setup-python@v2
with:
python-version: '3.12'
# step 3
- name: "Set up Java JDK"
uses: actions/setup-java@v3.12.0
with:
distribution: 'zulu'
java-version: ${{ matrix.java }}
# step 4
- name: "Print maven version"
run: ./mvnw -version
# step 5.1
- name: "Test, Check style, Check PMD, Check license with Maven and Java8"
if: matrix.java == '8'
run: |
./mvnw -T 4C clean test \
-Dcheckstyle.skip=false -Dpmd.skip=false -Dlicense.skip=false -DredisCaseEnabled=true \
-e -B -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn;
# step 5.2
- name: "Test with Maven and Java${{ matrix.java }}"
if: matrix.java != '8'
run: |
./mvnw -T 4C clean test \
-e -B -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn;
# step 6
- name: "Codecov"
if: matrix.java == '8'
uses: codecov/codecov-action@v4.0.1
with:
token: ${{ secrets.CODECOV_TOKEN }}
version: v0.6.0
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
# job 2: Build on 'arm64v8/ubuntu' OS (Skip tests).
build_arm64-binary:
runs-on: ubuntu-latest
if: ${{ github.event_name == 'push' && (github.ref_name == 'develop' || github.ref_name == 'snapshot' || github.ref_name == '2.x') }}
strategy:
fail-fast: false
steps:
# step 1
- name: "Checkout"
uses: actions/checkout@v3
# step 2
- name: "Set up QEMU"
id: qemu
uses: docker/setup-qemu-action@v3
# step 3
- name: "Build with Maven on 'arm64v8/ubuntu:20.04' OS (Skip tests)"
run: |
docker run --rm -v ${{ github.workspace }}:/ws:rw --workdir=/ws \
arm64v8/ubuntu:20.04 \
bash -exc 'apt-get update -y && \
apt-get install maven -y && \
apt-get install -y python3 python3-pip python3-distutils && \
apt-get install -y build-essential && \
mvn -version && \
mvn clean install \
-Prelease-seata \
-DskipTests \
-e -B -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn'