run_tests #38
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: run_tests | |
on: | |
workflow_dispatch: | |
branches: [ "dev" ] | |
environment: | |
name: 'Dev' | |
jobs: | |
run_tests: | |
runs-on: ubuntu-latest | |
permissions: | |
# Give the default GITHUB_TOKEN write permission to commit and push the | |
# added or changed files to the repository. | |
contents: write | |
steps: | |
- | |
name: Checkout | |
uses: actions/checkout@v4 | |
- | |
name: Unshallow | |
run: git fetch --prune --unshallow | |
- | |
name: Set up Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: 1.22 | |
- | |
name: Run Go Mod Tidy | |
run: go mod tidy | |
- | |
name: Test | |
run: go test ./banyan/... -v | |
env: | |
TF_ACC: true | |
BANYAN_API_KEY: ${{ secrets.BANYAN_API_KEY }} | |
BANYAN_HOST: ${{ secrets.BANYAN_HOST }} | |
- | |
name: Generate Documentation | |
run: go run github.com/hashicorp/terraform-plugin-docs/cmd/tfplugindocs generate --provider-name terraform-provider-banyan --examples-dir ./examples/ | |
- | |
name: Check if Documentation changes are required | |
run: | | |
if [[ $(if [[ -n "$(git status --porcelain)" ]]; then echo "true"; else echo "false"; fi) == "true" ]]; then | |
echo "\n ERROR: Documentation changes are required, please update documentation to reflect the changes." | |
exit 1 | |
else | |
echo "\n++No Changes to Documentation++\n" | |
fi | |
- | |
name: Static Check | |
uses: dominikh/staticcheck-action@v1.3.1 | |
with: | |
version: "latest" |