Skip to content

Merge pull request #30 from ovh/fix-goreleaser #104

Merge pull request #30 from ovh/fix-goreleaser

Merge pull request #30 from ovh/fix-goreleaser #104

Workflow file for this run

name: Tests
on:
pull_request:
paths-ignore:
- 'README.md'
push:
paths-ignore:
- 'README.md'
jobs:
build:
name: Build
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version-file: 'go.mod'
cache: true
id: go
- name: Get dependencies
run: |
go mod download
- name: Build
run: |
go build -v .
generate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version-file: 'go.mod'
cache: true
- run: go generate ./...
- name: git diff
run: |
git diff --compact-summary --exit-code || \
(echo; echo "Unexpected difference in directories after code generation. Run 'go generate ./...' command and commit."; exit 1)
# 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:
# list whatever Terraform versions here you would like to support
# As a best practice, HashiCorp expects customers to stay current
# within two (2) releases from the latest major release in order to
# receive optimal support. Release updates for Customers are provided
# regularly on HashiCorp product pages for each HashiCorp product.
# See: https://support.hashicorp.com/hc/en-us/articles/360021185113
terraform:
- '1.3.*'
- '1.4.*'
# We will support the 3 last minor versions as Grafana honor 2 versions
# before dropping a deprecated flag
mimir:
- '2.5.0'
- '2.6.0'
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version-file: 'go.mod'
cache: true
id: go
- uses: hashicorp/setup-terraform@v2
with:
terraform_version: ${{ matrix.terraform }}
terraform_wrapper: false
- name: Get dependencies
run: |
go mod download
# Not using `services` as they do not allow us to configure mimir and we
# don't want to build/maintain our own image just for that.
# The makefile will take care of spawning a mimir instance.
- name: TF acceptance tests
timeout-minutes: 10
env:
TF_ACC: "1"
MIMIRTOOL_ADDRESS: "http://localhost:8080"
run: |
MIMIR_VERSION=${{ matrix.mimir }} make testacc