Skip to content

Commit aedd8a5

Browse files
committed
ci
1 parent b5672d7 commit aedd8a5

File tree

3 files changed

+27
-2
lines changed

3 files changed

+27
-2
lines changed

.github/ci.yml renamed to .github/workflows/ci.yml

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,25 @@ jobs:
1414
- name: Checkout code
1515
uses: actions/checkout@v4
1616

17-
- name: Set up Docker Buildx
18-
uses: docker/setup-buildx-action@v3
17+
# 🔧 REQUIRED: Go for E2E runner
18+
- name: Set up Go
19+
uses: actions/setup-go@v4
20+
with:
21+
go-version: "1.20"
1922

23+
# 🔧 REQUIRED: create .env files from .env.example
24+
- name: Prepare env files for CI
25+
run: |
26+
cp services/product/.env.example services/product/.env
27+
cp services/cart/.env.example services/cart/.env
28+
cp services/orders/.env.example services/orders/.env
29+
30+
# 🚀 Start full stack
2031
- name: Build and start services
2132
run: |
2233
docker compose up -d --build
2334
35+
# ⏳ Wait until all services are ready
2436
- name: Wait for services to be healthy
2537
run: |
2638
echo "Waiting for services..."
@@ -38,15 +50,18 @@ jobs:
3850
docker compose logs
3951
exit 1
4052
53+
# 🧪 Full end-to-end checkout test
4154
- name: Run Full E2E Checkout Flow
4255
run: |
4356
go run ./tools/e2e_checkout/full_flow.go
4457
58+
# 🪵 Debug aid
4559
- name: Dump logs on failure
4660
if: failure()
4761
run: |
4862
docker compose logs
4963
64+
# 🧹 Always cleanup
5065
- name: Shutdown services
5166
if: always()
5267
run: |

services/cart/.env.example

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
CART_SERVICE_PORT=8081
2+
REDIS_ADDR=redis:6379
3+
REDIS_PASSWORD=
4+
PRODUCT_SVC_BASE=http://product:8080
5+
CART_TTL_USER_DAYS=30
6+
CART_TTL_GUEST_DAYS=7

services/orders/.env.example

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
DATABASE_URL=postgres://postgres:postgres@postgres:5432/sabhyatam?sslmode=disable
2+
CART_SVC_BASE=http://cart:8081
3+
PRODUCT_SVC_BASE=http://product:8080
4+
PRODUCT_ADMIN_KEY=sabhyatam-secret

0 commit comments

Comments
 (0)