From 9182257c5a58298d51f04ddd5c13eab44ef5bd55 Mon Sep 17 00:00:00 2001 From: Flo Date: Sat, 30 Mar 2024 16:49:32 +0100 Subject: [PATCH 1/3] =?UTF-8?q?=F0=9F=91=B7=20Set=20up=20CI=20for=20pull?= =?UTF-8?q?=20requests?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/pull-request.yaml | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 .github/workflows/pull-request.yaml diff --git a/.github/workflows/pull-request.yaml b/.github/workflows/pull-request.yaml new file mode 100644 index 0000000..ea4923b --- /dev/null +++ b/.github/workflows/pull-request.yaml @@ -0,0 +1,29 @@ +name: Pull request + +on: + pull_request: + branches: + - main + +jobs: + test: + name: 🧪 Run tests + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version-file: "go.mod" + + - name: Build provider + run: make provider + + - name: Build mbtf + run: make mbtf + + - name: Run tests + run: make testacc-with-setup From 7645a220d07778f3c3290e6373e645e1667dda7d Mon Sep 17 00:00:00 2001 From: Flo Date: Sat, 30 Mar 2024 17:23:18 +0100 Subject: [PATCH 2/3] =?UTF-8?q?=F0=9F=94=A8=20Fix=20Makefile=20variable=20?= =?UTF-8?q?definition=20that=20should=20be=20evaluated=20immediately?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Makefile | 30 ++++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index 02da4b4..64cafb4 100644 --- a/Makefile +++ b/Makefile @@ -1,14 +1,28 @@ .EXPORT_ALL_VARIABLES: .PHONY: set-up-docker tear-down-docker testacc testacc-with-setup clean-testacc provider clean generate -METABASE_USERNAME?=terraform-provider@tests.com -METABASE_PASSWORD?=$(shell uuidgen) -METABASE_URL?=http://localhost:3000/api - -PG_HOST?=terraform-metabase-pg -PG_USER?=metabase -PG_PASSWORD?=$(shell uuidgen) -PG_DATABASE?=metabase +ifndef METABASE_USERNAME +METABASE_USERNAME:=terraform-provider@tests.com +endif +ifndef METABASE_PASSWORD +METABASE_PASSWORD:=$(shell uuidgen) +endif +ifndef METABASE_URL +METABASE_URL:=http://localhost:3000/api +endif + +ifndef PG_HOST +PG_HOST:=terraform-metabase-pg +endif +ifndef PG_USER +PG_USER:=metabase +endif +ifndef PG_PASSWORD +PG_PASSWORD:=$(shell uuidgen) +endif +ifndef PG_DATABASE +PG_DATABASE:=metabase +endif MBTF_FOLDER:=cmd/mbtf From 33e704c93b2a7bc8bb8e8859bcae0058083b8344 Mon Sep 17 00:00:00 2001 From: Flo Date: Sat, 30 Mar 2024 17:30:27 +0100 Subject: [PATCH 3/3] =?UTF-8?q?=F0=9F=91=B7=20Update=20actions=20in=20rele?= =?UTF-8?q?ase=20workflow?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/release.yml | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f87e98e..f9f034f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,7 +1,5 @@ -# Terraform Provider release workflow. name: Release -# This GitHub action creates a release when a tag that matches the pattern "v*" (e.g. v0.1.0) is created. on: push: tags: @@ -14,27 +12,30 @@ permissions: jobs: goreleaser: + name: 📦 Release runs-on: ubuntu-latest + steps: - - uses: actions/checkout@v3 + - name: Checkout + uses: actions/checkout@v4 with: # Allow goreleaser to access older tag information. fetch-depth: 0 - - uses: actions/setup-go@v3 + - name: Set up Go + uses: actions/setup-go@v5 with: go-version-file: "go.mod" - cache: true - name: Import GPG key - uses: crazy-max/ghaction-import-gpg@v5 + uses: crazy-max/ghaction-import-gpg@v6 id: import_gpg with: gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} passphrase: ${{ secrets.PASSPHRASE }} - name: Run GoReleaser - uses: goreleaser/goreleaser-action@v4 + uses: goreleaser/goreleaser-action@v5 with: args: release --rm-dist env: