Skip to content

Test Go Atlas Workflow #2

Test Go Atlas Workflow

Test Go Atlas Workflow #2

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 ./...