-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Chore: add golangci-lint (linter) support (#972)
* Chore: add golangci-lint (linter) support * fix test
- Loading branch information
1 parent
4767b7f
commit 81ae429
Showing
140 changed files
with
850 additions
and
320 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,51 +1,55 @@ | ||
name: CI | ||
|
||
on: | ||
pull_request: | ||
types: [opened, synchronize] | ||
|
||
env: | ||
ENV0_API_ENDPOINT: ${{ secrets.ENV0_API_ENDPOINT }} | ||
ENV0_API_KEY: ${{ secrets.TF_PROVIDER_INTEGRATION_TEST_API_KEY }} # API Key for organization 'TF-provider-integration-tests' @ dev | ||
ENV0_API_SECRET: ${{ secrets.TF_PROVIDER_INTEGRATION_TEST_API_SECRET }} | ||
GO_VERSION: "1.21" | ||
TERRAFORM_VERSION: 1.1.7 | ||
|
||
jobs: | ||
unit-tests: | ||
name: Unit Tests | ||
timeout-minutes: 10 | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- name: Install Go | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version: ${{ env.GO_VERSION }} | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
- name: Generate mocks | ||
run: | | ||
go install go.uber.org/mock/[email protected] | ||
go generate client/api_client.go | ||
- name: Go fmt | ||
run: | | ||
! go fmt ./... | read | ||
- name: Go vet | ||
run: | | ||
! go vet ./... | read | ||
- name: Go Test | ||
run: go test -v ./... | ||
|
||
# See terraform-provider-env0 README for integration tests prerequisites | ||
integration-tests: | ||
name: Integration Tests | ||
runs-on: ubuntu-20.04 | ||
container: golang:1.21-alpine3.18 | ||
timeout-minutes: 20 | ||
steps: | ||
- name: Install Terraform | ||
run: apk add terraform | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
- name: Run Harness tests | ||
run: go run tests/harness.go | ||
name: CI | ||
|
||
on: | ||
pull_request: | ||
types: [opened, synchronize] | ||
|
||
env: | ||
ENV0_API_ENDPOINT: ${{ secrets.ENV0_API_ENDPOINT }} | ||
ENV0_API_KEY: ${{ secrets.TF_PROVIDER_INTEGRATION_TEST_API_KEY }} # API Key for organization 'TF-provider-integration-tests' @ dev | ||
ENV0_API_SECRET: ${{ secrets.TF_PROVIDER_INTEGRATION_TEST_API_SECRET }} | ||
GO_VERSION: "1.21" | ||
TERRAFORM_VERSION: 1.1.7 | ||
|
||
jobs: | ||
unit-tests: | ||
name: Unit Tests | ||
timeout-minutes: 10 | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- name: Install Go | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version: ${{ env.GO_VERSION }} | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
- name: Generate mocks | ||
run: | | ||
go install go.uber.org/mock/[email protected] | ||
go generate client/api_client.go | ||
- name: Go fmt | ||
run: | | ||
! go fmt ./... | read | ||
- name: Go vet | ||
run: | | ||
! go vet ./... | read | ||
- name: golangci-lint | ||
uses: golangci/golangci-lint-action@v6 | ||
with: | ||
version: v1.60 | ||
- name: Go Test | ||
run: go test -v ./... | ||
|
||
# See terraform-provider-env0 README for integration tests prerequisites | ||
integration-tests: | ||
name: Integration Tests | ||
runs-on: ubuntu-20.04 | ||
container: golang:1.21-alpine3.18 | ||
timeout-minutes: 20 | ||
steps: | ||
- name: Install Terraform | ||
run: apk add terraform | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
- name: Run Harness tests | ||
run: go run tests/harness.go |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.