Skip to content

Commit

Permalink
Leverage the built-in cache in setup-go@v4 (#157)
Browse files Browse the repository at this point in the history
  • Loading branch information
kezhenxu94 authored Mar 28, 2023
1 parent c5ee307 commit 5b7ee17
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 72 deletions.
25 changes: 1 addition & 24 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,30 +48,7 @@ runs:
uses: actions/setup-go@v4
with:
go-version: 1.18
- if: runner.os == 'Linux'
uses: actions/cache@v3
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: license-eye-${{ runner.os }}-go-${{ hashFiles(format('{0}/{1}', github.action_path, 'go.sum')) }}
restore-keys: license-eye-${{ runner.os }}-go-
- if: runner.os == 'macOS'
uses: actions/cache@v3
with:
path: |
~/Library/Caches/go-build
~/go/pkg/mod
key: license-eye-${{ runner.os }}-go-${{ hashFiles(format('{0}/{1}', github.action_path, 'go.sum')) }}
restore-keys: license-eye-${{ runner.os }}-go-
- if: runner.os == 'Windows'
uses: actions/cache@v3
with:
path: |
~\AppData\Local\go-build
~\go\pkg\mod
key: license-eye-${{ runner.os }}-go-${{ hashFiles(format('{0}/{1}', github.action_path, 'go.sum')) }}
restore-keys: license-eye-${{ runner.os }}-go-
cache-dependency-path: ${{ github.action_path }}/go.sum
- shell: bash
run: make -C $GITHUB_ACTION_PATH install
- shell: bash
Expand Down
25 changes: 1 addition & 24 deletions dependency/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,30 +42,7 @@ runs:
uses: actions/setup-go@v4
with:
go-version: 1.18
- if: runner.os == 'Linux'
uses: actions/cache@v3
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: license-eye-${{ runner.os }}-go-${{ hashFiles(format('{0}/{1}', github.action_path, 'go.sum')) }}
restore-keys: license-eye-${{ runner.os }}-go-
- if: runner.os == 'macOS'
uses: actions/cache@v3
with:
path: |
~/Library/Caches/go-build
~/go/pkg/mod
key: license-eye-${{ runner.os }}-go-${{ hashFiles(format('{0}/{1}', github.action_path, 'go.sum')) }}
restore-keys: license-eye-${{ runner.os }}-go-
- if: runner.os == 'Windows'
uses: actions/cache@v3
with:
path: |
~\AppData\Local\go-build
~\go\pkg\mod
key: license-eye-${{ runner.os }}-go-${{ hashFiles(format('{0}/{1}', github.action_path, 'go.sum')) }}
restore-keys: license-eye-${{ runner.os }}-go-
cache-dependency-path: ${{ github.action_path }}/go.sum
- shell: bash
run: make -C $GITHUB_ACTION_PATH/.. install
- shell: bash
Expand Down
25 changes: 1 addition & 24 deletions header/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,30 +48,7 @@ runs:
uses: actions/setup-go@v4
with:
go-version: 1.18
- if: runner.os == 'Linux'
uses: actions/cache@v3
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: license-eye-${{ runner.os }}-go-${{ hashFiles(format('{0}/{1}', github.action_path, 'go.sum')) }}
restore-keys: license-eye-${{ runner.os }}-go-
- if: runner.os == 'macOS'
uses: actions/cache@v3
with:
path: |
~/Library/Caches/go-build
~/go/pkg/mod
key: license-eye-${{ runner.os }}-go-${{ hashFiles(format('{0}/{1}', github.action_path, 'go.sum')) }}
restore-keys: license-eye-${{ runner.os }}-go-
- if: runner.os == 'Windows'
uses: actions/cache@v3
with:
path: |
~\AppData\Local\go-build
~\go\pkg\mod
key: license-eye-${{ runner.os }}-go-${{ hashFiles(format('{0}/{1}', github.action_path, 'go.sum')) }}
restore-keys: license-eye-${{ runner.os }}-go-
cache-dependency-path: ${{ github.action_path }}/go.sum
- shell: bash
run: make -C $GITHUB_ACTION_PATH/.. install
- shell: bash
Expand Down

0 comments on commit 5b7ee17

Please sign in to comment.