Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add options to the PR workflow to disable or invalidate the cache #744

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,15 @@ name: Build pull request
on:
pull_request:
workflow_dispatch:
inputs:
disable-cache:
description: Do not read from or write to the Gradle cache for this run.
type: boolean
default: false
invalidate-cache:
description: Do not read from the Gradle cache for this run, but still write to it. Should only be used on main.
type: boolean
default: false
# trigger on pushes to the default branch (main) to keep the cache up to date
push:
branches: main
Expand All @@ -25,6 +34,9 @@ jobs:
distribution: temurin
java-version: ${{ env.JAVA_VERSION }}
- uses: gradle/actions/setup-gradle@v3
with:
cache-disabled: ${{ inputs.disable-cache }}
cache-write-only: ${{ inputs.invalidate-cache }}

- name: Build
run: |
Expand Down
Loading