Skip to content

Merge pull request #95 from uptime-com/givi-inconsistent-result-after… #246

Merge pull request #95 from uptime-com/givi-inconsistent-result-after…

Merge pull request #95 from uptime-com/givi-inconsistent-result-after… #246

Workflow file for this run

name: default
on:
push:
concurrency:
group: default
cancel-in-progress: false
permissions:
contents: write
jobs:
validate:
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version-file: go.mod
cache: true
- name: Format code
run: go fmt ./...
- name: Generate docs
run: go run github.com/hashicorp/terraform-plugin-docs/cmd/tfplugindocs@v0.13
- name: Check if any files have changed
run: test -z "$(git status --porcelain)" || ( git diff && exit 1 )
test:
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version-file: go.mod
cache: true
- name: Run unit tests
run: go test -v ./...
- name: Run acceptance tests
env:
TF_ACC: 'yup'
UPTIME_TOKEN: '${{ secrets.UPTIME_TOKEN }}'
run: go test -v ./... -run ^TestAcc[A-Z]
release:
if: startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-22.04
needs:
- validate
- test
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0 # history is required for goreleaser to work
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version-file: go.mod
cache: true
- name: Import GPG key
uses: crazy-max/ghaction-import-gpg@v5
id: import_gpg
with:
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v6
with:
args: release --clean
version: "~> v2"
env:
GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}