Skip to content

Commit 4dad184

Browse files
authored
Use Java 17, upgrade Github actions (#15)
* Use Java 17, upgrade Github actions. * Add CodeQL checks to CI workflow.
1 parent 34e4989 commit 4dad184

File tree

3 files changed

+37
-40
lines changed

3 files changed

+37
-40
lines changed

.github/workflows/workflow.yml

Lines changed: 33 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ on:
1919
- master
2020

2121
env:
22-
JAVA_VERSION: '14.0.2'
22+
JAVA_VERSION: '17'
23+
JAVA_DISTRIBUTION: 'temurin'
2324
TEST_SCREEN_WIDTH: '1920'
2425
TEST_SCREEN_HEIGHT: '1080'
2526

@@ -29,19 +30,15 @@ jobs:
2930
name: Build and Test (Windows)
3031
steps:
3132
- name: Git checkout
32-
uses: actions/checkout@v2
33+
uses: actions/checkout@v3
3334
with:
3435
fetch-depth: 0
3536
- name: Set up JDK
36-
uses: actions/setup-java@v1
37+
uses: actions/setup-java@v3
3738
with:
3839
java-version: ${{ env.JAVA_VERSION }}
39-
- name: Cache Gradle packages
40-
uses: actions/cache@v2
41-
with:
42-
path: ~/.gradle/caches
43-
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
44-
restore-keys: ${{ runner.os }}-gradle
40+
distribution: ${{ env.JAVA_DISTRIBUTION }}
41+
cache: gradle
4542
- name: Verify Gradle wrapper
4643
uses: gradle/wrapper-validation-action@v1
4744
- name: Build
@@ -60,7 +57,7 @@ jobs:
6057
name: failed-test-screenshots-windows
6158
path: build/test-screenshots
6259
- name: Publish coverage report
63-
uses: codecov/codecov-action@v1
60+
uses: codecov/codecov-action@v3
6461
env:
6562
OS: Windows
6663
with:
@@ -69,12 +66,12 @@ jobs:
6966
- name: Jpackage
7067
run: ./gradlew --info --stacktrace jpackage
7168
- name: Upload installer (exe)
72-
uses: actions/upload-artifact@v2
69+
uses: actions/upload-artifact@v3
7370
with:
7471
name: boundingboxeditor-installer-windows-exe
7572
path: build/jpackage/*.exe
7673
- name: Upload image
77-
uses: actions/upload-artifact@v2
74+
uses: actions/upload-artifact@v3
7875
with:
7976
name: boundingboxeditor-portable-windows
8077
path: build/jpackage/BoundingBoxEditor
@@ -88,23 +85,25 @@ jobs:
8885
name: Build and Test (Linux)
8986
steps:
9087
- name: Git checkout
91-
uses: actions/checkout@v2
88+
uses: actions/checkout@v3
9289
with:
9390
fetch-depth: 0
9491
- name: Set up JDK
95-
uses: actions/setup-java@v1
92+
uses: actions/setup-java@v3
9693
with:
9794
java-version: ${{ env.JAVA_VERSION }}
98-
- name: Cache Gradle packages
99-
uses: actions/cache@v2
100-
with:
101-
path: ~/.gradle/caches
102-
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
103-
restore-keys: ${{ runner.os }}-gradle
95+
distribution: ${{ env.JAVA_DISTRIBUTION }}
96+
cache: gradle
10497
- name: Verify Gradle wrapper
10598
uses: gradle/wrapper-validation-action@v1
99+
- name: Initialize CodeQL
100+
uses: github/codeql-action/init@v2
101+
with:
102+
languages: java
106103
- name: Build
107104
run: ./gradlew --info --stacktrace build -x test
105+
- name: Perform CodeQL Analysis
106+
uses: github/codeql-action/analyze@v2
108107
- name: Test setup
109108
run: |
110109
sudo apt-get install xvfb fluxbox
@@ -120,7 +119,7 @@ jobs:
120119
name: failed-test-screenshots-linux
121120
path: build/test-screenshots
122121
- name: Publish coverage report
123-
uses: codecov/codecov-action@v1
122+
uses: codecov/codecov-action@v3
124123
env:
125124
OS: Linux
126125
with:
@@ -129,38 +128,35 @@ jobs:
129128
- name: Jpackage
130129
run: ./gradlew --info --stacktrace jpackage
131130
- name: Upload installer (deb)
132-
uses: actions/upload-artifact@v2
131+
uses: actions/upload-artifact@v3
133132
with:
134133
name: boundingboxeditor-installer-linux-deb
135134
path: build/jpackage/*.deb
136135
- name: Upload installer (rpm)
137-
uses: actions/upload-artifact@v2
136+
uses: actions/upload-artifact@v3
138137
with:
139138
name: boundingboxeditor-installer-linux-rpm
140139
path: build/jpackage/*.rpm
141140
- name: Upload image
142-
uses: actions/upload-artifact@v2
141+
uses: actions/upload-artifact@v3
143142
with:
144143
name: boundingboxeditor-portable-linux
145144
path: build/jpackage/BoundingBoxEditor
145+
146146
Build-and-Test-macOS:
147147
runs-on: macOS-10.15
148148
name: Build and Test (macOS)
149149
steps:
150150
- name: Git checkout
151-
uses: actions/checkout@v2
151+
uses: actions/checkout@v3
152152
with:
153153
fetch-depth: 0
154154
- name: Set up JDK
155-
uses: actions/setup-java@v1
155+
uses: actions/setup-java@v3
156156
with:
157157
java-version: ${{ env.JAVA_VERSION }}
158-
- name: Cache Gradle packages
159-
uses: actions/cache@v2
160-
with:
161-
path: ~/.gradle/caches
162-
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
163-
restore-keys: ${{ runner.os }}-gradle
158+
distribution: ${{ env.JAVA_DISTRIBUTION }}
159+
cache: gradle
164160
- name: Verify Gradle wrapper
165161
uses: gradle/wrapper-validation-action@v1
166162
- name: Build
@@ -172,7 +168,7 @@ jobs:
172168
id: test
173169
run: ./gradlew --info --stacktrace test
174170
- name: Publish coverage report
175-
uses: codecov/codecov-action@v1
171+
uses: codecov/codecov-action@v3
176172
env:
177173
OS: macOS
178174
with:
@@ -181,12 +177,12 @@ jobs:
181177
- name: Jpackage
182178
run: ./gradlew --info --stacktrace jpackage
183179
- name: Upload installer (dmg)
184-
uses: actions/upload-artifact@v2
180+
uses: actions/upload-artifact@v3
185181
with:
186182
name: boundingboxeditor-installer-macos-dmg
187183
path: build/jpackage/*.dmg
188184
- name: Upload image
189-
uses: actions/upload-artifact@v2
185+
uses: actions/upload-artifact@v3
190186
with:
191187
name: boundingboxeditor-portable-macos
192188
path: build/jpackage/BoundingBoxEditor.app
@@ -197,7 +193,7 @@ jobs:
197193
name: Github Release
198194
steps:
199195
- name: Git checkout
200-
uses: actions/checkout@v2
196+
uses: actions/checkout@v3
201197
with:
202198
fetch-depth: 0
203199
- name: Create changelog
@@ -219,7 +215,7 @@ jobs:
219215
body_text="${body_text//$'\r'/'%0D'}"
220216
echo "::set-output name=body::$body_text"
221217
- name: Download all build artifacts
222-
uses: actions/download-artifact@v2
218+
uses: actions/download-artifact@v3
223219
- name: Prepare artifacts
224220
run: |
225221
sudo apt-get install rename

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM adoptopenjdk:14-jdk-hotspot AS builder-base
1+
FROM eclipse-temurin:17-jdk AS builder-base
22
RUN apt-get update && \
33
apt-get install -y --no-install-recommends \
44
dos2unix \

build.gradle

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,6 @@ plugins {
3232
group 'com.github.mfl28'
3333
version '2.3.0'
3434

35-
sourceCompatibility = 1.11
36-
3735
repositories {
3836
mavenCentral()
3937
}
@@ -179,6 +177,9 @@ application {
179177

180178
java {
181179
modularity.inferModulePath = true
180+
toolchain {
181+
languageVersion.set(JavaLanguageVersion.of(17))
182+
}
182183
}
183184

184185
jlink {

0 commit comments

Comments
 (0)