Files
react-native/.github/actions/setup-gradle/action.yml
Nicola Corti e49f2d5c50 Enable Gradle Configuration Caching on CI (#49514)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49514

This attemps to enable Config Caching on CI. I'm curious to see how much time this is going to save.
There might be some problems with nigthlies so I want to make sure this is running for some days before the branch cut.

Changelog:
[Internal] [Changed] -

Reviewed By: NickGerleman

Differential Revision: D69846848

fbshipit-source-id: 0d5c292e65a6107df62f6494a1aae9abd0e8b6cc
2025-02-20 02:42:24 -08:00

24 lines
1.4 KiB
YAML

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"
cache-encryption-key:
description: "The encryption key needed to store the Gradle Configuration cache"
runs:
using: "composite"
steps:
- name: Setup gradle
uses: gradle/actions/setup-gradle@v4
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' }}
add-job-summary-as-pr-comment: on-failure
# Encryption key for the Gradle Configuration Cache.
# See https://docs.gradle.org/8.6/userguide/configuration_cache.html#config_cache:secrets:configuring_encryption_key
cache-encryption-key: ${{ inputs.cache-encryption-key }}