Skip to content

(DOCSP-49280): Add Atlas Go SDK test workflow #52

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 33 additions & 14 deletions .github/workflows/test-go-sdk.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,33 @@
# name: CI
# on: [push, pull_request]
# jobs:
# test:
# runs-on: ubuntu-latest
# steps:
# - name: Checkout code
# uses: actions/checkout@v4
# - name: Set up Go
# uses: actions/setup-go@v5
# with:
# go-version-file: go.mod
# - name: Test
# run: go test
name: Test Atlas Go SDK Code Examples

on:
pull_request_target:
types: [opened, synchronize]
paths:
- "usage-examples/go/atlas-sdk-go/**"

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 version based on go.mod version
uses: actions/setup-go@v5
with:
go-version-file: 'usage-examples/go/atlas-sdk-go/go.mod'
- name: Install dependencies
run: |
cd go/
go mod download
- name: Run tests
run: |
cd usage-examples/go/atlas-sdk-go/
go test -v -p 1 ./internal/...