From 2596e16998c88f3352ad0869a54a2456796193c7 Mon Sep 17 00:00:00 2001 From: Ellis Tarn Date: Thu, 21 Oct 2021 16:25:35 -0700 Subject: [PATCH] Cache go modules/bins for faster builds (#756) --- .github/workflows/ci.yaml | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 1cb892473d0f..88985dc6999f 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -4,14 +4,19 @@ jobs: build: runs-on: ubuntu-latest steps: - - name: Checkout Repository - uses: actions/checkout@v2 - - - name: Setup Go - uses: actions/setup-go@v2 + - uses: actions/checkout@v2 + - uses: actions/setup-go@v2 with: go-version: 1.17 - + - uses: actions/cache@v2 + with: + path: | + ~/.cache/go-build + ~/go/pkg/mod + ~/go/bin/ + key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} + restore-keys: | + ${{ runner.os }}-go- - name: CI - Verifications and Tests run: | make toolchain @@ -19,9 +24,7 @@ jobs: make ci env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: Upload Code Coverage - uses: actions/upload-artifact@v2 + - uses: actions/upload-artifact@v2 with: name: coverage path: coverage.html