mirror of
https://github.com/zen-browser/www
synced 2026-04-25 17:14:56 +02:00
chore(ci): enhance CI pipeline with playwright container and adjust job dependencies (#739)
This commit is contained in:
58
.github/workflows/ci-pipeline.yml
vendored
58
.github/workflows/ci-pipeline.yml
vendored
@@ -33,7 +33,7 @@ jobs:
|
||||
|
||||
setup:
|
||||
name: Setup Dependencies
|
||||
needs: check_changes
|
||||
needs: [check_changes]
|
||||
if: ${{ needs.check_changes.outputs.exists == 'true' }}
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
@@ -50,6 +50,7 @@ jobs:
|
||||
lookup-only: true
|
||||
|
||||
- name: Setup Node.js
|
||||
if: steps.check-node-modules-cache.outputs.cache-hit != 'true'
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: lts/*
|
||||
@@ -66,22 +67,24 @@ jobs:
|
||||
|
||||
quality_checks:
|
||||
name: ${{ matrix.name }}
|
||||
needs: [check_changes, setup]
|
||||
needs: [setup]
|
||||
if: ${{ needs.check_changes.outputs.exists == 'true' }}
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
include:
|
||||
- check: lint
|
||||
name: Lint
|
||||
- check: format
|
||||
name: Format
|
||||
- check: test
|
||||
name: Test
|
||||
- check: spell
|
||||
name: Spell Check
|
||||
- check: build
|
||||
name: Build
|
||||
- name: Lint
|
||||
check: lint
|
||||
- name: Format
|
||||
check: format
|
||||
- name: Test
|
||||
check: test
|
||||
- name: Build
|
||||
check: build
|
||||
- name: TypeScript
|
||||
check: typecheck
|
||||
- name: Spell Check
|
||||
check: spell
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
@@ -119,11 +122,22 @@ jobs:
|
||||
- name: Run ${{ matrix.name }}
|
||||
run: pnpm exec turbo run ${{ matrix.check }}
|
||||
|
||||
- name: Upload Build Artifact
|
||||
if: matrix.name == 'Build'
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: build-dist-${{ github.sha }}
|
||||
path: dist/
|
||||
|
||||
# We should depend on quality checks to save CI running time.
|
||||
playwright:
|
||||
name: Playwright Tests
|
||||
needs: [check_changes, setup]
|
||||
needs: [setup, quality_checks]
|
||||
if: ${{ needs.check_changes.outputs.exists == 'true' }}
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: mcr.microsoft.com/playwright:v1.54.1-noble
|
||||
options: --user 1001
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
@@ -146,10 +160,12 @@ jobs:
|
||||
key: ${{ runner.os }}-node-modules-${{ hashFiles('**/pnpm-lock.yaml') }}
|
||||
restore-keys: ${{ runner.os }}-node-modules-
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v4
|
||||
- name: Download Build Artifact
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
node-version: lts/*
|
||||
path: dist/
|
||||
pattern: build-dist*
|
||||
merge-multiple: true
|
||||
|
||||
- name: Setup pnpm
|
||||
uses: pnpm/action-setup@v4
|
||||
@@ -160,16 +176,6 @@ jobs:
|
||||
if: steps.cache.outputs.cache-hit != 'true'
|
||||
run: pnpm install --frozen-lockfile
|
||||
|
||||
- name: Cache Playwright Browsers
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ~/.cache/ms-playwright
|
||||
key: ${{ runner.os }}-playwright-${{ hashFiles('**/pnpm-lock.yaml') }}
|
||||
restore-keys: ${{ runner.os }}-playwright-
|
||||
|
||||
- name: Install Playwright Browsers
|
||||
run: pnpm exec playwright install --with-deps
|
||||
|
||||
- name: Run Playwright Tests
|
||||
run: pnpm exec turbo run test:playwright
|
||||
timeout-minutes: 10
|
||||
|
||||
Reference in New Issue
Block a user