Skip to content

Commit f0b98c8

Browse files
committed
ci: add Java build workflow
Add a new workflow to build Java projects using Gradle.
1 parent 36aa0c9 commit f0b98c8

File tree

1 file changed

+50
-0
lines changed

1 file changed

+50
-0
lines changed

.github/workflows/java-app.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time
2+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-gradle
3+
4+
name: Java CI with Gradle
5+
6+
on:
7+
push:
8+
branches: [ "main" ]
9+
pull_request:
10+
branches: [ "main" ]
11+
12+
jobs:
13+
build:
14+
runs-on: ubuntu-latest
15+
permissions:
16+
contents: read
17+
18+
steps:
19+
- uses: actions/checkout@v4
20+
21+
- name: Set up JDK 17
22+
uses: actions/setup-java@v4
23+
with:
24+
java-version: '17'
25+
distribution: 'temurin'
26+
27+
# Configure Gradle for optimal use in GitHub Actions, including caching of downloaded dependencies.
28+
# See: https://github.com/gradle/actions/blob/main/setup-gradle/README.md
29+
- name: Setup Gradle
30+
uses: gradle/actions/setup-gradle@af1da67850ed9a4cedd57bfd976089dd991e2582 # v4.0.0
31+
32+
# This job is responsible for generating and submitting a dependency graph for the project.
33+
# Generates and submits a dependency graph, enabling Dependabot Alerts for all project dependencies.
34+
# See: https://github.com/gradle/actions/blob/main/dependency-submission/README.md
35+
dependency-submission:
36+
runs-on: ubuntu-latest
37+
permissions:
38+
contents: write
39+
40+
steps:
41+
- uses: actions/checkout@v4
42+
43+
- name: Set up JDK 17
44+
uses: actions/setup-java@v4
45+
with:
46+
java-version: '17'
47+
distribution: 'temurin'
48+
49+
- name: Generate and submit dependency graph
50+
uses: gradle/actions/dependency-submission@af1da67850ed9a4cedd57bfd976089dd991e2582 # v4.0.0

0 commit comments

Comments
 (0)