Apply GitHub workflow changes #105
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: Tests | |
on: | |
pull_request: | |
branches: [ main ] | |
paths-ignore: | |
- 'README.md' | |
- 'CHANGELOG.md' | |
- 'website/*' | |
push: | |
branches: [ main ] | |
paths-ignore: | |
- 'README.md' | |
- 'CHANGELOG.md' | |
- 'website/*' | |
jobs: | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
timeout-minutes: 5 | |
steps: | |
- name: Check out code into the Go module directory | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
- name: Set up Go | |
uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed # v5.1.0 | |
with: | |
go-version-file: 'go.mod' | |
id: go | |
- name: Run linters | |
uses: golangci/golangci-lint-action@971e284b6050e8a5849b72094c50ab08da042db8 # v6.1.1 | |
with: | |
version: latest | |
# We need the latest version of Terraform for our documentation generation to use | |
- name: Set up Terraform | |
uses: hashicorp/setup-terraform@b9cd54a3c349d3f38e8881555d616ced269862dd # v3.1.2 | |
with: | |
terraform_wrapper: false | |
- name: Generate | |
run: make generate | |
- name: Confirm no diff | |
run: | | |
git diff --compact-summary --exit-code || \ | |
(echo "*** Unexpected differences after code generation. Run 'make generate' and commit."; exit 1) | |
- name: Build | |
run: make build | |
test: | |
name: 'Acc. Tests (OS: ${{ matrix.os }} / TF: ${{ matrix.terraform }})' | |
needs: build | |
runs-on: ${{ matrix.os }} | |
timeout-minutes: 20 | |
strategy: | |
fail-fast: false | |
matrix: | |
os: | |
- ubuntu-latest | |
terraform: ${{ fromJSON(vars.TF_VERSIONS_PROTOCOL_V5) }} | |
steps: | |
- name: Add hosts entry | |
run: echo "127.0.0.1 ns.example.com" | sudo tee -a /etc/hosts | |
- name: Install krb5-user | |
run: sudo apt-get update && sudo apt-get install krb5-user | |
- name: Check out code | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
- name: Setup Go | |
uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed # v5.1.0 | |
with: | |
go-version-file: 'go.mod' | |
check-latest: true | |
- name: Setup Terraform ${{ matrix.terraform }} | |
uses: hashicorp/setup-terraform@b9cd54a3c349d3f38e8881555d616ced269862dd # v3.1.2 | |
with: | |
terraform_version: ${{ matrix.terraform }} | |
terraform_wrapper: false | |
- name: Run acceptance test | |
env: | |
TF_ACC: "1" | |
run: | | |
bash internal/provider/acceptance.sh |