From 9ff36a2617534fa0c90d6c10227a2acbb6f1b56f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=96zg=C3=BCr=20Adem=20I=C5=9EIKLI?= Date: Sun, 10 Mar 2024 17:38:58 +0100 Subject: [PATCH] Fixed --- .github/workflows/tests.yml | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 97b1d85..82d737f 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -20,7 +20,20 @@ jobs: uses: actions/setup-node@v1 with: node-version: ${{ matrix.node-version }} - - run: npm ci - - run: cp .env.example .env - - run: npm run build - - run: npx concurrently --kill-others "npm run start" "npx wait-on -t 5s http-get://localhost:3000/docs" + - name: Build the app + run: npm ci | + cp .env.example .env + npm run build + - name: Start the application + run: npm run start + background: true + - name: Test API endpoint + run: | + response=$(curl -s -o /dev/null -w "%{http_code}" http://localhost:3000/docs) + if [ $response == "200" ]; then + echo "API endpoint is reachable." + exit 0 + else + echo "API endpoint is not reachable." + exit 1 + fi