Skip to content

Commit d0fedf9

Browse files
authored
Improve CI checks (#12)
1 parent b6f1c42 commit d0fedf9

File tree

1 file changed

+14
-12
lines changed

1 file changed

+14
-12
lines changed

.github/workflows/java_build.yaml

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,33 +8,35 @@ on:
88
- opened
99
- synchronize
1010
- reopened
11+
schedule:
12+
- cron: '20 5 * * 1'
13+
workflow_dispatch:
14+
1115
jobs:
1216
build:
1317
runs-on: ubuntu-latest
18+
19+
strategy:
20+
matrix:
21+
java-version: [ 8, 11, 17, 20 ]
22+
fail-fast: false
23+
1424
steps:
1525
- name: Checkout project
16-
uses: actions/checkout@v2
26+
uses: actions/checkout@v3
1727
with:
1828
fetch-depth: 0
1929
- name: Set up JDK
2030
uses: actions/setup-java@v1
2131
with:
22-
java-version: 8
32+
java-version: ${{ matrix.java-version }}
2333
- name: Cache Maven packages
2434
uses: actions/cache@v1
2535
with:
2636
path: ~/.m2
27-
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
37+
key: ${{ runner.os }}-m2-java${{ matrix.java-version }}-${{ hashFiles('**/pom.xml') }}
2838
restore-keys: ${{ runner.os }}-m2
29-
- name: Build with Maven on Java 8
30-
run: mvn -B clean package --file pom.xml
31-
env:
32-
BETTER_STACK_SOURCE_TOKEN: ${{ secrets.BETTER_STACK_SOURCE_TOKEN }}
33-
- name: Set up JDK
34-
uses: actions/setup-java@v1
35-
with:
36-
java-version: 11
37-
- name: Build with Maven on Java 8
39+
- name: Build with Maven
3840
run: mvn -B clean package --file pom.xml
3941
env:
4042
BETTER_STACK_SOURCE_TOKEN: ${{ secrets.BETTER_STACK_SOURCE_TOKEN }}

0 commit comments

Comments
 (0)