mirror of
https://github.com/docsifyjs/docsify.git
synced 2026-10-17 04:31:18 +08:00
a49115d6d1
Signed-off-by: dependabot[bot] <support@github.com>
103 lines
2.9 KiB
YAML
103 lines
2.9 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@v7
|
|
- name: Setup Node.js ${{ matrix.node-version }}
|
|
uses: actions/setup-node@v7
|
|
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@v7
|
|
- name: Setup Node.js ${{ matrix.node-version }}
|
|
uses: actions/setup-node@v7
|
|
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
|
|
- name: Consumption Tests
|
|
run: npm run test:consume-types
|
|
|
|
test-playwright:
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
node-version: ['lts/*']
|
|
timeout-minutes: 30
|
|
steps:
|
|
- uses: actions/checkout@v7
|
|
- name: Setup Node.js ${{ matrix.node-version }}
|
|
uses: actions/setup-node@v7
|
|
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
|
|
|
|
# In the interest of not having to modify GitHub settings to update required
|
|
# builds for passing, I stuck this test here.
|
|
- name: Test v4 build
|
|
run: |
|
|
git fetch --tags
|
|
npm run build:v4
|
|
# ensure v4 build files exist:
|
|
test -f lib/docsify.js
|
|
test -f themes/pure.css
|
|
# ensure no git changes after building v4:
|
|
git diff --exit-code
|
|
npm run clean:v4
|
|
# ensure v4 build files are removed:
|
|
test ! -f lib/docsify.js
|
|
test ! -f themes/pure.css
|
|
# ensure no git changes after cleaning v4:
|
|
git diff --exit-code
|
|
|
|
- name: Store artifacts
|
|
uses: actions/upload-artifact@v7
|
|
if: failure()
|
|
with:
|
|
name: ${{ matrix.os }}-${{ matrix.node-version }}-artifacts
|
|
path: |
|
|
_playwright-results/
|
|
_playwright-report/
|