mirror of
https://github.com/zen-browser/www.git
synced 2025-07-07 08:55:32 +02:00
177 lines
4.5 KiB
YAML
177 lines
4.5 KiB
YAML
name: CI Pipeline
|
|
on:
|
|
pull_request:
|
|
types: [opened, synchronize, reopened]
|
|
|
|
concurrency:
|
|
group: ci-pipeline-${{ github.head_ref }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
setup:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: actions/setup-node@v4
|
|
with:
|
|
node-version: lts/*
|
|
- uses: pnpm/action-setup@v4
|
|
with:
|
|
version: 10.11.0
|
|
- name: Cache node_modules
|
|
id: cache-deps
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: |
|
|
.turbo
|
|
node_modules
|
|
key: ${{ runner.os }}-pnpm-${{ hashFiles('pnpm-lock.yaml') }}
|
|
- name: Verify pnpm installation
|
|
run: pnpm --version
|
|
- name: Install dependencies
|
|
run: pnpm install --frozen-lockfile
|
|
|
|
eslint:
|
|
runs-on: ubuntu-latest
|
|
needs: setup
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 22
|
|
- uses: pnpm/action-setup@v4
|
|
with:
|
|
version: 10.11.0
|
|
- name: Restore node_modules from cache
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: |
|
|
.turbo
|
|
node_modules
|
|
key: ${{ runner.os }}-pnpm-${{ hashFiles('pnpm-lock.yaml') }}
|
|
- name: Run Eslint check
|
|
run: turbo run lint
|
|
|
|
prettier:
|
|
runs-on: ubuntu-latest
|
|
needs: setup
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: actions/setup-node@v4
|
|
with:
|
|
node-version: lts/*
|
|
- uses: pnpm/action-setup@v4
|
|
with:
|
|
version: 10.11.0
|
|
- name: Restore node_modules from cache
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: |
|
|
.turbo
|
|
node_modules
|
|
key: ${{ runner.os }}-pnpm-${{ hashFiles('pnpm-lock.yaml') }}
|
|
- name: Run Prettier check
|
|
run: turbo run format
|
|
|
|
cspell:
|
|
runs-on: ubuntu-latest
|
|
needs: setup
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: actions/setup-node@v4
|
|
with:
|
|
node-version: lts/*
|
|
- uses: pnpm/action-setup@v4
|
|
with:
|
|
version: 10.11.0
|
|
- name: Restore node_modules from cache
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: |
|
|
.turbo
|
|
node_modules
|
|
key: ${{ runner.os }}-pnpm-${{ hashFiles('pnpm-lock.yaml') }}
|
|
- name: Run cspell check
|
|
run: turbo run spell
|
|
|
|
vitest:
|
|
runs-on: ubuntu-latest
|
|
needs: setup
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: actions/setup-node@v4
|
|
with:
|
|
node-version: lts/*
|
|
- uses: pnpm/action-setup@v4
|
|
with:
|
|
version: 10.11.0
|
|
- name: Restore node_modules from cache
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: |
|
|
.turbo
|
|
node_modules
|
|
key: ${{ runner.os }}-pnpm-${{ hashFiles('pnpm-lock.yaml') }}
|
|
- name: Run Vitest tests
|
|
run: turbo vitest run
|
|
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
needs: setup
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: actions/setup-node@v4
|
|
with:
|
|
node-version: lts/*
|
|
- uses: pnpm/action-setup@v4
|
|
with:
|
|
version: 10.11.0
|
|
- name: Restore node_modules from cache
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: |
|
|
.turbo
|
|
node_modules
|
|
key: ${{ runner.os }}-pnpm-${{ hashFiles('pnpm-lock.yaml') }}
|
|
- name: Build project
|
|
run: turbo run build
|
|
- name: Upload build output
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: build
|
|
path: |
|
|
dist
|
|
|
|
playwright:
|
|
runs-on: ubuntu-latest
|
|
needs: build
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
- uses: actions/setup-node@v4
|
|
with:
|
|
node-version: lts/*
|
|
- uses: pnpm/action-setup@v4
|
|
with:
|
|
version: 10.11.0
|
|
- name: Restore node_modules from cache
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: |
|
|
.turbo
|
|
node_modules
|
|
key: ${{ runner.os }}-pnpm-${{ hashFiles('pnpm-lock.yaml') }}
|
|
- name: Install dependencies
|
|
run: pnpm install --frozen-lockfile
|
|
- name: Install Playwright Browsers
|
|
run: pnpm exec playwright install --with-deps
|
|
- name: Download build output
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
name: build
|
|
path: dist
|
|
- name: Run Playwright tests
|
|
run: turbo run test:playwright
|