You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
vitepress/.github/workflows/ci.yml

59 lines
1.7 KiB

name: CI
env:
NODE_OPTIONS: --max-old-space-size=6144
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: '1'
VITEST_SEGFAULT_RETRY: 3
on:
push:
branches: [main]
pull_request:
branches: [main]
types: [opened, synchronize, reopened, labeled, ready_for_review]
workflow_dispatch:
permissions: {}
concurrency:
group: ${{ github.workflow }}-${{ github.event.number || github.sha }}
cancel-in-progress: true
jobs:
test:
if: github.event.action != 'labeled' || github.event.label.name == 'cr-tracked'
runs-on: ubuntu-latest
strategy:
matrix:
node_version: [18, 20, 22]
exclude:
- node_version: ${{ (github.event.action == 'labeled' || github.event.action == 'ready_for_review') && 18 }}
- node_version: ${{ (github.event.action == 'labeled' || github.event.action == 'ready_for_review') && 20 }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install pnpm
uses: pnpm/action-setup@v3
- name: Set node version to ${{ matrix.node_version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node_version }}
cache: pnpm
- name: Install deps
run: pnpm install
- name: Install Playwright
run: pnpm playwright install chromium
- name: Check
run: pnpm check
- name: Publish preview
if: matrix.node_version == 22 && github.event_name == 'pull_request' && github.event.action != 'reopened' && !github.event.pull_request.draft && contains(github.event.pull_request.labels.*.name, 'cr-tracked') && !contains(github.event.pull_request.labels.*.name, 'spam') && !contains(github.event.pull_request.labels.*.name, 'invalid')
run: pnpx pkg-pr-new publish --compact