From 77211220ecf1ad4ffbdb3a08ac2520b63f70e249 Mon Sep 17 00:00:00 2001 From: Matthieu MOREL Date: Thu, 19 Aug 2021 19:04:10 +0200 Subject: [PATCH 1/4] chore(ci) : cache go-build folders Signed-off-by: Matthieu MOREL --- .github/workflows/tests.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 2b354674385..a3bf9e90354 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -21,10 +21,12 @@ jobs: # is very little in the library that is platform specific - go-version: 1.x platform: windows-latest + go-build: ~/AppData/Local/go-build # only update test coverage stats with the most recent go version on linux - go-version: 1.x platform: ubuntu-latest + go-build: ~/.cache/go-build update-coverage: true runs-on: ${{ matrix.platform }} @@ -42,7 +44,9 @@ jobs: - name: Cache go modules uses: actions/cache@v2 with: - path: ~/go/pkg/mod + path: | + ${{ matrix.go-build }} + ~/go/pkg/mod key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} restore-keys: ${{ runner.os }}-go- From 4e48b7483a473ecebd0ed69bd251c474e8aab26f Mon Sep 17 00:00:00 2001 From: Matthieu MOREL Date: Thu, 19 Aug 2021 19:11:59 +0200 Subject: [PATCH 2/4] Update tests.yml --- .github/workflows/tests.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index a3bf9e90354..cada3e714f5 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -22,7 +22,10 @@ jobs: - go-version: 1.x platform: windows-latest go-build: ~/AppData/Local/go-build - + + - go-version: 1.15.x + platform: ubuntu-latest + go-build: ~/.cache/go-build # only update test coverage stats with the most recent go version on linux - go-version: 1.x platform: ubuntu-latest From a75d6892016a8f6ae45c86526803096d79f18b5d Mon Sep 17 00:00:00 2001 From: Matthieu MOREL Date: Thu, 19 Aug 2021 19:19:56 +0200 Subject: [PATCH 3/4] Update tests.yml --- .github/workflows/tests.yml | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index cada3e714f5..1fa265005de 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -21,15 +21,10 @@ jobs: # is very little in the library that is platform specific - go-version: 1.x platform: windows-latest - go-build: ~/AppData/Local/go-build - - go-version: 1.15.x - platform: ubuntu-latest - go-build: ~/.cache/go-build # only update test coverage stats with the most recent go version on linux - go-version: 1.x platform: ubuntu-latest - go-build: ~/.cache/go-build update-coverage: true runs-on: ${{ matrix.platform }} @@ -43,12 +38,16 @@ jobs: with: go-version: ${{ matrix.go-version }} - uses: actions/checkout@v2 - + + # Get values for cache paths to be used in later steps + - id: go-cache + run: echo "::set-output name=go-build::$(go env GOCACHE)" + - name: Cache go modules uses: actions/cache@v2 with: path: | - ${{ matrix.go-build }} + ${{ steps.go-cache.outputs.go-build }} ~/go/pkg/mod key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} restore-keys: ${{ runner.os }}-go- From 85906016d2f4551549200bf72a14cd7269f69d92 Mon Sep 17 00:00:00 2001 From: Matthieu MOREL Date: Thu, 19 Aug 2021 19:25:19 +0200 Subject: [PATCH 4/4] Update tests.yml --- .github/workflows/tests.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 1fa265005de..52c2a5ecc35 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -40,15 +40,17 @@ jobs: - uses: actions/checkout@v2 # Get values for cache paths to be used in later steps - - id: go-cache - run: echo "::set-output name=go-build::$(go env GOCACHE)" + - id: cache-paths + run: | + echo "::set-output name=go-cache::$(go env GOCACHE)" + echo "::set-output name=go-mod-cache::$(go env GOMODCACHE)" - name: Cache go modules uses: actions/cache@v2 with: path: | - ${{ steps.go-cache.outputs.go-build }} - ~/go/pkg/mod + ${{ steps.cache-paths.outputs.go-cache }} + ${{ steps.cache-paths.outputs.go-mod-cache }} key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} restore-keys: ${{ runner.os }}-go-