Bump mongodb/atlas-github-action from 0.2.1 to 0.2.2 (#29) #121
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 AtlasCLI Action | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| workflow_dispatch: | |
| env: | |
| MONGODB_ATLAS_PUBLIC_API_KEY: ${{ secrets.PUBLIC_API_KEY }} | |
| MONGODB_ATLAS_PRIVATE_API_KEY: ${{ secrets.PRIVATE_API_KEY }} | |
| MONGODB_ATLAS_ORG_ID: ${{ secrets.ORG_ID }} | |
| MONGODB_ATLAS_PROJECT_ID: ${{ secrets.PROJECT_ID }} | |
| MONGODB_ATLAS_OPS_MANAGER_URL: ${{ vars.CLOUD_DEV_URL }} | |
| MONGODB_ATLAS_SILENCE_STORAGE_WARNING: "true" | |
| jobs: | |
| no-version: | |
| name: Use AtlasCLI without version input | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v5 | |
| - name: Setup AtlasCLI without version input | |
| uses: ./ | |
| - name: Use AtlasCLI | |
| shell: bash | |
| run: atlas --help | |
| input-version: | |
| name: Use AtlasCLI with version input | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v5 | |
| - name: Setup AtlasCLI with version input | |
| uses: ./ | |
| with: | |
| version: v1.9.0 | |
| - name: Use AtlasCLI | |
| shell: bash | |
| run: atlas --help | |
| create-delete-project: | |
| name: Create and delete project | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v5 | |
| - name: Setup AtlasCLI and create a project | |
| id: create-project | |
| uses: ./ | |
| with: | |
| create-project-name: ${{ github.run_id }}-project1 | |
| - name: delete project | |
| uses: ./ | |
| with: | |
| delete-project-id: ${{ steps.create-project.outputs.create-project-id }} | |
| create-delete-cluster: | |
| name: Create and delete cluster | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v5 | |
| - name: Setup AtlasCLI and create a project | |
| id: create-project | |
| uses: ./ | |
| with: | |
| create-project-name: ${{github.run_id}}-project2 | |
| - name: Create cluster | |
| id: create-cluster | |
| uses: ./ | |
| with: | |
| create-cluster-name: test-cluster | |
| project-id: ${{ steps.create-project.outputs.create-project-id }} | |
| - name: Delete cluster and project | |
| uses: ./ | |
| with: | |
| delete-cluster-name: test-cluster | |
| delete-project-id: ${{ steps.create-project.outputs.create-project-id }} | |
| setup: | |
| name: Setup and teardown afterwards | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v5 | |
| - name: Setup AtlasCLI and create a project | |
| id: create-project | |
| uses: ./ | |
| with: | |
| create-project-name: ${{github.run_id}}-test-setup-project | |
| - name: Setup | |
| id: setup | |
| uses: ./ | |
| with: | |
| run-setup: true | |
| project-id: ${{ steps.create-project.outputs.create-project-id }} | |
| cluster-name: ${{github.run_id}}-cluster | |
| username: ${{ secrets.CLUSTER_USERNAME }} | |
| password: ${{ secrets.CLUSTER_PASSWORD }} | |
| - name: Retrieve Connection String | |
| shell: bash | |
| run: | | |
| echo "${{ steps.setup.outputs.connection-string }}" | |
| - name: Teardown | |
| uses: ./ | |
| with: | |
| delete-project-id: ${{ steps.create-project.outputs.create-project-id }} | |
| delete-cluster-name: ${{github.run_id}}-cluster | |
| service-account-authentication: | |
| name: Setup a Service Account and create a project | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v5 | |
| - name: Create a Service Account and get client ID and client secret | |
| id: generate_sa | |
| run: | | |
| bash build/generate-service-account.sh | |
| - name: Create a project | |
| env: | |
| MONGODB_ATLAS_PUBLIC_API_KEY: "" # Temporarily set to empty so that the action uses the client ID and client secret | |
| MONGODB_ATLAS_PRIVATE_API_KEY: "" | |
| MONGODB_ATLAS_CLIENT_ID: ${{ steps.generate_sa.outputs.client-id }} | |
| MONGODB_ATLAS_CLIENT_SECRET: ${{ steps.generate_sa.outputs.client-secret }} | |
| uses: mongodb/[email protected] | |
| id: create-project | |
| with: | |
| create-project-name: ${{ github.run_id }}-project3 | |
| - name: Delete a project | |
| env: | |
| MONGODB_ATLAS_PUBLIC_API_KEY: "" | |
| MONGODB_ATLAS_PRIVATE_API_KEY: "" | |
| MONGODB_ATLAS_CLIENT_ID: ${{ steps.generate_sa.outputs.client-id }} | |
| MONGODB_ATLAS_CLIENT_SECRET: ${{ steps.generate_sa.outputs.client-secret }} | |
| uses: mongodb/[email protected] | |
| with: | |
| delete-project-id: ${{ steps.create-project.outputs.create-project-id }} | |
| - name: Delete the Service Account | |
| env: | |
| CLIENT_ID: ${{ steps.generate_sa.outputs.client-id }} | |
| run: | | |
| bash build/terminate-service-account.sh |