Skip to content

Commit

Permalink
feat: add use-github-cache input
Browse files Browse the repository at this point in the history
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`
  • Loading branch information
austinletson committed May 22, 2024
1 parent 3eaf5b6 commit dce3b4a
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/workflows/functional_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,4 @@ jobs:
uses: ./
with:
test: ${{ matrix.lake-test }}
use-github-cache: false
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 9 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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 }}
Expand Down Expand Up @@ -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 }}
Expand Down

0 comments on commit dce3b4a

Please sign in to comment.