mirror of
https://github.com/bakito/adguardhome-sync.git
synced 2025-10-26 11:19:54 +00:00
Update caching strategy in Go workflow
This commit is contained in:
parent
b78e616469
commit
75c506afd7
72
.github/workflows/go.yml
vendored
72
.github/workflows/go.yml
vendored
@ -22,12 +22,25 @@ jobs:
|
||||
with:
|
||||
go-version-file: "go.mod"
|
||||
|
||||
- 'name': 'Set up tools cache'
|
||||
'uses': 'actions/cache@v4'
|
||||
'with':
|
||||
'path': "${{ github.workspace }}/bin"
|
||||
'key': "${{ runner.os }}-${{ github.job }}-tools-${{ hashFiles('.toolbox.mk') }}"
|
||||
'restore-keys': '${{ runner.os }}-${{ github.job }}-tools-'
|
||||
# Cache Go build cache and module cache (speeds up module downloads & rebuilds)
|
||||
- name: Cache Go modules and build cache
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: |
|
||||
~/.cache/go-build
|
||||
~/go/pkg/mod
|
||||
key: ${{ runner.os }}-${{ github.job }}-go-mod-${{ hashFiles('go.sum') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-${{ github.job }}-go-mod-
|
||||
|
||||
# Cache toolbox binaries produced by .toolbox.mk
|
||||
- name: Cache toolbox binaries
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ${{ github.workspace }}/bin
|
||||
key: ${{ runner.os }}-${{ github.job }}-tools-${{ hashFiles('.toolbox.mk') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-${{ github.job }}-tools-
|
||||
|
||||
- name: Lint
|
||||
run: make lint
|
||||
@ -49,12 +62,23 @@ jobs:
|
||||
with:
|
||||
go-version-file: "go.mod"
|
||||
|
||||
- 'name': 'Set up tools cache'
|
||||
'uses': 'actions/cache@v4'
|
||||
'with':
|
||||
'path': "${{ github.workspace }}/bin"
|
||||
'key': "${{ runner.os }}-${{ github.job }}-tools-${{ hashFiles('.toolbox.mk') }}"
|
||||
'restore-keys': '${{ runner.os }}-${{ github.job }}-tools-'
|
||||
- name: Cache Go modules and build cache
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: |
|
||||
~/.cache/go-build
|
||||
~/go/pkg/mod
|
||||
key: ${{ runner.os }}-${{ github.job }}-go-mod-${{ hashFiles('go.sum') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-${{ github.job }}-go-mod-
|
||||
|
||||
- name: Cache toolbox binaries
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ${{ github.workspace }}/bin
|
||||
key: ${{ runner.os }}-${{ github.job }}-tools-${{ hashFiles('.toolbox.mk') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-${{ github.job }}-tools-
|
||||
|
||||
- name: Model
|
||||
run: make model
|
||||
@ -82,13 +106,23 @@ jobs:
|
||||
with:
|
||||
go-version-file: "go.mod"
|
||||
|
||||
- 'name': 'Set up tools cache'
|
||||
'uses': 'actions/cache@v4'
|
||||
'with':
|
||||
'path': "${{ github.workspace }}/bin"
|
||||
'key': "${{ runner.os }}-${{ github.job }}-tools-${{ hashFiles('.toolbox.mk') }}"
|
||||
'restore-keys': '${{ runner.os }}-${{ github.job }}-tools-'
|
||||
- name: Cache Go modules and build cache
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: |
|
||||
~/.cache/go-build
|
||||
~/go/pkg/mod
|
||||
key: ${{ runner.os }}-${{ github.job }}-go-mod-${{ hashFiles('go.sum') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-${{ github.job }}-go-mod-
|
||||
|
||||
- name: Cache toolbox binaries
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ${{ github.workspace }}/bin
|
||||
key: ${{ runner.os }}-${{ github.job }}-tools-${{ hashFiles('.toolbox.mk') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-${{ github.job }}-tools-
|
||||
|
||||
- name: Run GoReleaser
|
||||
run: make test-release
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user