From dd79d22d0af63aab02d77ac2b08914122d5639b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Mierzwa?= Date: Tue, 27 Dec 2022 19:34:17 +0000 Subject: [PATCH] fix(ci): use cache/restore --- .github/workflows/test.yml | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e17830eab..9887990d7 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -295,7 +295,7 @@ jobs: go-version: 1.19.4 - name: Cache Go - uses: actions/cache@v3 + uses: actions/cache/restore@v3 with: path: | ~/.cache/go-build @@ -404,6 +404,7 @@ jobs: go-version: 1.19.4 - name: Cache Go + if: github.event_name != 'pull_request' uses: actions/cache@v3 with: path: | @@ -413,6 +414,17 @@ jobs: restore-keys: | ${{ runner.os }}-go- + - name: Restore cache + if: github.event_name == 'pull_request' + uses: actions/cache/restore@v3 + with: + path: | + ~/.cache/go-build + ~/go/pkg/mod + key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} + restore-keys: | + ${{ runner.os }}-go- + - name: Set up Node JS uses: actions/setup-node@v3 with: