mirror of
https://github.com/project-zot/zot.git
synced 2024-12-30 22:34:13 -05:00
ci(cache): split go build cache from go modules cache (#1169)
The cache should not be the same if we build for different OSs/architectures Signed-off-by: Andrei Aaron <aaaron@luxoft.com>
This commit is contained in:
parent
78feb4b495
commit
3cb99f4ed9
1 changed files with 14 additions and 4 deletions
18
.github/workflows/ci-cd.yml
vendored
18
.github/workflows/ci-cd.yml
vendored
|
@ -46,14 +46,24 @@ jobs:
|
|||
uses: actions/cache@v3
|
||||
with:
|
||||
path: |
|
||||
~/.cache/go-build
|
||||
~/go/pkg/mod
|
||||
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
|
||||
key: ${{ runner.os }}-go-mod-${{ hashFiles('**/go.sum') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-go-
|
||||
${{ runner.os }}-go-mod-
|
||||
- name: Cache go build output
|
||||
id: cache-go-build
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: |
|
||||
~/.cache/go-build
|
||||
key: ${{ matrix.os }}-${{ matrix.arch }}-go-build-${{ hashFiles('**/go.sum') }}
|
||||
restore-keys: |
|
||||
${{ matrix.os }}-${{ matrix.arch }}-go-build-
|
||||
- name: Install go dependencies
|
||||
if: steps.cache-go-dependencies.outputs.cache-hit != 'true'
|
||||
run: go mod download
|
||||
run: |
|
||||
cd $GITHUB_WORKSPACE
|
||||
go mod download
|
||||
- name: Install other dependencies
|
||||
run: |
|
||||
cd $GITHUB_WORKSPACE
|
||||
|
|
Loading…
Reference in a new issue