.github/workflows/playwright.yml #12362
Workflow file for this run
This file contains 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
on: | |
merge_group: | |
types: | |
- checks_requested | |
pull_request: | |
# We do not run tests on master as the changes were already tested when opening a PR, | |
# and we require every PR to be up-to-date before merging it to master. | |
types: | |
- opened | |
- synchronize | |
- reopened | |
env: | |
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} | |
jobs: | |
playwright-test: | |
strategy: | |
fail-fast: false | |
matrix: | |
repository: | |
- '@adeira/abacus-backoffice' | |
- '@adeira/abacus-kochka' | |
- '@adeira/abacus-tools' | |
- '@adeira/sx-design' | |
- '@adeira/typescript-test' | |
- 'mrtnzlml-meta' | |
include: | |
- repository: '@adeira/abacus-backoffice' | |
source: 'src/abacus-backoffice/**' | |
playwrightReportName: 'playwright-report-abacus-backoffice' | |
playwrightReportPath: 'src/abacus-backoffice/playwright/test-results/' | |
- repository: '@adeira/abacus-kochka' | |
source: 'src/abacus-kochka/**' | |
playwrightReportName: 'playwright-report-abacus-kochka' | |
playwrightReportPath: 'src/abacus-kochka/playwright/test-results/' | |
- repository: '@adeira/abacus-tools' | |
source: 'src/abacus-tools/**' | |
playwrightReportName: 'playwright-report-abacus-tools' | |
playwrightReportPath: 'src/abacus-tools/playwright/test-results/' | |
- repository: '@adeira/sx-design' | |
source: 'src/sx-design/**' | |
playwrightReportName: 'playwright-report-sx-design' | |
playwrightReportPath: 'src/sx-design/playwright/test-results/' | |
- repository: '@adeira/typescript-test' | |
source: 'src/typescript-test/**' | |
playwrightReportName: 'playwright-report-typescript-test' | |
playwrightReportPath: 'src/typescript-test/playwright/test-results/' | |
- repository: 'mrtnzlml-meta' | |
source: 'src/mrtnzlml-meta/**' | |
playwrightReportName: 'playwright-report-mrtnzlml-meta' | |
playwrightReportPath: 'src/mrtnzlml-meta/playwright/test-results/' | |
runs-on: ubuntu-latest | |
steps: | |
# https://github.com/actions/checkout | |
- uses: actions/checkout@v4.1.1 | |
# https://github.com/dorny/paths-filter | |
- uses: dorny/paths-filter@v2.11.1 | |
id: paths-filter | |
with: | |
filters: | | |
src: ${{ matrix.source }} | |
# https://github.com/actions/setup-node | |
- name: Use Node.js 18.x | |
if: steps.paths-filter.outputs.src == 'true' | |
uses: actions/setup-node@v4.0.0 | |
with: | |
node-version: 18.x | |
cache: 'yarn' | |
- name: Install Yarn dependencies | |
if: steps.paths-filter.outputs.src == 'true' | |
run: yarn install --immutable | |
- name: Install Playwright | |
if: steps.paths-filter.outputs.src == 'true' | |
run: yarn workspace ${{ matrix.repository }} playwright install --with-deps | |
- name: Run Playwright tests | |
if: steps.paths-filter.outputs.src == 'true' | |
run: yarn workspace ${{ matrix.repository }} playwright test | |
env: | |
# See: https://github.com/storybookjs/storybook/issues/16555 | |
# TODO: remove when no longer needed | |
NODE_OPTIONS: --openssl-legacy-provider | |
# https://github.com/actions/upload-artifact | |
- name: Upload Playwright test results | |
if: always() | |
uses: actions/upload-artifact@v3.1.3 | |
with: | |
name: ${{ matrix.playwrightReportName }} | |
path: ${{ matrix.playwrightReportPath }} | |
# The purpose of this job is to wait for the completion of the `playwright-test` jobs (matrix) | |
# and evaluate whether the run was successful or not. This is useful when configuring the | |
# required jobs in GitHub UI (we can require just this one job instead of all the jobs in | |
# the test matrix). | |
playwright-test-results: | |
if: ${{ always() }} | |
runs-on: ubuntu-latest | |
needs: [playwright-test] | |
steps: | |
- run: | | |
result="${{ needs.playwright-test.result }}" | |
if [[ $result == "success" || $result == "skipped" ]]; then | |
exit 0 | |
else | |
exit 1 | |
fi |