Merge pull request #87 from ivpn/chore/ipv4-tooltip #242
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: Frontend Tests | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| reason: | |
| description: 'Optional reason for manual run' | |
| required: false | |
| default: 'manual trigger' | |
| push: | |
| branches: ["main", "develop", "release/*"] | |
| paths: | |
| - 'app/**' | |
| - '.github/workflows/frontend.yml' | |
| pull_request: | |
| branches: ["main", "develop", "release/*"] | |
| paths: | |
| - 'app/**' | |
| - '.github/workflows/frontend.yml' | |
| permissions: read-all | |
| jobs: | |
| frontend: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 30 | |
| permissions: | |
| contents: read | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 | |
| with: | |
| persist-credentials: false | |
| - name: Setup Node | |
| uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4 | |
| with: | |
| node-version: 20 | |
| cache: 'npm' | |
| cache-dependency-path: 'app/package-lock.json' | |
| - name: Install deps | |
| working-directory: app | |
| run: npm ci | |
| - name: Lint | |
| working-directory: app | |
| run: npm run lint --silent | |
| # - name: Cache Playwright Browsers | |
| # id: playwright-cache | |
| # uses: actions/cache@v4 | |
| # with: | |
| # path: ~/.cache/ms-playwright | |
| # key: playwright-browsers-${{ runner.os }}-${{ hashFiles('app/package-lock.json') }} | |
| # restore-keys: | | |
| # playwright-browsers-${{ runner.os }}- | |
| - name: Install Playwright Browsers (Chromium + WebKit) | |
| if: steps.playwright-cache.outputs.cache-hit != 'true' | |
| working-directory: app | |
| run: npx playwright install --with-deps chromium webkit | |
| - name: Run unit tests | |
| working-directory: app | |
| run: npm run test | |
| - name: Run e2e tests | |
| working-directory: app | |
| env: | |
| VITE_API_URL: http://localhost:3000 | |
| STRICT_MOBILE: 1 | |
| run: npx playwright test -c src/__tests__/playwright.config.ts | |
| - name: Upload HTML report (always) | |
| if: always() | |
| uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4 | |
| with: | |
| name: playwright-report | |
| path: app/playwright-report | |
| if-no-files-found: ignore | |
| - name: Upload Traces (on failure) | |
| if: failure() | |
| uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4 | |
| with: | |
| name: playwright-traces | |
| path: app/test-results | |
| if-no-files-found: ignore |