-
Notifications
You must be signed in to change notification settings - Fork 5
109 lines (104 loc) · 3.13 KB
/
test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
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 }}
jobs:
no-version:
name: Use AtlasCLI without version input
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- 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@v4
- 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@v4
- 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@v4
- 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@v4
- 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