Update build deps #6241
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
| # This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node | |
| # For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions | |
| name: Node.js CI | |
| on: | |
| push: | |
| branches: [ master ] | |
| pull_request: | |
| branches: [ master ] | |
| permissions: | |
| contents: read | |
| env: | |
| # Keep in sync with netlify.toml | |
| NODE_VERSION: 24.x | |
| jobs: | |
| install: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/setup-node@v7 | |
| with: | |
| node-version: ${{ env.NODE_VERSION }} | |
| cache: 'npm' | |
| - run: npm ci --no-audit --no-fund | |
| build: | |
| needs: install | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/setup-node@v7 | |
| with: | |
| node-version: ${{ env.NODE_VERSION }} | |
| cache: 'npm' | |
| - name: Cache BookReader/ | |
| uses: actions/cache@v4 | |
| id: build-cache | |
| with: | |
| # Cache the build files so we don't have to build twice for e2e tests | |
| path: 'BookReader' | |
| key: ${{ runner.os }}-${{ github.sha }} | |
| - if: steps.build-cache.outputs.cache-hit != 'true' | |
| run: npm ci --no-audit --no-fund && npm run build | |
| tests: | |
| needs: install | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/setup-node@v7 | |
| with: | |
| node-version: ${{ env.NODE_VERSION }} | |
| cache: 'npm' | |
| - run: npm ci --no-audit --no-fund | |
| - run: npm run lint | |
| - run: npm run test | |
| - uses: codecov/codecov-action@v4 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| e2e-tests: | |
| needs: build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/setup-node@v7 | |
| with: | |
| node-version: ${{ env.NODE_VERSION }} | |
| cache: 'npm' | |
| - run: npm ci --no-audit --no-fund | |
| - name: Load BookReader/ from cache | |
| uses: actions/cache@v4 | |
| with: | |
| # Cache the build files so we don't have to build twice for e2e tests | |
| path: 'BookReader' | |
| key: ${{ runner.os }}-${{ github.sha }} | |
| # GitHub Actions machines usually have 4 cores (see https://docs.github.com/en/actions/reference/runners/github-hosted-runners ) | |
| # Quarantine mode (sigh) to catch unstable tests (see https://devexpress.github.io/testcafe/documentation/guides/basic-guides/run-tests.html#quarantine-mode ) | |
| - run: npx testcafe --concurrency 4 --quarantine-mode |