Skip to content

Commit

Permalink
Setup caching per runner.os
Browse files Browse the repository at this point in the history
  • Loading branch information
hdecarne committed Jan 14, 2024
1 parent 9e77942 commit e135de5
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 4 deletions.
25 changes: 23 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,33 @@ jobs:
go-version-file: 'go.mod'
check-latest: true
cache: false
- name: Set up Caching
- name: Set up Caching for Linux
if: runner.os == 'Linux'
uses: actions/cache@v3
with:
path: |
~/.cache/go-build
~/go
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Set up Caching for macOS
if: runner.os == 'macOS'
uses: actions/cache@v3
with:
path: |
~/Library/Caches/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Set up Caching for Windows
if: runner.os == 'Windows'
uses: actions/cache@v3
with:
path: |
~\AppData\Local\go-build
~\go\pkg\mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
Expand Down
25 changes: 23 additions & 2 deletions .github/workflows/distribute.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,33 @@ jobs:
go-version-file: 'go.mod'
check-latest: true
cache: false
- name: Set up Caching
- name: Set up Caching for Linux
if: runner.os == 'Linux'
uses: actions/cache@v3
with:
path: |
~/.cache/go-build
~/go
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Set up Caching for macOS
if: runner.os == 'macOS'
uses: actions/cache@v3
with:
path: |
~/Library/Caches/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Set up Caching for Windows
if: runner.os == 'Windows'
uses: actions/cache@v3
with:
path: |
~\AppData\Local\go-build
~\go\pkg\mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
Expand Down

0 comments on commit e135de5

Please sign in to comment.