@@ -24,32 +24,43 @@ jobs:
24
24
strategy :
25
25
fail-fast : false
26
26
matrix :
27
- java_version : ['8', '11', '14 ']
27
+ java_version : ['8', '11', '17 ']
28
28
os : ['ubuntu-20.04']
29
29
env :
30
30
JAVA_OPTS : " -XX:+TieredCompilation -XX:TieredStopAtLevel=1"
31
31
steps :
32
- - uses : actions/checkout@v2
32
+ - uses : actions/checkout@v3
33
33
- name : Set up JDK
34
- uses : actions/setup-java@v2
34
+ uses : actions/setup-java@v3
35
35
with :
36
- distribution : " adopt "
36
+ distribution : ' temurin '
37
37
java-version : ${{ matrix.java_version }}
38
+ cache : ' maven'
38
39
server-id : sonatype-nexus-snapshots
39
40
server-username : CI_DEPLOY_USERNAME
40
41
server-password : CI_DEPLOY_PASSWORD
41
- - uses : actions/cache@v2.1.6
42
- with :
43
- path : ~/.m2/repository
44
- key : ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
45
- restore-keys : |
46
- ${{ 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
47
45
- name : Build
48
- 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)
49
50
- name : Deploy snapshot
50
- 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')
51
52
env :
52
53
CI_DEPLOY_USERNAME : ${{ secrets.CI_DEPLOY_USERNAME }}
53
54
CI_DEPLOY_PASSWORD : ${{ secrets.CI_DEPLOY_PASSWORD }}
54
55
# MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
55
- 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