Skip to content

Commit 26eaaf8

Browse files
authored
ci: add a smoke test to validate infra setup (#2)
1 parent b4ff161 commit 26eaaf8

File tree

1 file changed

+30
-1
lines changed

1 file changed

+30
-1
lines changed

.github/workflows/ci.yml

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ on:
99
pull_request:
1010
branches:
1111
- main
12+
schedule:
13+
# “At 00:00 on Sunday.”
14+
- cron: "0 0 * * 0"
15+
workflow_dispatch:
1216

1317
jobs:
1418
cdk:
@@ -44,7 +48,7 @@ jobs:
4448
pip install terraform-local
4549
docker pull localstack/localstack-pro:latest
4650
# Start LocalStack in the background
47-
LAMBDA_DOCKER_NETWORK=$NETWORK_NAME DOCKER_FLAGS="--network $NETWORK_NAME" DEBUG=1 localstack start -d
51+
LS_LOG=trace LAMBDA_DOCKER_NETWORK=$NETWORK_NAME DOCKER_FLAGS="--network $NETWORK_NAME" DEBUG=1 localstack start -d
4852
# Wait 30 seconds for the LocalStack container to become ready before timing out
4953
echo "Waiting for LocalStack startup..."
5054
localstack wait -t 15
@@ -62,3 +66,28 @@ jobs:
6266
run: |
6367
awslocal sqs list-queues
6468
awslocal dynamodb list-tables
69+
70+
- name: Send a Slack notification
71+
if: failure() || github.event_name != 'pull_request'
72+
uses: ravsamhq/notify-slack-action@v2
73+
with:
74+
status: ${{ job.status }}
75+
token: ${{ secrets.GITHUB_TOKEN }}
76+
notification_title: "{workflow} has {status_message}"
77+
message_format: "{emoji} *{workflow}* {status_message} in <{repo_url}|{repo}>"
78+
footer: "Linked Repo <{repo_url}|{repo}> | <{run_url}|View Workflow run>"
79+
notify_when: "failure"
80+
env:
81+
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
82+
83+
- name: Generate a Diagnostic Report
84+
if: failure()
85+
run: |
86+
curl -s localhost:4566/_localstack/diagnose | gzip -cf > diagnose.json.gz
87+
88+
- name: Upload the Diagnostic Report
89+
if: failure()
90+
uses: actions/upload-artifact@v3
91+
with:
92+
name: diagnose.json.gz
93+
path: ./diagnose.json.gz

0 commit comments

Comments
 (0)