Skip to content

Commit 0972221

Browse files
Add workflow for cfn test
1 parent 8479e75 commit 0972221

1 file changed

Lines changed: 44 additions & 0 deletions

File tree

.github/workflows/contract-testing.yaml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ jobs:
3030
search-deployment: ${{ steps.filter.outputs.search-deployment }}
3131
stream-connection: ${{ steps.filter.outputs.stream-connection }}
3232
stream-instance: ${{ steps.filter.outputs.stream-instance }}
33+
stream-workspace: ${{ steps.filter.outputs.stream-workspace }}
3334
steps:
3435
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8
3536
if: ${{ github.event_name == 'push' }}
@@ -75,6 +76,8 @@ jobs:
7576
- 'cfn-resources/stream-connection/**'
7677
stream-instance:
7778
- 'cfn-resources/stream-instance/**'
79+
stream-workspace:
80+
- 'cfn-resources/stream-workspace/**'
7881
access-list-api-key:
7982
needs: change-detection
8083
if: ${{ needs.change-detection.outputs.access-list-api-key == 'true' }}
@@ -854,3 +857,44 @@ jobs:
854857
cat inputs/inputs_1_create.json
855858
make run-contract-testing
856859
make delete-test-resources
860+
stream-workspace:
861+
needs: change-detection
862+
if: ${{ needs.change-detection.outputs.stream-workspace == 'true' }}
863+
runs-on: ubuntu-latest
864+
steps:
865+
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8
866+
- uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c
867+
with:
868+
go-version-file: 'cfn-resources/go.mod'
869+
- name: setup Atlas CLI
870+
uses: mongodb/atlas-github-action@e3c9e0204659bafbb3b65e1eb1ee745cca0e9f3b
871+
- uses: aws-actions/setup-sam@c2a20b1822cc4a6bc594ff7f1dbb658758e383c3
872+
with:
873+
use-installer: true
874+
- uses: aws-actions/configure-aws-credentials@61815dcd50bd041e203e49132bacad1fd04d2708
875+
with:
876+
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID_TEST_ENV }}
877+
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY_TEST_ENV }}
878+
aws-region: eu-west-1
879+
- uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548
880+
with:
881+
python-version: '3.9'
882+
cache: 'pip' # caching pip dependencies
883+
- run: pip install cloudformation-cli cloudformation-cli-go-plugin
884+
- name: Run the Contract test
885+
shell: bash
886+
env:
887+
MONGODB_ATLAS_PUBLIC_API_KEY: ${{ secrets.CLOUD_DEV_PUBLIC_KEY }}
888+
MONGODB_ATLAS_PRIVATE_API_KEY: ${{ secrets.CLOUD_DEV_PRIVATE_KEY }}
889+
MONGODB_ATLAS_ORG_ID: ${{ secrets.CLOUD_DEV_ORG_ID }}
890+
MONGODB_ATLAS_OPS_MANAGER_URL: ${{ vars.MONGODB_ATLAS_BASE_URL }}
891+
MONGODB_ATLAS_PROFILE: cfn-cloud-dev-github-action
892+
run: |
893+
cd cfn-resources/stream-workspace
894+
make create-test-resources
895+
896+
cat inputs/inputs_1_create.json
897+
cat inputs/inputs_1_update.json
898+
899+
make run-contract-testing
900+
make delete-test-resources

0 commit comments

Comments
 (0)