diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2f8a7b7b8..5bac3f520 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -52,6 +52,7 @@ jobs: - 'apps/example-web/package.json' - 'apps/example-web/vite.config.ts' - 'apps/example-web/index.html' + - '.playwright/**' lint: runs-on: ubuntu-latest @@ -86,6 +87,39 @@ jobs: - name: Run unit tests run: yarn test --maxWorkers=2 --coverage + test-e2e-web: + needs: [changes] + if: needs.changes.outputs.web == 'true' + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup + uses: ./.github/actions/setup + + - name: Cache Playwright browsers + uses: actions/cache@v4 + with: + path: ~/.cache/ms-playwright + key: ${{ runner.os }}-playwright-${{ hashFiles('yarn.lock') }} + restore-keys: | + ${{ runner.os }}-playwright- + + - name: Install Playwright browsers + run: yarn playwright install --with-deps chromium + + - name: Run web e2e tests + run: yarn playwright test --config .playwright/playwright.config.ts + + - name: Upload Playwright report + if: failure() + uses: actions/upload-artifact@v4 + with: + name: playwright-report + path: .playwright/playwright-report/ + retention-days: 7 + build-library: runs-on: ubuntu-latest steps: