Skip to content

Commit 05fea10

Browse files
Updated ci
1 parent 5d19c1a commit 05fea10

File tree

1 file changed

+50
-27
lines changed

1 file changed

+50
-27
lines changed

.github/workflows/ci.yml

Lines changed: 50 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,67 @@
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+
18
name: Java CI with Gradle
29

310
on:
411
push:
5-
branches:
6-
- main
12+
branches: [ "main" ]
713
pull_request:
8-
branches:
9-
- main
14+
branches: [ "main" ]
1015

1116
jobs:
1217
build:
18+
1319
runs-on: ubuntu-latest
20+
permissions:
21+
contents: read
1422

1523
steps:
16-
- name: Checkout repository
17-
uses: actions/checkout@v2
18-
19-
- name: Set up JDK 11
20-
uses: actions/setup-java@v3
24+
- uses: actions/checkout@v4
25+
- name: Set up JDK 17
26+
uses: actions/setup-java@v4
2127
with:
22-
java-version: '11'
23-
distribution: 'adoptopenjdk' # Ensure you're using a distribution of your choice
28+
java-version: '17'
29+
distribution: 'temurin'
2430

25-
- name: Cache Gradle dependencies
26-
uses: actions/cache@v2
27-
with:
28-
path: ~/.gradle/caches
29-
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
30-
restore-keys: |
31-
${{ runner.os }}-gradle-
31+
# Configure Gradle for optimal use in GitHub Actions, including caching of downloaded dependencies.
32+
# See: https://github.com/gradle/actions/blob/main/setup-gradle/README.md
33+
- name: Setup Gradle
34+
uses: gradle/actions/setup-gradle@af1da67850ed9a4cedd57bfd976089dd991e2582 # v4.0.0
35+
36+
- name: Build with Gradle Wrapper
37+
run: ./gradlew build
3238

33-
- name: Build with Gradle
34-
run: ./gradlew build --no-daemon
39+
# NOTE: The Gradle Wrapper is the default and recommended way to run Gradle (https://docs.gradle.org/current/userguide/gradle_wrapper.html).
40+
# If your project does not have the Gradle Wrapper configured, you can use the following configuration to run Gradle with a specified version.
41+
#
42+
# - name: Setup Gradle
43+
# uses: gradle/actions/setup-gradle@af1da67850ed9a4cedd57bfd976089dd991e2582 # v4.0.0
44+
# with:
45+
# gradle-version: '8.9'
46+
#
47+
# - name: Build with Gradle 8.9
48+
# run: gradle build
3549

36-
- name: Run tests
37-
run: ./gradlew test --no-daemon
50+
dependency-submission:
3851

39-
- name: Upload test results
40-
if: always()
41-
uses: actions/upload-artifact@v2
52+
runs-on: ubuntu-latest
53+
permissions:
54+
contents: write
55+
56+
steps:
57+
- uses: actions/checkout@v4
58+
- name: Set up JDK 17
59+
uses: actions/setup-java@v4
4260
with:
43-
name: test-results
44-
path: build/test-results/test
61+
java-version: '17'
62+
distribution: 'temurin'
63+
64+
# Generates and submits a dependency graph, enabling Dependabot Alerts for all project dependencies.
65+
# See: https://github.com/gradle/actions/blob/main/dependency-submission/README.md
66+
- name: Generate and submit dependency graph
67+
uses: gradle/actions/dependency-submission@af1da67850ed9a4cedd57bfd976089dd991e2582 # v4.0.0

0 commit comments

Comments
 (0)