diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index c5022c1c..e050d36c 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -2,9 +2,6 @@ name: Go on: push -env: - GO_VERSION: 1.19 - jobs: lint: name: Lint @@ -15,7 +12,8 @@ jobs: - name: Set up Go uses: actions/setup-go@v3 with: - go-version: ~${{ env.GO_VERSION }} + cache: true + go-version-file: go.mod - name: Lint uses: golangci/golangci-lint-action@v3 with: @@ -30,13 +28,8 @@ jobs: - name: Set up Go uses: actions/setup-go@v3 with: - go-version: ~${{ env.GO_VERSION }} - - uses: actions/cache@v3 - with: - path: ~/go/pkg/mod - key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} - restore-keys: | - ${{ runner.os }}-go- + cache: true + go-version-file: go.mod - name: Test run: go test ./... @@ -52,13 +45,8 @@ jobs: - name: Set up Go uses: actions/setup-go@v3 with: - go-version: ~${{ env.GO_VERSION }} - - uses: actions/cache@v3 - with: - path: ~/go/pkg/mod - key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} - restore-keys: | - ${{ runner.os }}-go- + cache: true + go-version-file: go.mod - name: Run GoReleaser uses: goreleaser/goreleaser-action@v3 with: