deps: resolve dependency vulnerabilities #2912
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
name: Lint and test | |
on: | |
pull_request: | |
push: | |
branches: | |
- main | |
- release-bot/** | |
workflow_dispatch: | |
jobs: | |
lint-code: | |
name: Lint code | |
runs-on: ubuntu-latest | |
steps: | |
- name: Git clone repository | |
uses: actions/checkout@v4 | |
- name: Set up environment | |
uses: ./.github/actions/prepare-environment | |
- name: Lint | |
run: npm run lint | |
- name: Check formatting | |
run: npm run format:check | |
build-package: | |
name: Build package | |
runs-on: ubuntu-latest | |
steps: | |
- name: Git clone repository | |
uses: actions/checkout@v4 | |
- name: Set up environment | |
uses: ./.github/actions/prepare-environment | |
- name: Build package | |
run: npm run dist:build | |
lint-commit-messages: | |
name: Lint commit messages | |
runs-on: ubuntu-latest | |
if: ${{ github.event_name == 'pull_request' }} | |
steps: | |
- name: Git clone repository | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Set up environment | |
uses: ./.github/actions/prepare-environment | |
- name: Lint commit messages | |
run: | | |
npm exec --no -- commitlint --from ${{ github.event.pull_request.base.sha }} --to ${{ github.event.pull_request.head.sha }} --verbose | |
test-unit: | |
name: Run unit tests | |
runs-on: ubuntu-latest | |
steps: | |
- name: Git clone repository | |
uses: actions/checkout@v4 | |
- name: Set up environment | |
uses: ./.github/actions/prepare-environment | |
- name: Run unit tests | |
run: npm run test | |
determine-playwright-image: | |
name: Determine Playwright container image | |
runs-on: ubuntu-latest | |
outputs: | |
container-image: mcr.microsoft.com/playwright:${{ steps.read-version.outputs.version }}-jammy | |
steps: | |
- name: Git clone repository | |
uses: actions/checkout@v4 | |
- id: read-version | |
name: Read Playwright version | |
run: | | |
echo "version=$(scripts/get-playwright-version.sh)" >> "$GITHUB_OUTPUT" | |
test-e2e: | |
name: Run e2e tests (${{ matrix.shard }}/${{ matrix.total_shards }}) | |
runs-on: ubuntu-latest | |
needs: | |
- determine-playwright-image | |
container: | |
image: ${{ needs.determine-playwright-image.outputs.container-image }} | |
options: --user 1001 | |
strategy: | |
matrix: | |
shard: [1, 2, 3, 4] | |
total_shards: [4] | |
steps: | |
- name: Git clone repository | |
uses: actions/checkout@v4 | |
- name: Set up environment | |
uses: ./.github/actions/prepare-environment | |
- name: Run e2e tests | |
run: npm run test:e2e -- --shard ${{ matrix.shard }}/${{ matrix.total_shards }} | |
- uses: actions/upload-artifact@v3 | |
if: always() | |
with: | |
name: e2e-blob-reports | |
path: blob-report | |
retention-days: 1 | |
merge-e2e-reports: | |
name: Merge e2e test reports | |
runs-on: ubuntu-latest | |
if: always() | |
needs: | |
- determine-playwright-image | |
- test-e2e | |
steps: | |
- name: Git clone repository | |
uses: actions/checkout@v4 | |
- name: Set up environment | |
uses: ./.github/actions/prepare-environment | |
- name: Merge reports | |
uses: ./.github/actions/merge-playwright-reports | |
with: | |
input-artifact: e2e-blob-reports | |
output-artifact: e2e-html-report | |
test-visual-regression: | |
name: Run visual regression tests (${{ matrix.shard }}/${{ matrix.total_shards }}) | |
runs-on: ubuntu-latest | |
needs: | |
- determine-playwright-image | |
container: | |
image: ${{ needs.determine-playwright-image.outputs.container-image }} | |
options: --user 1001 | |
strategy: | |
matrix: | |
shard: [1, 2] | |
total_shards: [2] | |
steps: | |
- name: Git clone repository | |
uses: actions/checkout@v4 | |
- name: Set up environment | |
uses: ./.github/actions/prepare-environment | |
- name: Run visual regression tests | |
run: npm run test:visual:native -- --shard ${{ matrix.shard }}/${{ matrix.total_shards }} | |
- uses: actions/upload-artifact@v3 | |
if: always() | |
with: | |
name: visual-regression-blob-reports | |
path: blob-report | |
retention-days: 1 | |
merge-visual-regression-reports: | |
name: Merge visual regression reports | |
runs-on: ubuntu-latest | |
if: always() | |
needs: | |
- determine-playwright-image | |
- test-visual-regression | |
steps: | |
- name: Git clone repository | |
uses: actions/checkout@v4 | |
- name: Set up environment | |
uses: ./.github/actions/prepare-environment | |
- name: Merge reports | |
uses: ./.github/actions/merge-playwright-reports | |
with: | |
input-artifact: visual-regression-blob-reports | |
output-artifact: visual-regression-html-report | |
audit-dependencies: | |
name: Audit dependencies | |
runs-on: ubuntu-latest | |
steps: | |
- name: Git clone repository | |
uses: actions/checkout@v4 | |
- name: Set up environment | |
uses: ./.github/actions/prepare-environment | |
- name: Run audit | |
run: npm audit |