mirror of
https://github.com/docsifyjs/docsify.git
synced 2025-12-08 19:55:52 +00:00
81 lines
2.1 KiB
YAML
81 lines
2.1 KiB
YAML
name: Build & Test
|
|
|
|
on:
|
|
push:
|
|
branches: [main, develop]
|
|
pull_request:
|
|
branches: [main, develop]
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
lint:
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
node-version: ['lts/*']
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Setup Node.js ${{ matrix.node-version }}
|
|
uses: actions/setup-node@v3
|
|
with:
|
|
node-version: ${{ matrix.node-version }}
|
|
cache: 'npm'
|
|
- name: Install dependencies
|
|
run: npm ci --ignore-scripts
|
|
- name: Build
|
|
run: npm run build
|
|
- name: Lint
|
|
run: npm run lint
|
|
|
|
test-jest:
|
|
runs-on: ${{ matrix.os }}
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
node-version: ['lts/*']
|
|
os: ['macos-latest', 'ubuntu-latest', 'windows-latest']
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Setup Node.js ${{ matrix.node-version }}
|
|
uses: actions/setup-node@v3
|
|
with:
|
|
node-version: ${{ matrix.node-version }}
|
|
cache: 'npm'
|
|
- name: Install dependencies
|
|
run: npm ci --ignore-scripts
|
|
- name: Build
|
|
run: npm run build
|
|
- name: Unit Tests
|
|
run: npm run test:unit -- --ci --runInBand
|
|
- name: Integration Tests
|
|
run: npm run test:integration -- --ci --runInBand
|
|
|
|
test-playwright:
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
node-version: ['lts/*']
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Setup Node.js ${{ matrix.node-version }}
|
|
uses: actions/setup-node@v3
|
|
with:
|
|
node-version: ${{ matrix.node-version }}
|
|
cache: 'npm'
|
|
- name: Install dependencies
|
|
run: npm ci --ignore-scripts
|
|
- name: Build
|
|
run: npm run build
|
|
- name: Install Playwright
|
|
run: npx playwright install --with-deps
|
|
- name: E2E Tests (Playwright)
|
|
run: npm run test:e2e
|
|
- name: Store artifacts
|
|
uses: actions/upload-artifact@v4
|
|
if: failure()
|
|
with:
|
|
name: ${{ matrix.os }}-${{ matrix.node-version }}-artifacts
|
|
path: |
|
|
_playwright-results/
|
|
_playwright-report/
|