.github/workflows: take into account Makefile contents when generating cache key for Go build aftifacts

The cache key must change when the corresponding 'make ...' command changes inside Makefile.
This commit is contained in:
Aliaksandr Valialkin 2023-11-21 11:51:05 +02:00
parent 95f12c7e28
commit 74fda0b311
No known key found for this signature in database
GPG key ID: 52C003EE2BCDB9EB
2 changed files with 4 additions and 4 deletions

View file

@ -29,7 +29,7 @@ jobs:
~/.cache/go-build ~/.cache/go-build
~/go/pkg/mod ~/go/pkg/mod
~/go/bin ~/go/bin
key: go-artifacts-${{ runner.os }}-check-licenses-${{ hashFiles('go.sum') }} key: go-artifacts-${{ runner.os }}-check-licenses-${{ hashFiles('go.sum', 'Makefile', 'app/**/Makefile') }}
restore-keys: go-artifacts-${{ runner.os }}-check-licenses- restore-keys: go-artifacts-${{ runner.os }}-check-licenses-
- name: Check License - name: Check License
run: make check-licenses run: make check-licenses

View file

@ -42,7 +42,7 @@ jobs:
~/.cache/go-build ~/.cache/go-build
~/go/pkg/mod ~/go/pkg/mod
~/go/bin ~/go/bin
key: go-artifacts-${{ runner.os }}-check-all-${{ hashFiles('go.sum') }} key: go-artifacts-${{ runner.os }}-check-all-${{ hashFiles('go.sum', 'Makefile', 'app/**/Makefile') }}
restore-keys: go-artifacts-${{ runner.os }}-check-all- restore-keys: go-artifacts-${{ runner.os }}-check-all-
- name: Run check-all - name: Run check-all
@ -72,7 +72,7 @@ jobs:
~/.cache/go-build ~/.cache/go-build
~/go/pkg/mod ~/go/pkg/mod
~/go/bin ~/go/bin
key: go-artifacts-${{ runner.os }}-crossbuild-${{ hashFiles('go.sum') }} key: go-artifacts-${{ runner.os }}-crossbuild-${{ hashFiles('go.sum', 'Makefile', 'app/**/Makefile') }}
restore-keys: go-artifacts-${{ runner.os }}-crossbuild- restore-keys: go-artifacts-${{ runner.os }}-crossbuild-
- name: Build - name: Build
@ -102,7 +102,7 @@ jobs:
~/.cache/go-build ~/.cache/go-build
~/go/pkg/mod ~/go/pkg/mod
~/go/bin ~/go/bin
key: go-artifacts-${{ runner.os }}-${{ matrix.scenario }}-${{ hashFiles('go.sum') }} key: go-artifacts-${{ runner.os }}-${{ matrix.scenario }}-${{ hashFiles('go.sum', 'Makefile', 'app/**/Makefile') }}
restore-keys: go-artifacts-${{ runner.os }}-${{ matrix.scenario }}- restore-keys: go-artifacts-${{ runner.os }}-${{ matrix.scenario }}-
- name: run tests - name: run tests