Build and publish v4 lib/ and themes/ folders for backwards compatibility while users transition to v5.
#2735
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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@v6 | |
| - name: Setup Node.js ${{ matrix.node-version }} | |
| uses: actions/setup-node@v6 | |
| 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@v6 | |
| - name: Setup Node.js ${{ matrix.node-version }} | |
| uses: actions/setup-node@v6 | |
| 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/*'] | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Setup Node.js ${{ matrix.node-version }} | |
| uses: actions/setup-node@v6 | |
| 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: Test v4 build | |
| run: | | |
| 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@v6 | |
| if: failure() | |
| with: | |
| name: ${{ matrix.os }}-${{ matrix.node-version }}-artifacts | |
| path: | | |
| _playwright-results/ | |
| _playwright-report/ |