diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 20a479b..9ecfa75 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,7 +12,7 @@ on: jobs: compile-then-run-tests: - name: Compile scala then run server + name: Compile scala, run server, run tests runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 @@ -40,10 +40,15 @@ jobs: ./scripts/server >/dev/null 2>&1 & echo "SERVER_PID=$!" >> "$GITHUB_ENV" - - name: Run test script + - name: Check server run: | - sleep 15 - curl localhost:8090/pong + if ps -p "${SERVER_PID}" > /dev/null; then + echo "Server script is running with PID: ${SERVER_PID}" + else + echo "Server script is not running." + exit 1 + fi + curl localhost:8090/ping - name: Stop server run: |