Skip to content

Commit

Permalink
chore: update Java version to 21 and enhance caching in CI workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
thunderkex committed Jan 23, 2025
1 parent 4313e86 commit 1ac42fb
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
10 changes: 9 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,15 @@ jobs:
- uses: actions/[email protected]
with:
distribution: "temurin"
java-version: "23-ea"
java-version: "21"

- uses: actions/cache@v4
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: gradle-

- name: Checkout
uses: actions/[email protected]
Expand Down
10 changes: 8 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ on:
schedule:
- cron: "0 16 * * *"

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
check:
permissions: write-all
Expand Down Expand Up @@ -37,14 +41,16 @@ jobs:
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh run list -L400 --json databaseId -q '.[].databaseId' | tail -n+10 | xargs -IID gh api "repos/$GITHUB_REPOSITORY/actions/runs/ID" -X DELETE || :
gh run list --workflow "${{ github.workflow }}" -L400 --json databaseId -q '.[].databaseId' |
tail -n+10 |
xargs -I{} gh api "repos/${{ github.repository }}/actions/runs/{}" -X DELETE || true
outputs:
SHOULD_BUILD: ${{ steps.should_build.outputs.SHOULD_BUILD }}

build:
permissions: write-all
needs: check
if: needs.check.outputs.SHOULD_BUILD == '1'
uses: ./.github/workflows/build.yml
if: ${{ needs.check.outputs.SHOULD_BUILD == 1 }}
secrets: inherit

0 comments on commit 1ac42fb

Please sign in to comment.