From b0a92de22ba33de2787804966a804ac3c78abe03 Mon Sep 17 00:00:00 2001 From: Pavel Boldyrev <627562+bpg@users.noreply.github.com> Date: Fri, 21 Oct 2022 21:43:59 -0400 Subject: [PATCH] chore: update ci configs (#148) * chore: update mergify config * chore: add linter --- .github/workflows/golangci-lint.yml | 24 ++++++++++++++++++++++++ .github/workflows/test.yml | 16 +++++----------- .mergify.yml | 8 ++++++++ 3 files changed, 37 insertions(+), 11 deletions(-) create mode 100644 .github/workflows/golangci-lint.yml diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml new file mode 100644 index 00000000..aed09511 --- /dev/null +++ b/.github/workflows/golangci-lint.yml @@ -0,0 +1,24 @@ +name: golangci-lint +on: + push: + tags: + - v* + branches: + - main + pull_request: +permissions: + contents: read + pull-requests: read +jobs: + golangci: + name: lint + runs-on: ubuntu-latest + steps: + - uses: actions/setup-go@v3 + with: + go-version: 1.18 + - uses: actions/checkout@v3 + - name: golangci-lint + uses: golangci/golangci-lint-action@v3 + with: + version: v1.50 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index a0a17aef..9c96f1d1 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -21,17 +21,15 @@ jobs: uses: actions/setup-go@v3 with: go-version: '1.18' - id: go - name: Check out code into the Go module directory uses: actions/checkout@v3 - name: Get dependencies - run: | - go mod download + run: go mod download + - name: Build - run: | - go build -v . + run: go vet . && go build -v . # run acceptance tests in a matrix with Terraform core versions test: @@ -53,23 +51,19 @@ jobs: uses: actions/setup-go@v3 with: go-version: '1.18' - id: go - name: Check out code into the Go module directory uses: actions/checkout@v3 - name: Get dependencies - run: | - go mod download + run: go mod download - name: TF acceptance tests timeout-minutes: 10 env: TF_ACC: "1" TF_ACC_TERRAFORM_VERSION: ${{ matrix.terraform }} - - run: | - go test -v -cover ./... + run: go test -v -cover ./... all-tests-passed: name: All Tests Passed diff --git a/.mergify.yml b/.mergify.yml index 6ba8e0b8..107d6452 100644 --- a/.mergify.yml +++ b/.mergify.yml @@ -5,3 +5,11 @@ pull_request_rules: actions: merge: method: squash + - name: automatic approval for bpg's pull requests + conditions: + - author=bpg + - label=autoapprove + actions: + review: + type: APPROVE + message: "Auto-approved! :robot:"