Test Python Atlas Workflow #6
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 Python Code Examples against Atlas | |
| on: | |
| pull_request_target: | |
| types: [opened, synchronize] | |
| paths: | |
| - "python/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 Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.13' | |
| - name: Install dependencies | |
| run: | | |
| pip install pymongo python-dotenv | |
| - name: Create environment file with connection string | |
| run: | | |
| cd python/ | |
| touch .env | |
| echo "ATLAS_CONNECTION_STRING=\"${{secrets.PYTHON_CONNECTION_STRING}}\"" >> .env | |
| echo "ENV=\"Atlas\"" >> .env | |
| - name: Run tests | |
| run: | | |
| cd python/ | |
| python -m unittest discover tests_package |