1919 - ' .idea/**'
2020 - ' assets/**'
2121
22- env :
23- DEMO_MAVEN_MODULE : ${{ github.event.repository.name }}-demo
24-
2522jobs :
2623 build :
2724 runs-on : ubuntu-latest
@@ -33,19 +30,31 @@ jobs:
3330 steps :
3431 - uses : actions/checkout@v7
3532
36- - name : Set up JDK
37- uses : actions/setup-java@v5
38- with :
39- distribution : ${{ matrix.distribution }}
40- java-version : ${{ matrix.java }}
41-
42- - name : Cache Maven
43- uses : actions/cache@v6
44- with :
45- path : ~/.m2/repository
46- key : ${{ runner.os }}-mvn-build-${{ hashFiles('**/pom.xml') }}
47- restore-keys : |
48- ${{ runner.os }}-mvn-build-
33+ - parallel :
34+ - name : Set up JDK
35+ uses : actions/setup-java@v6
36+ with :
37+ distribution : ${{ matrix.distribution }}
38+ java-version : ${{ matrix.java }}
39+
40+ - name : Cache Maven
41+ uses : actions/cache@v6
42+ with :
43+ path : ~/.m2/repository
44+ key : ${{ runner.os }}-mvn-build-${{ hashFiles('**/pom.xml') }}
45+ restore-keys : |
46+ ${{ runner.os }}-mvn-build-
47+
48+ - name : Docker Image Cache Restore
49+ id : docker-image-cache-restore
50+ uses : xdev-software/tci/.github/actions/docker-image-cache/restore@f75904872b55915e2a2f0080779a36e27c467d21 # v4.5.3
51+ with :
52+ # This cache could always change however because docker images can be changed remotely if the version is not fixated
53+ # As a compromise it utilizes the hash of the pom files because when the dependencies stay the same
54+ # the images should also be roughly the same
55+ key : ${{ runner.os }}-build-docker-images-${{ hashFiles('**/pom.xml') }}
56+ restore-keys : |
57+ ${{ runner.os }}-build-docker-images-
4958
5059 - name : Build with Maven
5160 run : ./mvnw -B clean package -P run-integration-tests
@@ -68,20 +77,13 @@ jobs:
6877 exit 1
6978 fi
7079
71- - name : Upload demo files
72- uses : actions/upload-artifact@v7
73- with :
74- name : demo-files-java-${{ matrix.java }}
75- path : ${{ env.DEMO_MAVEN_MODULE }}/target/${{ env.DEMO_MAVEN_MODULE }}.jar
76- if-no-files-found : error
77-
78- - name : Upload screenshots of test failures
79- if : failure()
80- uses : actions/upload-artifact@v7
80+ - name : Docker Image Cache Save
81+ uses : xdev-software/tci/.github/actions/docker-image-cache/save@f75904872b55915e2a2f0080779a36e27c467d21 # v4.5.3
82+ # Only save cache for one instance, otherwise they try to overwrite each other
83+ if : ${{ matrix.java == 25 }}
8184 with :
82- name : test-fail-screenshots-${{ matrix.java }}
83- path : ${{ env.PRIMARY_MAVEN_MODULE }}/target/screenshots
84- if-no-files-found : ignore
85+ key : ${{ steps.docker-image-cache-restore.outputs.key }}
86+ cache-hit : ${{ steps.docker-image-cache-restore.outputs.cache-hit }}
8587
8688 checkstyle :
8789 runs-on : ubuntu-latest
@@ -94,27 +96,28 @@ jobs:
9496 steps :
9597 - uses : actions/checkout@v7
9698
97- - name : Set up JDK
98- uses : actions/setup-java@v5
99- with :
100- distribution : ${{ matrix.distribution }}
101- java-version : ${{ matrix.java }}
102-
103- - name : Cache Maven
104- uses : actions/cache@v6
105- with :
106- path : ~/.m2/repository
107- key : ${{ runner.os }}-mvn-checkstyle-${{ hashFiles('**/pom.xml') }}
108- restore-keys : |
109- ${{ runner.os }}-mvn-checkstyle-
110-
111- - name : CheckStyle Cache
112- uses : actions/cache@v6
113- with :
114- path : ' **/target/checkstyle-cachefile'
115- key : ${{ runner.os }}-checkstyle-${{ hashFiles('**/pom.xml') }}
116- restore-keys : |
117- ${{ runner.os }}-checkstyle-
99+ - parallel :
100+ - name : Set up JDK
101+ uses : actions/setup-java@v6
102+ with :
103+ distribution : ${{ matrix.distribution }}
104+ java-version : ${{ matrix.java }}
105+
106+ - name : Cache Maven
107+ uses : actions/cache@v6
108+ with :
109+ path : ~/.m2/repository
110+ key : ${{ runner.os }}-mvn-checkstyle-${{ hashFiles('**/pom.xml') }}
111+ restore-keys : |
112+ ${{ runner.os }}-mvn-checkstyle-
113+
114+ - name : CheckStyle Cache
115+ uses : actions/cache@v6
116+ with :
117+ path : ' **/target/checkstyle-cachefile'
118+ key : ${{ runner.os }}-checkstyle-${{ hashFiles('**/pom.xml') }}
119+ restore-keys : |
120+ ${{ runner.os }}-checkstyle-
118121
119122 - name : Run Checkstyle
120123 run : ./mvnw -B checkstyle:check -P checkstyle -T2C
@@ -130,33 +133,34 @@ jobs:
130133 steps :
131134 - uses : actions/checkout@v7
132135
133- - name : Set up JDK
134- uses : actions/setup-java@v5
135- with :
136- distribution : ${{ matrix.distribution }}
137- java-version : ${{ matrix.java }}
138-
139- - name : Cache Maven
140- uses : actions/cache@v6
141- with :
142- path : ~/.m2/repository
143- key : ${{ runner.os }}-mvn-pmd-${{ hashFiles('**/pom.xml') }}
144- restore-keys : |
145- ${{ runner.os }}-mvn-pmd-
146-
147- - name : PMD Cache
148- uses : actions/cache@v6
149- with :
150- path : ' **/target/pmd/pmd.cache'
151- key : ${{ runner.os }}-pmd-${{ hashFiles('**/pom.xml') }}
152- restore-keys : |
153- ${{ runner.os }}-pmd-
136+ - parallel :
137+ - name : Set up JDK
138+ uses : actions/setup-java@v6
139+ with :
140+ distribution : ${{ matrix.distribution }}
141+ java-version : ${{ matrix.java }}
142+
143+ - name : Cache Maven
144+ uses : actions/cache@v6
145+ with :
146+ path : ~/.m2/repository
147+ key : ${{ runner.os }}-mvn-pmd-${{ hashFiles('**/pom.xml') }}
148+ restore-keys : |
149+ ${{ runner.os }}-mvn-pmd-
150+
151+ - name : PMD Cache
152+ uses : actions/cache@v6
153+ with :
154+ path : ' **/target/pmd/pmd.cache'
155+ key : ${{ runner.os }}-pmd-${{ hashFiles('**/pom.xml') }}
156+ restore-keys : |
157+ ${{ runner.os }}-pmd-
154158
155159 - name : Run PMD
156- run : ./mvnw -B test pmd:aggregate-pmd-no-fork pmd:check -P pmd -DskipTests - T2C
160+ run : ./mvnw -B test pmd:aggregate-pmd-no-fork pmd:check -P pmd -T2C
157161
158162 - name : Run CPD (Copy Paste Detector)
159- run : ./mvnw -B pmd:aggregate-cpd pmd:cpd-check -P pmd -DskipTests - T2C
163+ run : ./mvnw -B pmd:aggregate-cpd pmd:cpd-check -P pmd -T2C
160164
161165 - name : Upload report
162166 if : ${{ !cancelled() }}
0 commit comments