UIK-3284/playwright-version #7165
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
name: cd | |
on: | |
pull_request: | |
workflow_dispatch: | |
push: | |
branches: [master] | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4.1.1 | |
- name: Install Node.js | |
uses: actions/setup-node@v4.0.1 | |
with: | |
node-version: 20 | |
- uses: pnpm/action-setup@v4.0.0 | |
name: Install pnpm | |
id: pnpm-install | |
with: | |
version: 8.7.6 | |
run_install: false | |
- name: Get pnpm store directory | |
id: pnpm-cache | |
run: | | |
echo "pnpm_cache_dir=$(pnpm store path)" >> $GITHUB_OUTPUT | |
- uses: actions/cache@v4.0.0 | |
name: Setup pnpm cache | |
with: | |
path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }} | |
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | |
- name: Cache build | |
uses: actions/cache@v4.0.0 | |
id: cache-build | |
with: | |
path: | | |
semcore/*/lib | |
tools/*/lib | |
semcore/icon/**/*.js | |
semcore/icon/**/*.mjs | |
semcore/icon/**/*.d.ts | |
semcore/illustration/**/*.js | |
semcore/illustration/**/*.mjs | |
semcore/illustration/**/*.d.ts | |
key: build-${{ hashFiles('**/pnpm-lock.yaml', '**/CHANGELOG.md') }}-5 | |
- name: Install dependencies | |
run: | | |
pnpm install --frozen-lockfile | |
- name: Build | |
if: steps.cache-build.outputs.cache-hit != 'true' | |
run: | | |
pnpm build | |
static-lint: | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4.1.1 | |
- name: Install Node.js | |
uses: actions/setup-node@v4.0.1 | |
with: | |
node-version: 20 | |
- uses: pnpm/action-setup@v4.0.0 | |
name: Install pnpm | |
id: pnpm-install | |
with: | |
version: 8.7.6 | |
run_install: false | |
- name: Get pnpm store directory | |
id: pnpm-cache | |
run: | | |
echo "pnpm_cache_dir=$(pnpm store path)" >> $GITHUB_OUTPUT | |
- uses: actions/cache@v4.0.0 | |
name: Setup pnpm cache | |
with: | |
path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }} | |
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | |
- name: Restore cached build | |
uses: actions/cache@v4.0.0 | |
id: cache-build | |
with: | |
path: | | |
semcore/*/lib | |
tools/*/lib | |
semcore/icon/**/*.js | |
semcore/icon/**/*.mjs | |
semcore/icon/**/*.d.ts | |
semcore/illustration/**/*.js | |
semcore/illustration/**/*.mjs | |
semcore/illustration/**/*.d.ts | |
key: build-${{ hashFiles('**/pnpm-lock.yaml', '**/CHANGELOG.md') }}-5 | |
- name: Install dependencies | |
run: | | |
pnpm install --frozen-lockfile | |
- name: Lint | |
run: pnpm --filter intergalactic-migrate run build && pnpm lint | |
docs-lint: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4.1.1 | |
- uses: errata-ai/vale-action@reviewdog | |
name: Run Vale | |
continue-on-error: true | |
with: | |
files: README.md CONTRIBUTING.md semcore/*/README.md semcore/*/CHANGELOG.md website/docs | |
unit-tests: | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4.1.1 | |
- name: Install Node.js | |
uses: actions/setup-node@v4.0.1 | |
with: | |
node-version: 20 | |
- uses: pnpm/action-setup@v4.0.0 | |
name: Install pnpm | |
id: pnpm-install | |
with: | |
version: 8.7.6 | |
run_install: false | |
- name: Get pnpm store directory | |
id: pnpm-cache | |
run: | | |
echo "pnpm_cache_dir=$(pnpm store path)" >> $GITHUB_OUTPUT | |
- uses: actions/cache@v4.0.0 | |
name: Setup pnpm cache | |
with: | |
path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }} | |
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | |
- name: Restore cached build | |
uses: actions/cache@v4.0.0 | |
id: cache-build | |
with: | |
path: | | |
semcore/*/lib | |
tools/*/lib | |
semcore/icon/**/*.js | |
semcore/icon/**/*.mjs | |
semcore/icon/**/*.d.ts | |
semcore/illustration/**/*.js | |
semcore/illustration/**/*.mjs | |
semcore/illustration/**/*.d.ts | |
key: build-${{ hashFiles('**/pnpm-lock.yaml', '**/CHANGELOG.md') }}-5 | |
- name: Install dependencies | |
run: | | |
pnpm install --frozen-lockfile | |
- name: Test setup | |
id: test-setup | |
run: pnpm test:setup | |
- name: Test | |
id: test | |
run: pnpm test:docker run -- --allowOnly=false | |
continue-on-error: true | |
- name: Save test results as artifacts | |
if: steps.test.outcome != 'success' | |
uses: actions/upload-artifact@v4 | |
with: | |
name: unit-testing-failure-output | |
path: semcore/*/__tests__/__image_snapshots__/__diff_output__/ | |
retention-days: 3 | |
- name: Fail if test step actually failed | |
if: steps.test.outcome != 'success' | |
run: exit 1 | |
a11y-tests: | |
runs-on: macos-14 | |
needs: build | |
steps: | |
- uses: actions/checkout@v4.1.1 | |
- name: Install Node.js | |
uses: actions/setup-node@v4.0.1 | |
with: | |
node-version: 20 | |
- uses: pnpm/action-setup@v4.0.0 | |
name: Install pnpm | |
id: pnpm-install | |
with: | |
version: 8.7.6 | |
run_install: false | |
- name: Get pnpm store directory | |
id: pnpm-cache | |
run: | | |
echo "pnpm_cache_dir=$(pnpm store path)" >> $GITHUB_OUTPUT | |
- uses: actions/cache@v4.0.0 | |
name: Setup pnpm cache | |
with: | |
path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }} | |
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | |
- name: Restore cached build | |
uses: actions/cache@v4.0.0 | |
id: cache-build | |
with: | |
path: | | |
semcore/*/lib | |
tools/*/lib | |
semcore/icon/**/*.js | |
semcore/icon/**/*.mjs | |
semcore/icon/**/*.d.ts | |
semcore/illustration/**/*.js | |
semcore/illustration/**/*.mjs | |
semcore/illustration/**/*.d.ts | |
key: build-${{ hashFiles('**/pnpm-lock.yaml', '**/CHANGELOG.md') }}-5 | |
- name: Install dependencies | |
run: | | |
pnpm install --frozen-lockfile | |
- name: Install Browser | |
run: npx playwright install webkit | |
- name: Enable VoiceOver Automation | |
uses: guidepup/setup-action@0.15.3 | |
- name: Voice Over testing | |
id: a11y-testing | |
uses: nick-fields/retry@v2.8.3 | |
with: | |
timeout_minutes: 40 | |
max_attempts: 3 | |
command: pnpm run vo-test:ci | |
continue-on-error: true | |
- name: Save test results as artifacts | |
if: steps.a11y-testing.outcome != 'success' | |
uses: actions/upload-artifact@v4 | |
with: | |
name: a11y-testing-failure-output | |
path: test-results | |
retention-days: 3 | |
- name: Fail if test step actually failed | |
if: steps.a11y-testing.outcome != 'success' | |
run: exit 1 | |
- name: Github GPG Auth | |
uses: crazy-max/ghaction-import-gpg@v5.3.0 | |
with: | |
gpg_private_key: ${{ secrets.BOT_ACCOUNT_GPG_PRIVATE_KEY }} | |
git_user_signingkey: true | |
git_commit_gpgsign: true | |
git_committer_name: semrush-ci-whale | |
git_committer_email: semrush-ci-whale@users.noreply.github.com | |
- name: Push changed a11y reports | |
if: steps.a11y-testing.outcome == 'success' | |
run: git add . && git commit -m "[chore] a11y automatic check fixation" && git push || echo "nothing to commit" | |
browser-tests: | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- uses: actions/checkout@v4.1.1 | |
- uses: pnpm/action-setup@v4.0.0 | |
with: | |
version: 8.7.6 | |
run_install: false | |
- name: Browser testing | |
id: browser-testing | |
run: | | |
docker run --rm --network host -v $(pwd):/work -v /work/node_modules -v /work/.pnpm-store -v /work/.cache -w /work/ mcr.microsoft.com/playwright:v1.43.0-jammy bash -c "npm install --global pnpm@8.11.0 && pnpm install --ignore-scripts && pnpm build:icons && pnpm build:illustration && npx playwright install && CI=true pnpm playwright test --config playwright.browser.config.ts" | |
continue-on-error: true | |
- name: Save test results as artifacts | |
if: steps.browser-testing.outcome != 'success' | |
uses: actions/upload-artifact@v4 | |
with: | |
name: browser-testing-failure-output | |
path: test-results | |
retention-days: 3 | |
- name: Fail if test step actually failed | |
if: steps.browser-testing.outcome != 'success' | |
run: exit 1 | |
axe-tests: | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- uses: actions/checkout@v4.1.1 | |
- uses: pnpm/action-setup@v4.0.0 | |
with: | |
version: 8.7.6 | |
run_install: false | |
- name: Axe testing | |
id: axe-testing | |
run: | | |
docker run --rm --network host -v $(pwd):/work -v /work/node_modules -v /work/.pnpm-store -v /work/.cache -w /work/ mcr.microsoft.com/playwright:v1.35.0-jammy bash -c "npm install --global pnpm@8.11.0 && pnpm install --ignore-scripts && pnpm build:icons && pnpm build:illustration && npx playwright install && CI=true pnpm playwright test --config playwright.axe.config.ts" | |
continue-on-error: true | |
- name: Save test results as artifacts | |
if: steps.axe-testing.outcome != 'success' | |
uses: actions/upload-artifact@v4 | |
with: | |
name: axe-testing-failure-output | |
path: test-results | |
retention-days: 3 | |
- name: Fail if test step actually failed | |
if: steps.axe-testing.outcome != 'success' | |
run: exit 1 |