13
13
pull_request :
14
14
branches : [ "master" ]
15
15
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
+
16
22
jobs :
17
23
build :
18
-
19
24
runs-on : ubuntu-latest
20
25
permissions :
21
26
contents : read
22
27
23
28
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
30
30
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'
35
36
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
38
41
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
49
45
50
- dependency-submission :
46
+ - name : Build with Gradle Wrapper
47
+ run : ./gradlew build
51
48
49
+ dependency-submission :
50
+ # This job will only run after the 'build' job has completed successfully.
51
+ needs : build
52
52
runs-on : ubuntu-latest
53
53
permissions :
54
54
contents : write
55
55
56
56
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'
63
64
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