@@ -20,12 +20,12 @@ jobs:
20
20
runs-on : ubuntu-latest
21
21
steps :
22
22
- name : Checkout
23
- uses : actions/checkout@v3
23
+ uses : actions/checkout@v4
24
24
25
25
- name : Setup Python
26
26
uses : actions/setup-python@v4
27
27
with :
28
- python-version : ' 3.9 '
28
+ python-version : ' 3.11 '
29
29
30
30
- name : Set up JDK
31
31
uses : actions/setup-java@v2
@@ -36,40 +36,43 @@ jobs:
36
36
- name : Set up Maven
37
37
run : sudo apt-get install -y maven
38
38
39
- - name : Install localstack & awslocal
39
+ - name : Start LocalStack
40
+ uses : LocalStack/setup-localstack@v0.2.4
41
+ with :
42
+ image-tag : ' latest'
43
+ use-pro : ' true'
44
+ configuration : LS_LOG=trace
45
+ install-awslocal : ' true'
46
+ env :
47
+ LOCALSTACK_AUTH_TOKEN : ${{ secrets.LOCALSTACK_AUTH_TOKEN }}
48
+
49
+ - name : Install Terraform
50
+ uses : hashicorp/setup-terraform@v2
51
+
52
+ - name : Install tflocal
40
53
run : |
41
- pip install localstack
42
54
pip install terraform-local
43
- pip install awscli-local
44
55
45
56
- name : Build project
46
57
run : |
47
58
cd shipment-picture-lambda-validator
48
59
mvn clean package shade:shade
49
60
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
61
+ - name : Deploy using Terraform
61
62
run : |
62
63
cd terraform
63
64
bash run-tflocal.sh
64
65
65
- - name : Check for Bucket
66
+ - name : Build frontend
67
+ run : |
68
+ cd shipment-list-frontend
69
+ npm install
70
+ npm run build
71
+
72
+ - name : Show LocalStack logs
73
+ if : always()
66
74
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
75
+ localstack logs
73
76
74
77
- name : Send a Slack notification
75
78
if : failure() || github.event_name != 'pull_request'
91
94
92
95
- name : Upload the Diagnostic Report
93
96
if : failure()
94
- uses : actions/upload-artifact@v3
97
+ uses : actions/upload-artifact@v4
95
98
with :
96
99
name : diagnose.json.gz
97
- path : ./diagnose.json.gz
100
+ path : ./diagnose.json.gz
0 commit comments