name: Setup gradle description: "Set up your GitHub Actions workflow with a specific version of gradle" inputs: cache-read-only: description: "Whether the Gradle Cache should be in read-only mode so this job won't be allowed to write to it" default: "true" runs: using: "composite" steps: - name: Setup gradle uses: gradle/actions/setup-gradle@v3 with: gradle-version: wrapper # We want the Gradle cache to be written only on main/-stable branches run, and only for jobs with `cache-read-only` == false (i.e. `build_android`). cache-read-only: ${{ (github.ref != 'refs/heads/main' && !contains(github.ref, '-stable')) || inputs.cache-read-only == 'true' }} # Similarly, for those jobs we want to start with a clean cache so it doesn't grow without limits (this is the negation of the previous condition). cache-write-only: ${{ (github.ref == 'refs/heads/main' || contains(github.ref, '-stable')) && inputs.cache-read-only != 'true' }} # Temporarily disabling to try resolve a cache cleanup failure # gradle-home-cache-cleanup: true add-job-summary-as-pr-comment: on-failure