-
Notifications
You must be signed in to change notification settings - Fork 15
51 lines (47 loc) · 1.73 KB
/
admin-create-aco-test-integration.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
name: Admin Create ACO Integration Tests
on:
pull_request:
paths:
- .github/workflows/admin-create-aco-test-integration.yml
- .github/workflows/admin-create-aco-dev-deploy.yml
- .github/workflows/admin-create-aco-test-deploy.yml
- .github/workflows/admin-create-aco-prod-deploy.yml
- bcda/lambda/admin_create_aco/**
workflow_dispatch:
# Ensure we have only one integration test running at a time
concurrency:
group: admin-create-aco-integration-test
jobs:
# Deploy first if triggered by pull_request
deploy:
if: ${{ github.event_name == 'pull_request' }}
uses: ./.github/workflows/admin-create-aco-dev-deploy.yml
secrets: inherit
trigger:
if: ${{ always() }}
needs: deploy
permissions:
contents: read
id-token: write
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./bcda/lambda/admin_create_aco
outputs:
start_time: ${{ steps.invoke-lambda.outputs.STARTTIME }}
steps:
- uses: actions/checkout@v4
- uses: aws-actions/configure-aws-credentials@v4
with:
aws-region: ${{ vars.AWS_REGION }}
role-to-assume: arn:aws:iam::${{ secrets.ACCOUNT_ID }}:role/delegatedadmin/developer/bcda-dev-github-actions
- name: Send event to trigger lambda function
id: invoke-lambda
run: |
echo "STARTTIME=`date +%s`" >> "$GITHUB_OUTPUT"
aws lambda invoke --function-name bcda-dev-admin-create-aco \
--cli-binary-format raw-in-base64-out \
--payload '{"name":"Test ACO","cms_id":"testcms"}' test-result.txt
- name: Verify result
run: |
if grep -q "errorType" test-result.txt; then cat test-result.txt; exit 1; else echo "Success"; fi