2222 type : choice
2323 options :
2424 - ubuntu-latest
25- - macos-latest
25+ - macos-13
2626
2727
2828jobs :
29- run-it-tests-job :
29+ run-terraform-deployment :
30+ name : Run Terraform Deployment
3031 runs-on : ${{ inputs.runner-os || 'ubuntu-latest' }}
3132 steps :
3233 - name : Checkout
33- uses : actions/checkout@v2
34+ uses : actions/checkout@v4
35+
36+ - name : Set up Python 3.11
37+ id : setup-python
38+ uses : actions/setup-python@v2
39+ with :
40+ python-version : 3.11
41+
42+ - name : Install Terraform
43+ uses : hashicorp/setup-terraform@v3
44+
45+ - name : Install Terraform Local
46+ run : |
47+ pip install --upgrade terraform-local
48+
49+ - name : Set up Project
50+ run : |
51+ pip install -r requirements-dev.txt
52+
53+ - name : Start LocalStack
54+ uses :
LocalStack/[email protected] 55+ with :
56+ image-tag : ' latest'
57+ use-pro : ' true'
58+ configuration : LS_LOG=trace
59+ install-awslocal : ' true'
60+ env :
61+ LOCALSTACK_AUTH_TOKEN : ${{ secrets.LOCALSTACK_AUTH_TOKEN }}
62+
63+ - name : Build lambdas
64+ run : |
65+ bin/build_lambdas.sh
66+
67+ - name : Deploy infrastructure
68+ run : |
69+ cd deployment/terraform
70+ tflocal init
71+ tflocal apply --auto-approve
72+
73+ - name : Show localstack logs
74+ if : always()
75+ run : |
76+ localstack logs
77+
78+ - name : Send a Slack notification
79+ if : failure() || github.event_name != 'pull_request'
80+ uses : ravsamhq/notify-slack-action@v2
81+ with :
82+ status : ${{ job.status }}
83+ token : ${{ secrets.GITHUB_TOKEN }}
84+ notification_title : " {workflow} has {status_message}"
85+ message_format : " {emoji} *{workflow}* {status_message} in <{repo_url}|{repo}>"
86+ footer : " Linked Repo <{repo_url}|{repo}> | <{run_url}|View Workflow run>"
87+ notify_when : " failure"
88+ env :
89+ SLACK_WEBHOOK_URL : ${{ secrets.SLACK_WEBHOOK_URL }}
90+
91+ - name : Generate a Diagnostic Report
92+ if : failure()
93+ run : |
94+ curl -s localhost:4566/_localstack/diagnose | gzip -cf > diagnose.json.gz
95+
96+ - name : Upload the Diagnostic Report
97+ if : failure()
98+ uses : actions/upload-artifact@v4
99+ with :
100+ name : diagnose.json.gz
101+ path : ./diagnose.json.gz
102+
103+ run-integration-tests-job :
104+ name : Run Integration Tests
105+ runs-on : ${{ inputs.runner-os || 'ubuntu-latest' }}
106+ steps :
107+ - name : Checkout
108+ uses : actions/checkout@v4
34109
35110 - name : Set up Python 3.11
36111 id : setup-python
39114 python-version : 3.11
40115
41116 - name : Docker setup (macos only)
42- id : setup-docker-mac
43117 if : ${{ runner.os == 'macOS' }}
44118 run : |
119+ brew install colima
45120 brew install docker
46121 colima start
47122
@@ -50,18 +125,22 @@ jobs:
50125 pip install -r requirements-dev.txt
51126
52127 - name : Start LocalStack
53- uses : LocalStack/setup-localstack@main
128+ uses : LocalStack/setup-localstack@v0.2.4
54129 with :
55130 image-tag : ' latest'
56131 use-pro : ' true'
57132 configuration : LS_LOG=trace
58133 install-awslocal : ' true'
59134 env :
60- LOCALSTACK_API_KEY : ${{ secrets.LOCALSTACK_API_KEY }}
135+ LOCALSTACK_AUTH_TOKEN : ${{ secrets.LOCALSTACK_AUTH_TOKEN }}
136+
137+ - name : Build lambdas
138+ run : |
139+ bin/build_lambdas.sh
61140
62141 - name : Deploy infrastructure
63142 run : |
64- bin /deploy.sh
143+ deployment/awslocal /deploy.sh
65144
66145 - name : Run Tests
67146 env :
97176
98177 - name : Upload the Diagnostic Report
99178 if : failure()
100- uses : actions/upload-artifact@v3
179+ uses : actions/upload-artifact@v4
101180 with :
102181 name : diagnose.json.gz
103182 path : ./diagnose.json.gz
0 commit comments