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