diff --git a/.github/workflows/playwright-snapshots.yml b/.github/workflows/playwright-snapshots.yml new file mode 100644 index 0000000..9b756b6 --- /dev/null +++ b/.github/workflows/playwright-snapshots.yml @@ -0,0 +1,43 @@ +name: "Playwright: Snapshot Update" + +on: + workflow_dispatch: + +jobs: + snapshots: + name: Generate Playwright snapshots + runs-on: ubuntu-22.04 + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: 20 + cache: npm + + - name: Install dependencies + run: npm ci + + - name: Install Playwright browsers + run: npx playwright install --with-deps chromium + + - name: Build CSS + run: npm run build + + - name: Prepare test CSS + run: npm run test:copy-css + + - name: Update Playwright snapshots + run: npm run test:snapshots + + - name: Upload test results + if: failure() + uses: actions/upload-artifact@v4 + with: + name: playwright-snapshot-failure + path: | + test-results/ + playwright-report/ + retention-days: 7 diff --git a/.github/workflows/playwright.yml b/.github/workflows/playwright.yml new file mode 100644 index 0000000..0596b51 --- /dev/null +++ b/.github/workflows/playwright.yml @@ -0,0 +1,42 @@ +name: "Tests: Playwright" + +on: + pull_request: + branches: + - main + +jobs: + test: + name: playwright + runs-on: ubuntu-22.04 + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: 20 + cache: npm + + - name: Install dependencies + run: npm ci + + - name: Install Playwright browsers + run: npx playwright install --with-deps chromium + + - name: Build CSS + run: npm run build + + - name: Run Playwright tests + run: npm run test:run + + - name: Upload test results + if: failure() + uses: actions/upload-artifact@v4 + with: + name: playwright-report + path: | + test-results/ + playwright-report/ + retention-days: 7