Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

πŸ‘· Set up CI for pull requests #42

Merged
merged 3 commits into from
Mar 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions .github/workflows/pull-request.yaml
Original file line number Diff line number Diff line change
@@ -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
15 changes: 8 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -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:
Expand All @@ -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:
Expand Down
30 changes: 22 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,14 +1,28 @@
.EXPORT_ALL_VARIABLES:
.PHONY: set-up-docker tear-down-docker testacc testacc-with-setup clean-testacc provider clean generate

[email protected]
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:[email protected]
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

Expand Down