Carlos dev4 Major update for log refactor, auto ESLinter #165
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Playwright Tests for SlideRule Web Client | |
| on: | |
| push: | |
| branches: [ main, master ] | |
| pull_request: | |
| branches: [ main, master ] # only PRs *into* main/master | |
| workflow_dispatch: {} | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| env: | |
| ENV: ci | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 # <-- so git describe / tags work in Makefile | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| cache: npm | |
| cache-dependency-path: web-client/package-lock.json | |
| - name: Create .env.ci at repo root | |
| working-directory: web-client | |
| run: | | |
| { | |
| echo "BASE_URL=http://localhost:5173" | |
| echo "VITE_APP_ENV=ci" | |
| # echo "VITE_API_BASE=${{ secrets.VITE_API_BASE }}" | |
| } > ../.env.ci | |
| - name: Install deps | |
| working-directory: web-client | |
| run: npm ci | |
| - name: Install Playwright browsers | |
| working-directory: web-client | |
| run: npx playwright install --with-deps | |
| - name: Debug – list tests | |
| working-directory: web-client | |
| run: npx playwright test --list | |
| - name: Debug – verify @playwright/test is installed | |
| working-directory: web-client | |
| run: | | |
| node -p "require('./package.json').devDependencies?.['@playwright/test'] || 'MISSING'" | |
| node -p "require.resolve('@playwright/test/package.json')" | |
| - name: Run Playwright tests | |
| working-directory: web-client | |
| run: npx playwright test | |
| - uses: actions/upload-artifact@v4 | |
| if: ${{ !cancelled() }} | |
| with: | |
| name: playwright-report | |
| path: web-client/playwright-report/ | |
| retention-days: 30 |