From 74fda0b3110fd22c33f143a3b84903932fa5f44b Mon Sep 17 00:00:00 2001 From: Aliaksandr Valialkin Date: Tue, 21 Nov 2023 11:51:05 +0200 Subject: [PATCH] .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. --- .github/workflows/check-licenses.yml | 2 +- .github/workflows/main.yml | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/check-licenses.yml b/.github/workflows/check-licenses.yml index 91c56e2ca..b96eccedc 100644 --- a/.github/workflows/check-licenses.yml +++ b/.github/workflows/check-licenses.yml @@ -29,7 +29,7 @@ jobs: ~/.cache/go-build ~/go/pkg/mod ~/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- - name: Check License run: make check-licenses diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 6dec8ab5d..f37755abf 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -42,7 +42,7 @@ jobs: ~/.cache/go-build ~/go/pkg/mod ~/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- - name: Run check-all @@ -72,7 +72,7 @@ jobs: ~/.cache/go-build ~/go/pkg/mod ~/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- - name: Build @@ -102,7 +102,7 @@ jobs: ~/.cache/go-build ~/go/pkg/mod ~/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 }}- - name: run tests