|
| 1 | +name: Fresh Install Tests |
| 2 | + |
| 3 | +# Periodically tests BlockNote with the latest versions of its dependencies |
| 4 | +# (within declared ranges), without a lockfile. This catches breakage when a |
| 5 | +# new release of a dep like @tiptap/* or prosemirror-* ships and conflicts |
| 6 | +# with BlockNote's declared ranges — the kind of failure a user would hit when |
| 7 | +# running `npm install @blocknote/react` in a fresh project. |
| 8 | +# |
| 9 | +# DevDependencies (vitest, vite, typescript, etc.) are still bounded by their |
| 10 | +# declared ranges in package.json; only prod/peer deps get freshly resolved. |
| 11 | + |
| 12 | +on: |
| 13 | + schedule: |
| 14 | + - cron: "0 2 * * *" # Daily at 02:00 UTC |
| 15 | + workflow_dispatch: # Allow manual runs |
| 16 | + |
| 17 | +jobs: |
| 18 | + fresh-install-unit-tests: |
| 19 | + name: Unit Tests (Fresh Dep Resolution) |
| 20 | + runs-on: ubuntu-latest |
| 21 | + timeout-minutes: 30 |
| 22 | + |
| 23 | + steps: |
| 24 | + - uses: actions/checkout@v4 |
| 25 | + |
| 26 | + - name: Install pnpm |
| 27 | + uses: pnpm/action-setup@v4 |
| 28 | + |
| 29 | + - uses: actions/setup-node@v4 |
| 30 | + with: |
| 31 | + node-version-file: ".nvmrc" |
| 32 | + # Intentionally no pnpm cache — we want a genuinely fresh install |
| 33 | + |
| 34 | + # Required for the `canvas` native dependency |
| 35 | + - name: Install system dependencies |
| 36 | + run: sudo apt-get update && sudo apt-get install -y build-essential libcairo2-dev libpango1.0-dev libjpeg-dev libgif-dev librsvg2-dev pkg-config |
| 37 | + |
| 38 | + - name: Remove lockfile to force fresh dep resolution |
| 39 | + # Removing pnpm-lock.yaml causes pnpm to resolve all dependencies to |
| 40 | + # the latest versions that satisfy the ranges declared in package.json |
| 41 | + # (including pnpm-workspace.yaml overrides). This is equivalent to what |
| 42 | + # a new user experiences when installing BlockNote in a blank project. |
| 43 | + run: rm pnpm-lock.yaml |
| 44 | + |
| 45 | + - name: Install dependencies |
| 46 | + run: pnpm install --no-frozen-lockfile |
| 47 | + |
| 48 | + - name: Build packages |
| 49 | + run: pnpm run build |
| 50 | + env: |
| 51 | + NX_SKIP_NX_CACHE: "true" |
| 52 | + |
| 53 | + - name: Run unit tests |
| 54 | + run: pnpm run test |
| 55 | + env: |
| 56 | + NX_SKIP_NX_CACHE: "true" |
0 commit comments