From ba670223de542b0f44dc1fb0889f8b770072704d Mon Sep 17 00:00:00 2001 From: js0ny Date: Thu, 22 Jan 2026 08:39:11 +0000 Subject: [PATCH] ci(e2e): Add e2e ci --- .bin/e2e.sh | 50 ++++++++++++++++++++++++++++++++++++++++ .github/workflows/ci.yml | 7 ++++++ .gitignore | 3 +++ .justfile | 4 ++++ 4 files changed, 64 insertions(+) create mode 100644 .bin/e2e.sh diff --git a/.bin/e2e.sh b/.bin/e2e.sh new file mode 100644 index 0000000..872eb42 --- /dev/null +++ b/.bin/e2e.sh @@ -0,0 +1,50 @@ +#!/usr/bin/env bash +set -e + + + +echo "[INFO] Starting Go Backend..." +cd drone-black-box && go build -o app main.go +cd .. + +./drone-black-box/app & +GO_PID=$! +echo " Go PID: $GO_PID" + +echo "[INFO] Starting Java Backend..." + +cd ilp-rest-service +./gradlew bootRun & +JAVA_PID=$! +echo " Java PID: $JAVA_PID" +cd .. + +cleanup() { + echo "[INFO] Stopping services..." + kill $GO_PID || true + kill $JAVA_PID || true +} +trap cleanup EXIT + + +echo "[INFO] Waiting for services to be ready..." + +for i in {1..30}; do + if curl -s http://localhost:8080/actuator/health > /dev/null; then + echo "[INFO] Java is UP!" + break + fi + echo "[DEBUG] Waiting for Java..." + sleep 2 +done + + +echo "[INFO] Running Bruno E2E Collection..." + +cd ./ilp-rest-service/ilp-cw-api + +bru run + +echo "[INFO] E2E Tests Passed!" + +cleanup diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b76ef77..adb662d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -3,6 +3,13 @@ name: Polyglot CI on: push: branches: [ "main" ] + paths: + - '**.java' + - '**.go' + - '.justfile' + - '**.js' + - '**.svelte' + - '**.css' pull_request: branches: [ "main" ] diff --git a/.gitignore b/.gitignore index 651fdcf..55bcae1 100644 --- a/.gitignore +++ b/.gitignore @@ -50,3 +50,6 @@ drone-black-box/drone_black_box.db* *.out *.html + +drone_black_box.db* +app diff --git a/.justfile b/.justfile index 70d991e..d99b0be 100644 --- a/.justfile +++ b/.justfile @@ -2,6 +2,7 @@ all: @just format @just static-analysis @just test + @just e2e format: cd ./drone-black-box && go fmt @@ -17,3 +18,6 @@ test: rm ./drone-black-box/coverage.out # Java cd ./ilp-rest-service/ && ./gradlew check + +e2e: + bash .bin/e2e.sh