From eb5a2f21ed2e6a91912f199ba7b313dbcd57a694 Mon Sep 17 00:00:00 2001 From: Mark Sagi-Kazar Date: Tue, 11 Jul 2023 16:19:16 +0200 Subject: [PATCH] ci: add golang cache Signed-off-by: Mark Sagi-Kazar --- .github/workflows/ci.yaml | 54 ++++++++++++++++++++++++++++++++++----- 1 file changed, 47 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 88c81d04..9ecde766 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -23,9 +23,19 @@ jobs: extra_nix_config: | access-tokens = github.com=${{ secrets.GITHUB_TOKEN }} - - name: Magic Nix cache + - name: Set up magic Nix cache uses: DeterminateSystems/magic-nix-cache-Action@v2 + - name: Set up Go caches + uses: actions/cache@v3 + with: + path: | + ~/.cache/go-build + ~/go/pkg/mod + key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} + restore-keys: | + ${{ runner.os }}-go- + - name: Prepare Nix shell run: nix develop --impure .#ci @@ -46,9 +56,19 @@ jobs: extra_nix_config: | access-tokens = github.com=${{ secrets.GITHUB_TOKEN }} - - name: Magic Nix cache + - name: Set up magic Nix cache uses: DeterminateSystems/magic-nix-cache-Action@v2 + - name: Set up Go caches + uses: actions/cache@v3 + with: + path: | + ~/.cache/go-build + ~/go/pkg/mod + key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} + restore-keys: | + ${{ runner.os }}-go- + - name: Prepare Nix shell run: nix develop --impure .#ci @@ -69,9 +89,19 @@ jobs: extra_nix_config: | access-tokens = github.com=${{ secrets.GITHUB_TOKEN }} - - name: Magic Nix cache + - name: Set up magic Nix cache uses: DeterminateSystems/magic-nix-cache-Action@v2 + - name: Set up Go caches + uses: actions/cache@v3 + with: + path: | + ~/.cache/go-build + ~/go/pkg/mod + key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} + restore-keys: | + ${{ runner.os }}-go- + - name: Prepare Nix shell run: nix develop --impure .#ci @@ -92,9 +122,19 @@ jobs: extra_nix_config: | access-tokens = github.com=${{ secrets.GITHUB_TOKEN }} - - name: Magic Nix cache + - name: Set up magic Nix cache uses: DeterminateSystems/magic-nix-cache-Action@v2 + - name: Set up Go caches + uses: actions/cache@v3 + with: + path: | + ~/.cache/go-build + ~/go/pkg/mod + key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} + restore-keys: | + ${{ runner.os }}-go- + - name: Cache license information uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1 with: @@ -132,7 +172,7 @@ jobs: extra_nix_config: | access-tokens = github.com=${{ secrets.GITHUB_TOKEN }} - - name: Magic Nix cache + - name: Set up magic Nix cache uses: DeterminateSystems/magic-nix-cache-Action@v2 - name: Check @@ -183,7 +223,7 @@ jobs: extra_nix_config: | access-tokens = github.com=${{ secrets.GITHUB_TOKEN }} - - name: Magic Nix cache + - name: Set up magic Nix cache uses: DeterminateSystems/magic-nix-cache-Action@v2 - name: Prepare Nix shell @@ -227,7 +267,7 @@ jobs: extra_nix_config: | access-tokens = github.com=${{ secrets.GITHUB_TOKEN }} - - name: Magic Nix cache + - name: Set up magic Nix cache uses: DeterminateSystems/magic-nix-cache-Action@v2 - name: Prepare Nix shell