From 17a8720ab84e45dabc7f850126454b0328cf4c2c Mon Sep 17 00:00:00 2001 From: Nir Date: Tue, 27 Jul 2021 15:03:05 +0200 Subject: [PATCH] more goreleaser updates --- .github/workflows/test.yml | 84 +++++++++++++++++++++++++++++++++----- .goreleaser.yml | 9 ++-- 2 files changed, 79 insertions(+), 14 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 4fb2e0a..af3aa21 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,17 +1,79 @@ -name: test -on: push +name: Tests +on: + pull_request: + paths-ignore: + - 'README.md' + push: + paths-ignore: + - 'README.md' + # For systems with an upstream API that could drift unexpectedly (like most SaaS systems, etc.), + # we recommend testing at a regular interval not necessarily tied to code changes. This will + # ensure you are alerted to something breaking due to an API change, even if the code did not + # change. + # schedule: + # - cron: '0 13 * * *' jobs: + # ensure the code builds... + build: + name: Build + runs-on: ubuntu-latest + timeout-minutes: 5 + steps: + + - name: Set up Go + uses: actions/setup-go@v2.1.3 + with: + go-version: '1.15' + id: go + + - name: Check out code into the Go module directory + uses: actions/checkout@v2.3.4 + + - name: Get dependencies + run: | + go mod download + - name: Build + run: | + go build -v . + # run acceptance tests in a matrix with Terraform core versions test: + name: Matrix Test + needs: build runs-on: ubuntu-latest + timeout-minutes: 15 strategy: + fail-fast: false matrix: - go: ["1.14", "1.15"] + # list whatever Terraform versions here you would like to support + terraform: + - '0.12.29' + - '0.13.4' + - '0.14.0-beta2' steps: - - name: Checkout - uses: actions/checkout@v2 - - name: Set up Go ${{ matrix.go }} - uses: actions/setup-go@v2 - with: - go-version: ${{ matrix.go }} - - name: Test - run: make test build + + - name: Set up Go + uses: actions/setup-go@v2.1.3 + with: + go-version: '1.15' + id: go + + - name: Check out code into the Go module directory + uses: actions/checkout@v2.3.4 + + - name: Get dependencies + run: | + go mod download + + - name: TF acceptance tests + timeout-minutes: 10 + env: + TF_ACC: "1" + TF_ACC_TERRAFORM_VERSION: ${{ matrix.terraform }} + + # Set whatever additional acceptance test env vars here. You can + # optionally use data from your repository secrets using the + # following syntax: + # SOME_VAR: ${{ secrets.SOME_VAR }} + + run: | + go test -v -cover ./internal/provider/ \ No newline at end of file diff --git a/.goreleaser.yml b/.goreleaser.yml index 4bf3e99..468e3a2 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -1,5 +1,3 @@ -# Visit https://goreleaser.com for documentation on how to customize this -# behavior. before: hooks: # this is just an example and not a requirement for provider building/publishing @@ -38,7 +36,7 @@ checksum: signs: - artifacts: checksum args: - # if you are using this is a GitHub action or some other automated pipeline, you + # if you are using this in a GitHub action or some other automated pipeline, you # need to pass the batch flag to indicate its not interactive. - "--batch" - "--local-user" @@ -47,3 +45,8 @@ signs: - "${signature}" - "--detach-sign" - "${artifact}" +release: + # If you want to manually examine the release before its live, uncomment this line: + # draft: true +changelog: + skip: true \ No newline at end of file