-
-
Notifications
You must be signed in to change notification settings - Fork 699
ci: daily fresh-install unit tests to catch dep range breakage #2579
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+56
−0
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| name: Fresh Install Tests | ||
|
|
||
| # Periodically tests BlockNote with the latest versions of its dependencies | ||
| # (within declared ranges), without a lockfile. This catches breakage when a | ||
| # new release of a dep like @tiptap/* or prosemirror-* ships and conflicts | ||
| # with BlockNote's declared ranges — the kind of failure a user would hit when | ||
| # running `npm install @blocknote/react` in a fresh project. | ||
| # | ||
| # DevDependencies (vitest, vite, typescript, etc.) are still bounded by their | ||
| # declared ranges in package.json; only prod/peer deps get freshly resolved. | ||
|
|
||
| on: | ||
| schedule: | ||
| - cron: "0 2 * * *" # Daily at 02:00 UTC | ||
| workflow_dispatch: # Allow manual runs | ||
|
|
||
| jobs: | ||
| fresh-install-unit-tests: | ||
| name: Unit Tests (Fresh Dep Resolution) | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 30 | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - name: Install pnpm | ||
| uses: pnpm/action-setup@v4 | ||
|
|
||
| - uses: actions/setup-node@v4 | ||
| with: | ||
| node-version-file: ".nvmrc" | ||
| # Intentionally no pnpm cache — we want a genuinely fresh install | ||
|
|
||
| # Required for the `canvas` native dependency | ||
| - name: Install system dependencies | ||
| 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 | ||
|
|
||
| - name: Remove lockfile to force fresh dep resolution | ||
| # Removing pnpm-lock.yaml causes pnpm to resolve all dependencies to | ||
| # the latest versions that satisfy the ranges declared in package.json | ||
| # (including pnpm-workspace.yaml overrides). This is equivalent to what | ||
| # a new user experiences when installing BlockNote in a blank project. | ||
| run: rm pnpm-lock.yaml | ||
|
|
||
| - name: Install dependencies | ||
| run: pnpm install --no-frozen-lockfile | ||
|
|
||
| - name: Build packages | ||
| run: pnpm run build | ||
| env: | ||
| NX_SKIP_NX_CACHE: "true" | ||
|
|
||
| - name: Run unit tests | ||
| run: pnpm run test | ||
| env: | ||
| NX_SKIP_NX_CACHE: "true" | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Set explicit least-privilege
permissionsfor this workflow.Right now token scope is inherited from repo/org defaults. Since this job only checks out code and runs tests, you can reduce risk by explicitly granting read-only access.
Suggested hardening
🤖 Prompt for AI Agents