1313 pull_request :
1414 branches : [ "master" ]
1515
16+ # Concurrency control to cancel any in-progress runs on the same branch/PR.
17+ # This saves CI resources and prevents confusion from multiple running workflows.
18+ concurrency :
19+ group : ${{ github.workflow }}-${{ github.ref }}
20+ cancel-in-progress : true
21+
1622jobs :
1723 build :
18-
1924 runs-on : ubuntu-latest
2025 permissions :
2126 contents : read
2227
2328 steps :
24- - uses : actions/checkout@v4
25- - name : Set up JDK 21 with Amazon Corretto
26- uses : actions/setup-java@v4
27- with :
28- java-version : ' 21'
29- distribution : ' corretto'
29+ - uses : actions/checkout@v4
3030
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
31+ - name : Set up JDK 21 with Amazon Corretto
32+ uses : actions/setup-java@v4
33+ with :
34+ java-version : ' 21'
35+ distribution : ' corretto'
3536
36- - name : Build with Gradle Wrapper
37- run : ./gradlew build
37+ # Configure Gradle for optimal use in GitHub Actions, including caching of downloaded dependencies.
38+ # See: https://github.com/gradle/actions/blob/main/setup-gradle/README.md
39+ - name : Setup Gradle
40+ uses : gradle/actions/setup-gradle@af1da67850ed9a4cedd57bfd976089dd991e2582 # v4.0.0
3841
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
42+ # Best practice: Add execute permissions to the Gradle Wrapper to prevent permission errors.
43+ - name : Make gradlew executable
44+ run : chmod +x ./gradlew
4945
50- dependency-submission :
46+ - name : Build with Gradle Wrapper
47+ run : ./gradlew build
5148
49+ dependency-submission :
50+ # This job will only run after the 'build' job has completed successfully.
51+ needs : build
5252 runs-on : ubuntu-latest
5353 permissions :
5454 contents : write
5555
5656 steps :
57- - uses : actions/checkout@v4
58- - name : Set up JDK 21 with Amazon Corretto
59- uses : actions/setup-java@v4
60- with :
61- java-version : ' 21'
62- distribution : ' corretto'
57+ - uses : actions/checkout@v4
58+
59+ - name : Set up JDK 21 with Amazon Corretto
60+ uses : actions/setup-java@v4
61+ with :
62+ java-version : ' 21'
63+ distribution : ' corretto'
6364
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
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