Skip to content

Commit 7b85b7a

Browse files
authored
Update Gradle workflow to use JDK 21 and Ubuntu 22.04
1 parent d0b5621 commit 7b85b7a

1 file changed

Lines changed: 68 additions & 0 deletions

File tree

.github/workflows/gradle.yml

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
# This workflow uses actions that are not certified by GitHub.
2+
# They are provided by a third-party and are governed by
3+
# separate terms of service, privacy policy, and support
4+
# documentation.
5+
# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time
6+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-gradle
7+
8+
name: Java CI with Gradle
9+
10+
on:
11+
push:
12+
branches: [ "main" ]
13+
pull_request:
14+
branches: [ "main" ]
15+
workflow_dispatch:
16+
17+
jobs:
18+
build:
19+
20+
runs-on: ubuntu-22.04
21+
permissions:
22+
contents: read
23+
24+
steps:
25+
- uses: actions/checkout@v4
26+
- name: Set up JDK
27+
uses: actions/setup-java@v4
28+
with:
29+
java-version: '21'
30+
distribution: 'temurin'
31+
32+
# Configure Gradle for optimal use in GitHub Actions, including caching of downloaded dependencies.
33+
# See: https://github.com/gradle/actions/blob/main/setup-gradle/README.md
34+
- name: Setup Gradle
35+
uses: gradle/actions/setup-gradle@af1da67850ed9a4cedd57bfd976089dd991e2582 # v4.0.0
36+
37+
- name: Build with Gradle Wrapper
38+
run: ./gradlew build
39+
40+
# NOTE: The Gradle Wrapper is the default and recommended way to run Gradle (https://docs.gradle.org/current/userguide/gradle_wrapper.html).
41+
# If your project does not have the Gradle Wrapper configured, you can use the following configuration to run Gradle with a specified version.
42+
#
43+
# - name: Setup Gradle
44+
# uses: gradle/actions/setup-gradle@af1da67850ed9a4cedd57bfd976089dd991e2582 # v4.0.0
45+
# with:
46+
# gradle-version: '9.4.1'
47+
#
48+
# - name: Build with Gradle
49+
# run: gradle build
50+
51+
dependency-submission:
52+
53+
runs-on: ubuntu-latest
54+
permissions:
55+
contents: write
56+
57+
steps:
58+
- uses: actions/checkout@v4
59+
- name: Set up JDK
60+
uses: actions/setup-java@v4
61+
with:
62+
java-version: '21'
63+
distribution: 'temurin'
64+
65+
# Generates and submits a dependency graph, enabling Dependabot Alerts for all project dependencies.
66+
# See: https://github.com/gradle/actions/blob/main/dependency-submission/README.md
67+
- name: Generate and submit dependency graph
68+
uses: gradle/actions/dependency-submission@af1da67850ed9a4cedd57bfd976089dd991e2582 # v4.0.0

0 commit comments

Comments
 (0)