forked from apache/incubator-seata
-
Notifications
You must be signed in to change notification settings - Fork 1
53 lines (47 loc) · 1.98 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
name: "build"
on:
push:
branches: [ develop, master ]
pull_request:
branches: [ develop, master ]
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
java: [ 8, 11 ]
os: [ ubuntu-18.04 ]
steps:
# step 1
- name: "Checkout"
uses: actions/checkout@v2.3.4
# step 2
- name: "Set up Java JDK"
uses: actions/setup-java@v2.1.0
with:
distribution: 'zulu'
java-version: ${{ matrix.java }}
# step 3
- name: "Set up ENV"
# https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-commands-for-github-actions#setting-an-environment-variable
run: if [ "${{ matrix.java }}" == "8" ]; then
echo "IMAGE_NAME=openjdk:8u212-jre-alpine" >> $GITHUB_ENV;
elif [ "${{ matrix.java }}" == "11" ]; then
echo "IMAGE_NAME=openjdk:11-jre-stretch" >> $GITHUB_ENV;
fi
# step 4
- name: "Build with Maven"
env:
REGISTRY_USERNAME: ${{ secrets.REGISTRY_USERNAME }}
REGISTRY_PASSWORD: ${{ secrets.REGISTRY_PASSWORD }}
# https://docs.github.com/cn/free-pro-team@latest/actions/reference/context-and-expression-syntax-for-github-actions#github-context
run: if [ "${{matrix.java}}" == "8" ] && [ "${{github.event_name}}" == "push" ] && [ "${{github.ref}}" == "refs/heads/develop" ]; then
./mvnw -T 4C clean test -e -Pimage -DskipTests=false -Dcheckstyle.skip=false -Dlicense.skip=false -B -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn;
else
./mvnw -T 4C clean test -e -DskipTests=false -Dcheckstyle.skip=false -Dlicense.skip=false -B -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn;
fi
# step 5
- name: "Codecov"
if: matrix.java == '8'
uses: codecov/codecov-action@v1.5.0