diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 85342b7..8c7d7b7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,8 +11,8 @@ on: workflow_dispatch: jobs: - compile-then-test: - name: Compile scala then run tests + compile-then-run-server: + name: Compile scala then run server runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 @@ -38,15 +38,22 @@ jobs: - name: Run server run: | ./scripts/server >/dev/null 2>&1 & - SERVER_PID=$! + echo "export SERVER_PID=$!" >> $GITHUB_ENV" - - name: Run test script - run: | - sleep 15 - curl localhost:8090/pong + run-tests: + name: Run tests against server + runs-on: ubuntu-latest + needs: compile-then-run-server + env: + SERVER_PID: ${{ needs.compile-then-run-server.outputs.SERVER_PID}} + steps: + # - name: Run test script + # run: | + # sleep 15 + # curl localhost:8090/pong - name: Stop server run: | echo $SERVER_PID - kill $SERVER_PID + # kill $SERVER_PID