@@ -20,12 +20,17 @@ jobs:
2020 runs-on : ubuntu-latest
2121 steps :
2222 - name : Checkout
23- uses : actions/checkout@v3
23+ uses : actions/checkout@v4
24+
25+ - name : Setup Node
26+ uses : actions/setup-node@v4
27+ with :
28+ node-version : ' 22'
2429
2530 - name : Setup Python
2631 uses : actions/setup-python@v4
2732 with :
28- python-version : ' 3.9 '
33+ python-version : ' 3.11 '
2934
3035 - name : Set up JDK
3136 uses : actions/setup-java@v2
@@ -36,40 +41,45 @@ jobs:
3641 - name : Set up Maven
3742 run : sudo apt-get install -y maven
3843
39- - name : Install localstack & awslocal
44+ - name : Start LocalStack
45+ uses :
LocalStack/[email protected] 46+ with :
47+ image-tag : ' latest'
48+ use-pro : ' true'
49+ configuration : LS_LOG=trace
50+ install-awslocal : ' true'
51+ env :
52+ LOCALSTACK_AUTH_TOKEN : ${{ secrets.LOCALSTACK_AUTH_TOKEN }}
53+
54+ - name : Install Terraform
55+ uses : hashicorp/setup-terraform@v3
56+
57+ - name : Install tflocal
4058 run : |
41- pip install localstack
42- pip install terraform-local
43- pip install awscli-local
59+ pip install --upgrade terraform-local
4460
4561 - name : Build project
4662 run : |
4763 cd shipment-picture-lambda-validator
4864 mvn clean package shade:shade
4965
50- - name : Start LocalStack
51- run : |
52- docker pull localstack/localstack:latest
53- # Start LocalStack in the background
54- LS_LOG=trace localstack start -d
55- # Wait 30 seconds for the LocalStack container to become ready before timing out
56- echo "Waiting for LocalStack startup..."
57- localstack wait -t 15
58- echo "Startup complete"
59-
60- - name : Run Terraform Config File
66+ - name : Deploy using Terraform
6167 run : |
6268 cd terraform
63- bash run-tflocal.sh
69+ tflocal init
70+ tflocal plan
71+ tflocal apply --auto-approve
72+
73+ - name : Build frontend
74+ run : |
75+ cd shipment-list-frontend
76+ npm install
77+ CI=false npm run build
6478
65- - name : Check for Bucket
79+ - name : Show LocalStack logs
80+ if : always()
6681 run : |
67- output=$(awslocal s3api list-buckets --query "Buckets[?contains(Name, 'shipment-picture-bucket')].Name" --output text)
68- if [ -z "$output" ]; then
69- echo "Created bucket not found."
70- exit 1
71- else echo "Bucket with random name was found: $output"
72- fi
82+ localstack logs
7383
7484 - name : Send a Slack notification
7585 if : failure() || github.event_name != 'pull_request'
91101
92102 - name : Upload the Diagnostic Report
93103 if : failure()
94- uses : actions/upload-artifact@v3
104+ uses : actions/upload-artifact@v4
95105 with :
96106 name : diagnose.json.gz
97- path : ./diagnose.json.gz
107+ path : ./diagnose.json.gz
0 commit comments