1
1
on : [push, pull_request, create]
2
2
jobs :
3
3
build :
4
- runs-on : ubuntu-latest
4
+ runs-on : ${{ matrix.os }}
5
+ strategy :
6
+ fail-fast : false
7
+ matrix :
8
+ # https://docs.github.com/en/actions/using-jobs/using-a-matrix-for-your-jobs
9
+ os : [ubuntu-latest] # , windows-latest, macos-latest]
10
+ jdk : [8]
5
11
steps :
6
12
- uses : actions/checkout@v4
7
- with :
8
- submodules : ' recursive'
9
- - name : Set up JDK
10
- uses : actions/setup-java@v3
13
+ - name : Set up JDK ${{ matrix.jdk }}
14
+ uses : actions/setup-java@v4
11
15
with :
12
16
distribution : ' zulu'
13
- java-version : 8
17
+ java-version : ${{ matrix.jdk }}
14
18
- name : Cache Gradle packages
15
- uses : actions/cache@v3
19
+ uses : actions/cache@v4
16
20
with :
17
21
path : ~/.gradle/caches
18
- key : ${{ runner .os }}-gradle-${{ hashFiles('**/*.gradle') }}
19
- restore-keys : ${{ runner .os }}-gradle
22
+ key : ${{ matrix .os }}-gradle-${{ hashFiles('**/*.gradle.kts ') }}
23
+ restore-keys : ${{ matrix .os }}-gradle
20
24
- name : Grant execute permission for gradlew
21
25
run : chmod +x gradlew
22
26
- name : Execute tests
23
27
run : ./gradlew check || (exitcode=$?; find build/tests -name '*.log' -type f | while read f; do echo -e "\033[4m$f\033[0m"; cat $f; done && return $exitcode)
24
28
- name : Build deployment artifacts
25
29
run : ./gradlew deploy
26
30
- name : Upload jars as artifact
27
- uses : actions/upload-artifact@v3
31
+ uses : actions/upload-artifact@v4
28
32
with :
29
33
name : software-challenge-backend-${{ github.sha }}
30
34
path : |
@@ -35,12 +39,12 @@ jobs:
35
39
runs-on : ubuntu-latest
36
40
if : startsWith(github.ref, 'refs/tags/')
37
41
steps :
38
- - uses : actions/download-artifact@v3
42
+ - uses : actions/download-artifact@v4 # https://github.com/actions/download-artifact
39
43
with :
40
44
name : software-challenge-backend-${{ github.sha }}
41
45
path : artifacts
42
46
- name : Release ${{ github.ref }}
43
- uses : softprops/action-gh-release@v1
47
+ uses : softprops/action-gh-release@v1 # https://github.com/softprops/action-gh-release
44
48
with :
45
49
files : artifacts/*
46
50
env :
0 commit comments