12
12
- cron : ' 0 0 * * *'
13
13
14
14
jobs :
15
- build-jdk11 :
16
- name : " JDK 11 Build"
17
- runs-on : ubuntu-latest
18
- # Skip draft PRs and those with WIP in the subject, rerun as soon as its removed
19
- if : " github.event_name != 'pull_request' || ( \
20
- github.event.pull_request.draft == false && \
21
- github.event.pull_request.state != 'closed' && \
22
- contains(github.event.pull_request.title, 'wip ') == false && \
23
- contains(github.event.pull_request.title, '[wip]') == false && \
24
- (
25
- github.event.action != 'edited' || \
26
- contains(github.event.changes.title.from, 'wip ') || \
27
- contains(github.event.changes.title.from, '[wip]') \
28
- ) \
29
- )"
30
- steps :
31
- - uses : actions/checkout@v2
32
- - uses : n1hility/cancel-previous-runs@v2
33
- if : github.event_name == 'pull_request'
34
- with :
35
- token : ${{ secrets.GITHUB_TOKEN }}
36
- - uses : actions/setup-java@v1
37
- with :
38
- java-version : 11
39
- - name : Compute cache restore key
40
- # Always recompute on a push so that the maven repo doesnt grow indefinitely with old versions
41
- run : |
42
- if ${{ github.event_name == 'pull_request' }}; then echo "::set-env name=COMPUTED_RESTORE_KEY::q2maven-"; fi
43
- - name : Cache Maven Repository
44
- id : cache-maven
45
- uses : n1hility/cache@v2
46
- with :
47
- path : ~/.m2/repository
48
- # Improves the reusability of the cache to limit key changes
49
- key : q2maven-${{ hashFiles('pom.xml') }}
50
- restore-keys : ${{ env.COMPUTED_RESTORE_KEY }}
51
- restore-only : ${{ github.event_name == 'pull_request' }}
52
- - name : Build
53
- run : |
54
- mvn -e -B -DskipTests=true -DskipDocs clean install
55
- - name : Tar Maven Repo
56
- shell : bash
57
- run : tar -czvf maven-repo.tgz -C ~ .m2/repository
58
- - name : Persist Maven Repo
59
- uses : actions/upload-artifact@v1
60
- with :
61
- name : maven-repo
62
- path : maven-repo.tgz
63
15
64
16
linux-jvm-tests :
65
17
name : JDK ${{matrix.java-version}} JVM Tests
66
18
timeout-minutes : 120
67
- needs : build-jdk11
68
19
strategy :
69
- fail-fast : false
70
20
matrix :
71
21
java-version : [8, 11, 13]
72
22
77
27
- uses : actions/setup-java@v1
78
28
with :
79
29
java-version : ${{ matrix.java-version }}
80
- - name : Download Maven Repo
81
- uses : actions/download-artifact@v1
82
- with :
83
- name : maven-repo
84
- path : .
85
- - name : Extract Maven Repo
86
- shell : bash
87
- run : tar -xzvf maven-repo.tgz -C ~
88
30
- name : Build with Maven
89
31
run : mvn install
90
32
- name : Prepare failure archive (if maven failed)
@@ -100,28 +42,16 @@ jobs:
100
42
101
43
code-scan :
102
44
name : JDK 8 JVM Code Scan
45
+ if : ${{ github.event_name != 'pull_request' && github.repository_owner == 'project-openubl' }}
103
46
timeout-minutes : 120
104
- needs : build-jdk11
105
47
runs-on : ubuntu-latest
106
48
107
49
steps :
108
50
- uses : actions/checkout@v2
109
51
- uses : actions/setup-java@v1
110
52
with :
111
53
java-version : 8
112
- - name : Download Maven Repo
113
- uses : actions/download-artifact@v1
114
- with :
115
- name : maven-repo
116
- path : .
117
- - name : Extract Maven Repo
118
- shell : bash
119
- run : tar -xzvf maven-repo.tgz -C ~
120
- - name : Build with Maven and Coverage
121
- if : github.event_name == 'pull_request'
122
- run : mvn verify -P coverage
123
54
- name : Build with Maven and Coverage/Sonar
124
- if : github.event_name != 'pull_request'
125
55
run : mvn verify -P coverage,sonar
126
56
env :
127
57
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
0 commit comments