From 0cb89e32482152e9d198eb4923678a8e8ef489f8 Mon Sep 17 00:00:00 2001 From: David Bloss Date: Mon, 22 Jan 2024 15:58:18 -0600 Subject: [PATCH] add cache to CI --- .github/workflows/release.yml | 9 ++++++++- .github/workflows/tests.yml | 7 +++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7b9ca8c3..784ba22d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -32,7 +32,14 @@ jobs: - name: Set up Go uses: actions/setup-go@v5 with: - go-version: 1.21 + go-version-file: go.mod + - name: Cache Go modules + uses: actions/cache@v4 + with: + path: ~/go/pkg/mod + key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} + restore-keys: | + ${{ runner.os }}-go- - name: Ensure Changelog run: | if test -f ./.changes/${{ steps.next_version.outputs.version_tag }}.md diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 5854b4ae..d920eb6c 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -29,6 +29,13 @@ jobs: with: version: 3.x repo-token: ${{ secrets.GITHUB_TOKEN }} + - name: Cache Go modules + uses: actions/cache@v4 + with: + path: ~/go/pkg/mod + key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} + restore-keys: | + ${{ runner.os }}-go- - name: Run Tests run: task ci - name: Upload Coverage