Skip to content

Commit

Permalink
*: fix CI cache (#107)
Browse files Browse the repository at this point in the history
  • Loading branch information
xhebox authored Oct 9, 2022
1 parent c46acb9 commit b1e0a00
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/common.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,20 +46,20 @@ jobs:
go-version-file: go.mod
check-latest: true
- name: "set vars"
id: cache
run: |
echo "GOCACHE=$(go env GOCACHE)" >> $GITHUB_ENV
echo "GOMODCACHE=$(go env GOMODCACHE)" >> $GITHUB_ENV
echo "::set-output name=go_cache::$(go env GOCACHE)"
echo "::set-output name=go_mod_cache::$(go env GOMODCACHE)"
- name: "try to use build cache"
uses: actions/cache@v3
with:
path: |
${{ env.GOCACHE }}
${{ env.GOMODCACHE }}
key: ${{ runner.os }}-go-${{ inputs.target == "cache" && github.run_id || hashFiles('**/go.sum')}}
${{ steps.cache.outputs.go_cache }}
${{ steps.cache.outputs.go_mod_cache }}
key: ${{ runner.os }}-go-${{ inputs.target == 'cache' && github.run_id || hashFiles('**/go.sum')}}
restore-keys: |
${{ runner.os }}-go-
- name: make ${{ inputs.target }}
if: ${{ inputs.target != '' }}
run: make ${{ inputs.target }}
- name: "set up tmate session if necessary"
if: ${{ failure() && inputs.debug }}
Expand Down
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ default: cmd

dev: cmd lint test

cache: build lint test

cmd: $(EXECUTABLE_TARGETS)

cmd_%: OUTPUT=$(patsubst cmd_%,./bin/%,$@)
Expand Down

0 comments on commit b1e0a00

Please sign in to comment.