From 46803ab688984f5b644f7d633878b63e5a9d06c4 Mon Sep 17 00:00:00 2001 From: thiloho <123883702+thiloho@users.noreply.github.com> Date: Sun, 1 Sep 2024 19:10:45 +0200 Subject: [PATCH] Add wait commands for background services --- .github/workflows/playwright.yml | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/.github/workflows/playwright.yml b/.github/workflows/playwright.yml index 289bfae..3347db5 100644 --- a/.github/workflows/playwright.yml +++ b/.github/workflows/playwright.yml @@ -21,22 +21,19 @@ jobs: sudo mkdir -p /var/www/archtika-websites sudo chown $USER:$(id -gn) /var/www/archtika-websites nix run .#dev-vm & + # Wait for PostgreSQL to be available + nix shell nixpkgs#netcat -c bash -c 'until nc -z localhost 15432; do sleep 1; done' - name: Start PostgREST API run: | cd rest-api nix run .#api & + # Wait for the API to be available + nix shell nixpkgs#netcat -c bash -c 'until nc -z localhost 3000; do sleep 1; done' - name: Run playwright tests run: | cd web-app nix develop .#web npm install - npm run test - - - name: Cleanup - if: always() - run: | - if [ -n "$VM_PID" ]; then - kill $VM_PID - fi \ No newline at end of file + npm run test \ No newline at end of file