Skip to content

Commit

Permalink
action: add caching (and option to disable it) (#10)
Browse files Browse the repository at this point in the history
  • Loading branch information
joelanford committed Feb 25, 2022
1 parent f013e17 commit d0cdd79
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ Print compatible API changes (default: `true`)

Path to root of git repository to compare (default: current working directory)

#### `skip-cache`

Skip automatic caching of go module directories (default: `false`)

### Outputs

_(none)_
Expand Down
13 changes: 13 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,22 @@ inputs:
description: 'Path to root of git repository to compare'
required: false
default: '.'
skip-cache:
description: 'Skip automatic caching of go module directories'
required: false
default: false
runs:
using: 'composite'
steps:
- uses: actions/cache@v2
if: ${{ inputs.skip-cache != 'true' }}
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-apidiff-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-apidiff
- shell: bash
run: |
if [[ "${{ github.repository }}" == "joelanford/go-apidiff" && "${{ inputs.version }}" == "latest" ]]; then
Expand Down

0 comments on commit d0cdd79

Please sign in to comment.