From 93c9904c0272b9e36736e69a046fb9d9aa2befa0 Mon Sep 17 00:00:00 2001 From: Fraser Waters Date: Sat, 9 Mar 2024 08:00:24 +0000 Subject: [PATCH] Update CI dependencies --- .github/workflows/stage-lint.yml | 24 ++++++++++++++---------- .github/workflows/stage-publish.yml | 4 ++-- .github/workflows/stage-test.yml | 4 ++-- pkg/pulumiyaml/sort_test.go | 3 +-- 4 files changed, 19 insertions(+), 16 deletions(-) diff --git a/.github/workflows/stage-lint.yml b/.github/workflows/stage-lint.yml index b49a2ccc..24388074 100644 --- a/.github/workflows/stage-lint.yml +++ b/.github/workflows/stage-lint.yml @@ -7,7 +7,8 @@ permissions: read-all env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - GOLANGCI_LINT_VERSION: v1.53 + GOLANGCI_LINT_VERSION: v1.55 + GO_VERSION: v1.21.x jobs: lint: @@ -16,22 +17,25 @@ jobs: - name: Checkout Repo uses: actions/checkout@v2 - name: Set up Go - uses: actions/setup-go@v4 + uses: actions/setup-go@v5 with: - go-version: 1.20.x - # golangci-lint-action handles all the caching for Go. - cache: false + go-version: ${{ env.GO_VERSION }} + cache-dependency-path: | + **/go.sum - run: go mod tidy -go=1.19 - - name: Fail if god mod not tidy + - name: Fail if go mod tidy changed go.mod run: | if [ -n "$(git status --porcelain)" ]; then echo "::error go.mod not tidy" exit 1 fi - - name: golangci-lint - uses: golangci/golangci-lint-action@v3 + uses: golangci/golangci-lint-action@v4 with: + # Caching was done by actions/setup-go + skip-cache: true + skip-pkg-cache: true + skip-build-cache: true version: ${{ env.GOLANGCI_LINT_VERSION }} check-copyright: @@ -44,8 +48,8 @@ jobs: with: repo: pulumi/pulumictl - name: Set up Go - uses: actions/setup-go@v4 + uses: actions/setup-go@v5 with: - go-version: 1.20.x + go-version: 1.21.x - name: Lint run: make lint-copyright diff --git a/.github/workflows/stage-publish.yml b/.github/workflows/stage-publish.yml index 7f0cf935..07ec6313 100644 --- a/.github/workflows/stage-publish.yml +++ b/.github/workflows/stage-publish.yml @@ -20,9 +20,9 @@ jobs: - name: Unshallow clone for tags run: git fetch --prune --unshallow --tags || true - name: Install Go - uses: actions/setup-go@v4 + uses: actions/setup-go@v5 with: - go-version: 1.20.x + go-version: 1.21.x - name: Run GoReleaser uses: goreleaser/goreleaser-action@v2 with: diff --git a/.github/workflows/stage-test.yml b/.github/workflows/stage-test.yml index 4f15a8b2..80360fbd 100644 --- a/.github/workflows/stage-test.yml +++ b/.github/workflows/stage-test.yml @@ -70,7 +70,7 @@ jobs: with: ref: ${{ inputs.commit-ref }} - name: Install Go - uses: actions/setup-go@v4 + uses: actions/setup-go@v5 with: go-version: ${{ matrix.go-version }} - name: Set up Python ${{ inputs.python-version }} @@ -146,4 +146,4 @@ jobs: strategy: fail-fast: false matrix: - go-version: [1.20.x] + go-version: [1.21.x] diff --git a/pkg/pulumiyaml/sort_test.go b/pkg/pulumiyaml/sort_test.go index e4e00c5f..d574faf9 100644 --- a/pkg/pulumiyaml/sort_test.go +++ b/pkg/pulumiyaml/sort_test.go @@ -19,9 +19,8 @@ func diagString(d *syntax.Diagnostic) string { return fmt.Sprintf("%v:%v:%v: %s", d.Subject.Filename, d.Subject.Start.Line, d.Subject.Start.Column, d.Summary) } else if d.Context != nil { return fmt.Sprintf("%v:%v:%v: %s", d.Context.Filename, d.Context.Start.Line, d.Context.End.Line, d.Summary) - } else { - return fmt.Sprintf("%v", d.Summary) } + return fmt.Sprintf("%v", d.Summary) } func requireNoErrors(t *testing.T, tmpl *ast.TemplateDecl, diags syntax.Diagnostics) {