1212 - cron : ' 0 0 * * *'
1313
1414jobs :
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
6315
6416 linux-jvm-tests :
6517 name : JDK ${{matrix.java-version}} JVM Tests
6618 timeout-minutes : 120
67- needs : build-jdk11
6819 strategy :
69- fail-fast : false
7020 matrix :
7121 java-version : [8, 11, 13]
7222
7727 - uses : actions/setup-java@v1
7828 with :
7929 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 ~
8830 - name : Build with Maven
8931 run : mvn install
9032 - name : Prepare failure archive (if maven failed)
@@ -100,28 +42,16 @@ jobs:
10042
10143 code-scan :
10244 name : JDK 8 JVM Code Scan
45+ if : ${{ github.event_name != 'pull_request' && github.repository_owner == 'project-openubl' }}
10346 timeout-minutes : 120
104- needs : build-jdk11
10547 runs-on : ubuntu-latest
10648
10749 steps :
10850 - uses : actions/checkout@v2
10951 - uses : actions/setup-java@v1
11052 with :
11153 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
12354 - name : Build with Maven and Coverage/Sonar
124- if : github.event_name != 'pull_request'
12555 run : mvn verify -P coverage,sonar
12656 env :
12757 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
0 commit comments