Merge pull request #14 from appwrite/CLO-4192-move-to-go-sdk-v3 #50
This file contains hidden or 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: CI | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| jobs: | |
| build: | |
| name: Build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-go@v5 | |
| with: | |
| go-version-file: go.mod | |
| cache: true | |
| - name: Build | |
| run: go build -o terraform-provider-appwrite . | |
| lint: | |
| name: Lint | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-go@v5 | |
| with: | |
| go-version-file: go.mod | |
| cache: true | |
| - name: Go vet | |
| run: go vet ./... | |
| - name: Check formatting | |
| run: | | |
| gofmt_output=$(gofmt -l .) | |
| if [ -n "$gofmt_output" ]; then | |
| echo "Files not formatted:" | |
| echo "$gofmt_output" | |
| exit 1 | |
| fi | |
| unit-test: | |
| name: Unit Tests | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-go@v5 | |
| with: | |
| go-version-file: go.mod | |
| cache: true | |
| - name: Run unit tests | |
| run: go test ./... -v -count=1 | |
| docs: | |
| name: Docs Up To Date | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-go@v5 | |
| with: | |
| go-version-file: go.mod | |
| cache: true | |
| - uses: hashicorp/setup-terraform@v3 | |
| with: | |
| terraform_wrapper: false | |
| - name: Generate docs | |
| run: make docs | |
| - name: Check for uncommitted changes | |
| run: | | |
| if [ -n "$(git diff --name-only)" ]; then | |
| echo "Documentation is out of date. Run 'make docs' and commit the changes." | |
| echo "" | |
| echo "Changed files:" | |
| git diff --name-only | |
| exit 1 | |
| fi |