Skip to content

Commit 3a1d514

Browse files
authored
ci: add a smoke test to validate infra setup (#3)
1 parent ad064c3 commit 3a1d514

File tree

1 file changed

+32
-7
lines changed

1 file changed

+32
-7
lines changed

.github/workflows/main.yml

Lines changed: 32 additions & 7 deletions
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
smoke-test:
@@ -48,9 +52,9 @@ jobs:
4852
docker pull localstack/localstack-pro:latest
4953
# Start LocalStack in the background
5054
if [ "mysql" == ${MYSQL_FEATURE_FLAG} ]; then
51-
DEBUG=1 RDS_MYSQL_DOCKER=1 localstack start -d
55+
LS_LOG=trace RDS_MYSQL_DOCKER=1 localstack start -d
5256
else
53-
DEBUG=1 localstack start -d
57+
LS_LOG=trace localstack start -d
5458
fi
5559
# Wait 30 seconds for the LocalStack container to become ready before timing out
5660
echo "Waiting for LocalStack startup..."
@@ -67,11 +71,6 @@ jobs:
6771
make bootstrap
6872
make deploy
6973
70-
- name: Show Logs
71-
if: failure()
72-
run: |
73-
localstack logs
74-
7574
- name: Smoke Test
7675
run: |
7776
awslocal --version
@@ -87,7 +86,33 @@ jobs:
8786
cat output
8887
exit 1
8988
fi
89+
9090
- name: Show Logs
9191
if: always()
9292
run: |
9393
localstack logs
94+
95+
- name: Send a Slack notification
96+
if: failure() || github.event_name != 'pull_request'
97+
uses: ravsamhq/notify-slack-action@v2
98+
with:
99+
status: ${{ job.status }}
100+
token: ${{ secrets.GITHUB_TOKEN }}
101+
notification_title: "{workflow} has {status_message}"
102+
message_format: "{emoji} *{workflow}* {status_message} in <{repo_url}|{repo}>"
103+
footer: "Linked Repo <{repo_url}|{repo}> | <{run_url}|View Workflow run>"
104+
notify_when: "failure"
105+
env:
106+
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
107+
108+
- name: Generate a Diagnostic Report
109+
if: failure()
110+
run: |
111+
curl -s localhost:4566/_localstack/diagnose | gzip -cf > diagnose.json.gz
112+
113+
- name: Upload the Diagnostic Report
114+
if: failure()
115+
uses: actions/upload-artifact@v3
116+
with:
117+
name: diagnose.json.gz
118+
path: ./diagnose.json.gz

0 commit comments

Comments
 (0)