DOCSP-46228: Add Scaling example script to Go SDK project #47
Workflow file for this run
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: Test Atlas Go SDK Code Examples | |
| on: | |
| pull_request_target: | |
| types: [opened, synchronize, reopened] | |
| paths: | |
| - "usage-examples/go/atlas-sdk-go/**" | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| # IMPORTANT: Update PROJECT_PATH variable when project structure changes | |
| # in addition to changing it in the static `paths` in ln 7 above | |
| env: | |
| PROJECT_PATH: "usage-examples/go/atlas-sdk-go/" | |
| steps: | |
| - name: Check access | |
| if: ${{ github.event.pull_request.author_association != 'COLLABORATOR' }} | |
| run: | | |
| echo "Event not triggered by a collaborator." | |
| exit 1 | |
| - uses: actions/checkout@v4 | |
| with: | |
| ref: ${{ github.event.pull_request.head.sha }} | |
| - name: Setup Go version based on go.mod version | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version-file: '${{ env.PROJECT_PATH }}go.mod' | |
| - name: Install dependencies | |
| run: | | |
| cd ${{ env.PROJECT_PATH }} | |
| go mod download | |
| - name: Run tests | |
| run: | | |
| cd ${{ env.PROJECT_PATH }} | |
| # NOTE: Test runner supports parallel processing. Code order determines | |
| # sequence of tests, but parallel-enabled tests will run concurrently. | |
| go test -v ./internal/... |