Files
archtika/.github/workflows/playwright.yml
2024-09-01 19:10:45 +02:00

39 lines
965 B
YAML

name: "Playwright tests"
on:
push:
branches:
- main
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Nix
uses: cachix/install-nix-action@v27
with:
github_access_token: ${{ secrets.GITHUB_TOKEN }}
- name: Setup and run dev vm
run: |
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