Skip to content

Commit b0fa9b1

Browse files
committed
fix the ci
1 parent 77c8945 commit b0fa9b1

File tree

1 file changed

+28
-25
lines changed

1 file changed

+28
-25
lines changed

.github/workflows/ci.yml

Lines changed: 28 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@ jobs:
2020
runs-on: ubuntu-latest
2121
steps:
2222
- name: Checkout
23-
uses: actions/checkout@v3
23+
uses: actions/checkout@v4
2424

2525
- name: Setup Python
2626
uses: actions/setup-python@v4
2727
with:
28-
python-version: '3.9'
28+
python-version: '3.11'
2929

3030
- name: Set up JDK
3131
uses: actions/setup-java@v2
@@ -36,40 +36,43 @@ jobs:
3636
- name: Set up Maven
3737
run: sudo apt-get install -y maven
3838

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
4053
run: |
41-
pip install localstack
4254
pip install terraform-local
43-
pip install awscli-local
4455
4556
- name: Build project
4657
run: |
4758
cd shipment-picture-lambda-validator
4859
mvn clean package shade:shade
4960
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
6162
run: |
6263
cd terraform
6364
bash run-tflocal.sh
6465
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()
6674
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
7376
7477
- name: Send a Slack notification
7578
if: failure() || github.event_name != 'pull_request'
@@ -91,7 +94,7 @@ jobs:
9194
9295
- name: Upload the Diagnostic Report
9396
if: failure()
94-
uses: actions/upload-artifact@v3
97+
uses: actions/upload-artifact@v4
9598
with:
9699
name: diagnose.json.gz
97-
path: ./diagnose.json.gz
100+
path: ./diagnose.json.gz

0 commit comments

Comments
 (0)