|
| 1 | +# Workflows that run visual regression tests on Flare26 components |
| 2 | + |
| 3 | +name: Visual regression tests |
| 4 | +run-name: "Visual regression tests for ${{ github.head_ref || github.ref_name }}" |
| 5 | +on: |
| 6 | + push: |
| 7 | + branches: |
| 8 | + - 'main' |
| 9 | + pull_request: |
| 10 | + branches: |
| 11 | + - main |
| 12 | + paths: |
| 13 | + - 'springfield/cms/templates/components/**' |
| 14 | + - 'springfield/cms/templates/pattern-library/components/flare-26/**' |
| 15 | + - 'media/css/cms/**' |
| 16 | + - 'tests/playwright/specs/visual-regression/**' |
| 17 | + |
| 18 | +permissions: |
| 19 | + contents: read |
| 20 | + |
| 21 | +jobs: |
| 22 | + visual-regression-tests: |
| 23 | + if: always() && github.repository == 'mozmeao/springfield' |
| 24 | + runs-on: ubuntu-latest |
| 25 | + env: |
| 26 | + CI: true |
| 27 | + steps: |
| 28 | + - uses: actions/checkout@v6 |
| 29 | + - uses: actions/setup-python@v5 |
| 30 | + with: |
| 31 | + python-version: '3.13' |
| 32 | + - uses: astral-sh/setup-uv@v5 |
| 33 | + - name: Install Python dependencies |
| 34 | + run: uv pip install -r requirements/dev.txt |
| 35 | + - uses: actions/setup-node@v4 |
| 36 | + with: |
| 37 | + node-version: 20 |
| 38 | + - name: Build frontend assets |
| 39 | + run: npm ci && npm run build |
| 40 | + - name: Install Playwright dependencies |
| 41 | + run: cd tests/playwright && npm ci && npm run install-deps |
| 42 | + - name: Run Playwright tests |
| 43 | + run: cd tests/playwright && npm run local:visual-regression-tests |
| 44 | + - uses: actions/upload-artifact@v4 |
| 45 | + if: ${{ !cancelled() }} |
| 46 | + with: |
| 47 | + name: test-results-${{ github.sha }}-${{ github.run_id }} |
| 48 | + path: tests/playwright/test-results/ |
| 49 | + if-no-files-found: ignore # this avoids a false "Warning" if there were no issues |
| 50 | + retention-days: 30 |
0 commit comments