Skip to content

Commit d35937c

Browse files
enhance GH Actions (#12)
* enhance GH Actions * enhance GH Actions
1 parent a93ffd3 commit d35937c

File tree

3 files changed

+2
-75
lines changed

3 files changed

+2
-75
lines changed

.github/workflows/ci-actions.yml

Lines changed: 1 addition & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -12,61 +12,11 @@ on:
1212
- cron: '0 0 * * *'
1313

1414
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
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

@@ -77,14 +27,6 @@ jobs:
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 }}

.github/workflows/release-actions.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,7 @@ jobs:
1111
runs-on: ubuntu-latest
1212
steps:
1313
- uses: actions/checkout@v2
14-
- name: Set up JDK 11
15-
# Uses sha for added security since tags can be updated
16-
uses: joschi/setup-jdk@b9cc6eabf7e7e3889766b5cee486f874c9e1bd2d
14+
- uses: actions/setup-java@v1
1715
with:
1816
java-version: 11
1917
- name: Build

pom.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,6 @@
162162
<exclude>src/test/resources/**</exclude>
163163
<exclude>src/main/resources/**</exclude>
164164
<exclude>.github/**</exclude>
165-
<exclude>docusaurus/**</exclude>
166165
</excludes>
167166
</configuration>
168167
<executions>

0 commit comments

Comments
 (0)