Update Node.js to v22 #16230
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' | |
- '@adeira/mrtnzlml.com' | |
- '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: '@adeira/mrtnzlml.com' | |
source: 'src/mrtnzlml.com/**' | |
playwrightReportName: 'playwright-report-mrtnzlml-com' | |
playwrightReportPath: 'src/mrtnzlml.com/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.2.2 | |
# https://github.com/dorny/paths-filter | |
- uses: dorny/paths-filter@v3.0.2 | |
id: paths-filter | |
with: | |
filters: | | |
src: ${{ matrix.source }} | |
# https://github.com/actions/setup-node | |
- name: Use Node.js 20.x | |
if: steps.paths-filter.outputs.src == 'true' | |
uses: actions/setup-node@v4.1.0 | |
with: | |
node-version: 20.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@v4.4.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 |