4
4
branches :
5
5
- master
6
6
- " 3.0"
7
+ - " 2.14"
7
8
- " 2.13"
8
9
paths-ignore :
9
10
- " README.md"
10
11
- " release-notes/*"
11
12
pull_request :
12
13
branches :
13
14
- master
15
+ - " 3.0"
16
+ - " 2.14"
17
+ - " 2.13"
14
18
paths-ignore :
15
19
- " README.md"
16
20
- " release-notes/*"
@@ -25,27 +29,38 @@ jobs:
25
29
env :
26
30
JAVA_OPTS : " -XX:+TieredCompilation -XX:TieredStopAtLevel=1"
27
31
steps :
28
- - uses : actions/checkout@v2
32
+ - uses : actions/checkout@v3
29
33
- name : Set up JDK
30
- uses : actions/setup-java@v2
34
+ uses : actions/setup-java@v3
31
35
with :
32
- distribution : " adopt "
36
+ distribution : ' temurin '
33
37
java-version : ${{ matrix.java_version }}
38
+ cache : ' maven'
34
39
server-id : sonatype-nexus-snapshots
35
40
server-username : CI_DEPLOY_USERNAME
36
41
server-password : CI_DEPLOY_PASSWORD
37
- - uses : actions/cache@v2.1.6
38
- with :
39
- path : ~/.m2/repository
40
- key : ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
41
- restore-keys : |
42
- ${{ runner.os }}-maven-
42
+ # See https://github.com/actions/setup-java/blob/v2/docs/advanced-usage.md#Publishing-using-Apache-Maven
43
+ # gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} # Value of the GPG private key to import
44
+ # gpg-passphrase: MAVEN_GPG_PASSPHRASE # env variable for GPG private key passphrase
43
45
- name : Build
44
- run : ./mvnw -V -B -ff -ntp verify
46
+ run : ./mvnw -B -q -ff -ntp verify
47
+ - name : Extract project Maven version
48
+ id : projectVersion
49
+ run : echo ::set-output name=version::$(./mvnw org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate -DforceStdout -Dexpression=project.version -q)
45
50
- name : Deploy snapshot
46
- if : github.event_name != 'pull_request' && matrix.java_version == '8'
51
+ if : github.event_name != 'pull_request' && matrix.java_version == '8' && endsWith(steps.projectVersion.outputs.version, '-SNAPSHOT')
47
52
env :
48
53
CI_DEPLOY_USERNAME : ${{ secrets.CI_DEPLOY_USERNAME }}
49
54
CI_DEPLOY_PASSWORD : ${{ secrets.CI_DEPLOY_PASSWORD }}
50
55
# MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
51
- run : ./mvnw -V -B -ff -DskipTests -ntp source:jar deploy
56
+ run : ./mvnw -B -q -ff -DskipTests -ntp source:jar deploy
57
+ - name : Generate code coverage
58
+ if : github.event_name != 'pull_request' && matrix.java_version == '8'
59
+ run : ./mvnw -B -q -ff -ntp test
60
+ - name : Publish code coverage
61
+ if : github.event_name != 'pull_request' && matrix.java_version == '8'
62
+ uses : codecov/codecov-action@v1
63
+ with :
64
+ token : ${{ secrets.CODECOV_TOKEN }}
65
+ file : ./target/site/jacoco/jacoco.xml
66
+ flags : unittests
0 commit comments