From dce3b4ad652a2283dfdc52e5d9baee03326aaf1c Mon Sep 17 00:00:00 2001 From: austinletson Date: Wed, 22 May 2024 19:37:06 -0400 Subject: [PATCH] feat: add `use-github-cache` input Add `use-github-cache` input which when set enables/disables `actions/cache`. `lean-action`'s ci workflows are currently the primary luse case for disabling `action/cache` --- .github/workflows/functional_tests.yml | 1 + CHANGELOG.md | 3 +++ README.md | 6 ++++++ action.yml | 9 +++++++++ 4 files changed, 19 insertions(+) diff --git a/.github/workflows/functional_tests.yml b/.github/workflows/functional_tests.yml index 503cd3f..148f306 100644 --- a/.github/workflows/functional_tests.yml +++ b/.github/workflows/functional_tests.yml @@ -54,3 +54,4 @@ jobs: uses: ./ with: test: ${{ matrix.lake-test }} + use-github-cache: false diff --git a/CHANGELOG.md b/CHANGELOG.md index 573a56c..273a9e1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## Unreleased +### Added +- new `github-cache` input to specify if `lean-action` should use `actions/cache` to cache the `.lake` folder + ## v1-beta - 2024-05-21 ### Added diff --git a/README.md b/README.md index 67db47b..fcdea93 100644 --- a/README.md +++ b/README.md @@ -63,6 +63,12 @@ jobs: # Allowed values: "true" or "false". # Default: false lean4checker: false + + + # Enable GitHub caching. + # Allowed values: "true" or "false". + # If use-github-cache input is not provided, the action will use GitHub caching by default. + use-github-cache: true ``` ## Examples diff --git a/action.yml b/action.yml index f63c35d..183f313 100644 --- a/action.yml +++ b/action.yml @@ -54,6 +54,13 @@ inputs: If lean4checker input is not provided, the action will not check the environment with lean4checker. required: false default: "false" + use-github-cache: + description: | + Enable GitHub caching. + Allowed values: "true" or "false". + If use-github-cache input is not provided, `lean-action` will use GitHub caching by default. + required: false + default: "true" runs: using: "composite" @@ -63,6 +70,7 @@ runs: shell: bash - uses: actions/cache@v4 + if: ${{ inputs.use-github-cache == 'true' }} with: path: .lake key: ${{ runner.os }}-lake-${{ github.sha }} @@ -95,6 +103,7 @@ runs: shell: bash - uses: actions/cache/save@v4 + if: ${{ inputs.use-github-cache == 'true' }} with: path: .lake key: ${{ runner.os }}-lake-${{ github.sha }}