From d3a5ae9b46e1f52a602caa95bab8ea9788993592 Mon Sep 17 00:00:00 2001 From: McKayla Washburn Date: Tue, 5 Nov 2024 22:10:53 +0000 Subject: [PATCH 1/2] chore: pin github actions to exact commits --- .github/workflows/release.yml | 59 +++++++++++++++++------------------ .github/workflows/test.yml | 29 +++++++++++------ 2 files changed, 48 insertions(+), 40 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2755e44..cd772bc 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,37 +1,36 @@ name: release on: - push: - tags: - - 'v*' + push: + tags: + - "v*" permissions: - contents: write + contents: write jobs: - goreleaser: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Unshallow - run: git fetch --prune --unshallow - - name: Setup Go - uses: actions/setup-go@v5 - with: - go-version: 1.22.4 - - name: Import GPG Key - id: import_gpg - uses: crazy-max/ghaction-import-gpg@v6.2.0 - with: - gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} - - name: Run GoReleaser - uses: goreleaser/goreleaser-action@v6.0.0 - with: - version: latest - args: release --clean - env: - GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }} - # GitHub sets this automatically - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - + goreleaser: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Unshallow + run: git fetch --prune --unshallow + - name: Setup Go + uses: actions/setup-go@v5 + with: + go-version: "1.22" + - name: Import GPG Key + id: import_gpg + uses: crazy-max/ghaction-import-gpg@cb9bde2e2525e640591a934b1fd28eef1dcaf5e5 + with: + gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} + - name: Run GoReleaser + uses: goreleaser/goreleaser-action@286f3b13b1b49da4ac219696163fb8c1c93e1200 + with: + version: latest + args: release --clean + env: + GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }} + # GitHub sets this automatically + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b348a86..a50af98 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -25,14 +25,18 @@ jobs: timeout-minutes: 5 steps: - uses: actions/checkout@v4 + - uses: actions/setup-go@v5 with: go-version-file: "go.mod" cache: true + - run: go mod download + - run: go build -v . + - name: Run linters - uses: golangci/golangci-lint-action@v6 + uses: golangci/golangci-lint-action@971e284b6050e8a5849b72094c50ab08da042db8 with: version: latest @@ -40,11 +44,14 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 + - uses: actions/setup-go@v5 with: go-version-file: "go.mod" cache: true + - run: go generate ./... + - name: git diff run: | git diff --compact-summary --exit-code || \ @@ -73,19 +80,23 @@ jobs: - "1.9.*" steps: - uses: actions/checkout@v4 + - uses: actions/setup-go@v5 with: go-version-file: "go.mod" cache: true - - uses: hashicorp/setup-terraform@v3 + + - uses: hashicorp/setup-terraform@b9cd54a3c349d3f38e8881555d616ced269862dd with: terraform_version: ${{ matrix.terraform }} terraform_wrapper: false + - run: go mod download - - env: + + - run: go test -v -cover ./internal/provider/ + env: TF_ACC: "1" CODER_ENTERPRISE_LICENSE: ${{ secrets.CODER_ENTERPRISE_LICENSE }} - run: go test -v -cover ./internal/provider/ timeout-minutes: 10 lint: @@ -93,20 +104,18 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 5 steps: - - name: Set up Go - uses: actions/setup-go@v5 + - uses: actions/checkout@v4 + + - uses: actions/setup-go@v5 with: go-version: "1.22" id: go - - uses: hashicorp/setup-terraform@v3 + - uses: hashicorp/setup-terraform@b9cd54a3c349d3f38e8881555d616ced269862dd with: terraform_version: "1.9.*" terraform_wrapper: false - - name: Check out code into the Go module directory - uses: actions/checkout@v4 - - name: Get dependencies run: | go mod download From d8e41ba04e4178a9aeabcd1017f7531742281ab1 Mon Sep 17 00:00:00 2001 From: McKayla Washburn Date: Thu, 7 Nov 2024 18:43:09 +0000 Subject: [PATCH 2/2] version comments --- .github/workflows/release.yml | 8 ++++---- .github/workflows/test.yml | 22 +++++++++++----------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index cd772bc..7ffb4e1 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -13,20 +13,20 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - name: Unshallow run: git fetch --prune --unshallow - name: Setup Go - uses: actions/setup-go@v5 + uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed # v5.1.0 with: go-version: "1.22" - name: Import GPG Key id: import_gpg - uses: crazy-max/ghaction-import-gpg@cb9bde2e2525e640591a934b1fd28eef1dcaf5e5 + uses: crazy-max/ghaction-import-gpg@cb9bde2e2525e640591a934b1fd28eef1dcaf5e5 # v6.2.0 with: gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} - name: Run GoReleaser - uses: goreleaser/goreleaser-action@286f3b13b1b49da4ac219696163fb8c1c93e1200 + uses: goreleaser/goreleaser-action@286f3b13b1b49da4ac219696163fb8c1c93e1200 # v6.0.0 with: version: latest args: release --clean diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index a50af98..e8db37f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -24,9 +24,9 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 5 steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - - uses: actions/setup-go@v5 + - uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed # v5.1.0 with: go-version-file: "go.mod" cache: true @@ -36,16 +36,16 @@ jobs: - run: go build -v . - name: Run linters - uses: golangci/golangci-lint-action@971e284b6050e8a5849b72094c50ab08da042db8 + uses: golangci/golangci-lint-action@971e284b6050e8a5849b72094c50ab08da042db8 # v6.1.1 with: version: latest generate: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - - uses: actions/setup-go@v5 + - uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed # v5.1.0 with: go-version-file: "go.mod" cache: true @@ -79,14 +79,14 @@ jobs: - "1.8.*" - "1.9.*" steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - - uses: actions/setup-go@v5 + - uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed # v5.1.0 with: go-version-file: "go.mod" cache: true - - uses: hashicorp/setup-terraform@b9cd54a3c349d3f38e8881555d616ced269862dd + - uses: hashicorp/setup-terraform@b9cd54a3c349d3f38e8881555d616ced269862dd # v3.1.2 with: terraform_version: ${{ matrix.terraform }} terraform_wrapper: false @@ -104,14 +104,14 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 5 steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - - uses: actions/setup-go@v5 + - uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed # v5.1.0 with: go-version: "1.22" id: go - - uses: hashicorp/setup-terraform@b9cd54a3c349d3f38e8881555d616ced269862dd + - uses: hashicorp/setup-terraform@b9cd54a3c349d3f38e8881555d616ced269862dd # v3.1.2 with: terraform_version: "1.9.*" terraform_wrapper: false