Merge branch 'MyPureCloud:dev' into dev #2
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: Go Checks | |
on: | |
push: | |
paths-ignore: | |
- 'README.md' | |
jobs: | |
go-checks: | |
name: Go Checks | |
runs-on: ubuntu-latest | |
timeout-minutes: 5 | |
steps: | |
- name: Set up Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: '1.23' | |
id: go | |
- name: Setup Terraform CLI | |
uses: hashicorp/[email protected] | |
with: | |
terraform_wrapper: false | |
terraform_version: ${{ matrix.terraform }} | |
- name: Check out code into the Go module directory | |
uses: actions/checkout@v4 | |
- name: Get dependencies | |
run: | | |
go mod download | |
- name: Generate | |
run: | | |
go generate | |
if [[ -n $(git status -s) ]]; then | |
echo "There are untracked documentation changes:\n" | |
git status | |
exit 1 | |
fi | |
- name: Tidy | |
run: | | |
go mod tidy | |
if [[ -n $(git status -s) ]]; then | |
echo "go mod tidy produced changes:\n" | |
git status | |
exit 1 | |
fi | |
- name: Fmt | |
run: | | |
go fmt ./genesyscloud/... | |
if [[ -n $(git status -s) ]]; then | |
echo "go fmt produced changes:\n" | |
git status | |
echo "Please run 'go fmt ./genesyscloud/...' with go version 1.20 and commit these changes." | |
exit 1 | |
fi | |
- name: Vet | |
run: | | |
if [[ -n $(go vet ./genesyscloud/... 2>&1) ]]; then | |
echo "go vet highlighted the following:\n" | |
go vet ./genesyscloud/... | |
exit 1 | |
fi |