diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 880f5cb..5133918 100755 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -17,7 +17,15 @@ jobs: - uses: actions/setup-java@v4.6.0 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/checkout@v4.2.2 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 78d4045..5967de2 100755 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -4,6 +4,10 @@ on: schedule: - cron: "0 16 * * *" +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + jobs: check: permissions: write-all @@ -37,7 +41,9 @@ 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 }} @@ -45,6 +51,6 @@ jobs: 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