Merge pull request #127 from uptime-com/givi-remove-host-validation-i… #334
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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/[email protected] | |
- 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 }}' | |
UPTIME_RATE_LIMIT: '0.15' | |
run: go test -test.timeout=50m -test.parallel=1 -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 }} |