Test Go Atlas Workflow #2
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 Go Code Examples against Atlas | |
| on: | |
| pull_request_target: | |
| types: [opened, synchronize] | |
| paths: | |
| - "go/examples/**" | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| 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 1.21.x | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: '1.23.x' | |
| - name: Install dependencies | |
| run: | | |
| cd go/ | |
| go mod download | |
| - name: Create environment file with connection string | |
| run: | | |
| cd go/ | |
| echo "ATLAS_CONNECTION_STRING=\"${{secrets.GO_CONNECTION_STRING}}\"" >> .env | |
| echo "ENV=\"Atlas\"" >> .env | |
| - name: Run tests | |
| run: | | |
| cd go/tests/ | |
| go test -v -p 1 ./... |