Skip to content

Commit

Permalink
Optimize GitHub build action (#7)
Browse files Browse the repository at this point in the history
- Run  `setup-java` action before `checkout` action (should improve caching as the output of setup java changes less often than checkout repo)
- Set `gradle-home-cache-cleanup: true` to avoid gradle dir to grow indefinietely
- Use `ubuntu-latest`
- Use oracle jdk
  • Loading branch information
julioromano authored Mar 10, 2023
1 parent df65528 commit d3534ba
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@ on:

jobs:
check:
runs-on: ubuntu-22.04
runs-on: ubuntu-latest
timeout-minutes: 120
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Setup Java
uses: actions/setup-java@v3
with:
distribution: 'zulu'
distribution: 'oracle'
java-version: '17'
- name: Checkout repository
uses: actions/checkout@v3
- name: Validate Gradle Wrapper
uses: gradle/wrapper-validation-action@v1
- name: Setup Gradle and execute check task
Expand All @@ -27,5 +27,6 @@ jobs:
with:
# Only write to the cache for builds on the 'main' branch.
# Builds on other branches will only read existing entries from the cache.
gradle-home-cache-cleanup: true
cache-read-only: ${{ github.ref != 'refs/heads/main' }}
arguments: check --scan

0 comments on commit d3534ba

Please sign in to comment.