Skip to content

Commit

Permalink
Update GitHub Actions
Browse files Browse the repository at this point in the history
- Wrapper validation is done as part of setup-gradle, no need to do it
  ourselves, see https://github.com/gradle/actions/blob/main/docs/setup-gradle.md#gradle-wrapper-validation
- Enable storing configuration cache accross builds
- Submit dependencies from gradle to GitHub
- Cache build outputs as well to reduce build time
  • Loading branch information
mar-v-in committed Dec 20, 2024
1 parent d2fcb09 commit 720566a
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 2 deletions.
12 changes: 10 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ jobs:
with:
distribution: "temurin"
java-version: "17"
- name: "Gradle Wrapper validation"
uses: gradle/actions/wrapper-validation@v4
- name: "Setup Gradle"
uses: gradle/actions/setup-gradle@v4
with:
cache-encryption-key: ${{ secrets.GradleEncryptionKey }}
- name: "Setup matchers"
run: |
# Setting up matchers...
Expand All @@ -43,6 +43,14 @@ jobs:
echo "Matcher configured: ${NAME:?}"
fi
done
- name: "Cache Gradle build output"
uses: actions/cache@v4
with:
path: |
**/build
key: gradle-build-v1-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
gradle-build-v1-
- name: "Inspect Gradle tasks"
run: "./gradlew tasks"
- name: "Execute Gradle assemble"
Expand Down
25 changes: 25 additions & 0 deletions .github/workflows/dependency-submission.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Dependency Submission
permissions:
contents: write
on:
push:
branches: [ 'master' ]

jobs:
dependency-submission:
runs-on: ubuntu-latest
env:
GRADLE_MICROG_VERSION_WITHOUT_GIT: 1

steps:
- name: "Checkout sources"
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: "Setup Java"
uses: actions/setup-java@v4
with:
distribution: "temurin"
java-version: "17"
- name: "Generate and submit gradle dependency graph"
uses: gradle/actions/dependency-submission@v4

0 comments on commit 720566a

Please sign in to comment.