Skip to content

ci: adds working directory #4

ci: adds working directory

ci: adds working directory #4

Workflow file for this run

name: Playwright Tests
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
setup:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: lts/*
- name: Install dependencies
run: npm ci
- name: Install Playwright Browsers
run: npx playwright install --with-deps
start-real-world-app:
runs-on: ubuntu-latest
needs: setup
steps:
- name: Create env file
run: |
echo "COOKIE_NAME=%realworldfront%" >> .env
echo "COOKIE_PASSWORD=${{ secrets.COOKIE_PASSWORD }}" >> .env
echo "BASE_URL=http://localhost:9001" >> .env
echo "NEXT_PUBLIC_RELATIVE_PATH=http://localhost:3000/api" >> .env
- name: Start App
run: npm run dev
working-directory: ./realworld-front
start-mockoon:
runs-on: ubuntu-latest
needs: setup
steps:
- name: Start Mockoon
run: |
npm install -g @mockoon/cli
mockoon-cli start --data ./mockoon/RealWorldApi.json --port 9001
working-directory: ./realworld-front
test:
runs-on: ubuntu-latest
needs: start-mockoon
steps:
- name: Run Playwright tests
run: npx playwright test
report:
runs-on: ubuntu-latest
needs: test
steps:
- uses: actions/upload-artifact@v4
if: ${{ !cancelled() }}
with:
name: playwright-report
path: playwright-report/
retention-days: 30