From ba066df8fc63628987551250efa6ce97caee6aa6 Mon Sep 17 00:00:00 2001 From: Steven Hartland Date: Fri, 25 Nov 2022 15:00:07 +0000 Subject: [PATCH] ci: use setup-go caching (#448) Use setup-go caching instead of manually rolled version. Also: * Bump golangci-lint to 1.50.1. * Add go 1.19 to test / lint matrix. * Bump timeout to 6 mins. --- .github/workflows/test-lint.yml | 32 +++++++------------------------- .golangci.yml | 2 +- 2 files changed, 8 insertions(+), 26 deletions(-) diff --git a/.github/workflows/test-lint.yml b/.github/workflows/test-lint.yml index 7bc2a0b..1b18d3d 100644 --- a/.github/workflows/test-lint.yml +++ b/.github/workflows/test-lint.yml @@ -8,36 +8,19 @@ jobs: go-test-lint: strategy: matrix: - go: [1.18] - golangcli: [v1.50.0] + go: [1.19, 1.18] + golangcli: [v1.50.1] os: [ubuntu-latest] runs-on: ${{ matrix.os }} steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Set up Go uses: actions/setup-go@v3 with: go-version: ${{ matrix.go }} - - - name: Checkout - uses: actions/checkout@v3 - - - name: Go Cache Paths - id: go-cache-paths - run: | - echo "::set-output name=go-build::$(go env GOCACHE)" - echo "::set-output name=go-mod::$(go env GOMODCACHE)" - - - name: Go Build Cache - uses: actions/cache@v3 - with: - path: ${{ steps.go-cache-paths.outputs.go-build }} - key: ${{ runner.os }}-go-build-${{ hashFiles('**/go.sum') }} - - - name: Go Mod Cache - uses: actions/cache@v3 - with: - path: ${{ steps.go-cache-paths.outputs.go-mod }} - key: ${{ runner.os }}-go-mod-${{ hashFiles('**/go.sum') }} + cache: true - name: Validate go mod run: | @@ -49,8 +32,7 @@ jobs: with: version: ${{ matrix.golangci }} args: "--out-${NO_FUTURE}format colored-line-number" - skip-pkg-cache: true - skip-build-cache: true + skip-cache: true - name: Go Build run: go build ./... diff --git a/.golangci.yml b/.golangci.yml index 08c17b1..dc8de9b 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -1,6 +1,6 @@ run: concurrency: 4 - deadline: 5m + deadline: 6m skip-dirs: - terst skip-files: