Skip to content

Commit 9b2e6ea

Browse files
authored
build: remove canvas native dependency from CI (#2642)
1 parent 052498c commit 9b2e6ea

File tree

10 files changed

+96
-61
lines changed

10 files changed

+96
-61
lines changed

.github/workflows/build.yml

Lines changed: 23 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ on:
77
types: [opened, synchronize, reopened, edited]
88

99
env:
10+
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
1011
NX_SELF_HOSTED_REMOTE_CACHE_ACCESS_TOKEN: ${{ secrets.NX_SELF_HOSTED_REMOTE_CACHE_ACCESS_TOKEN }}
1112
NX_SELF_HOSTED_REMOTE_CACHE_SERVER: ${{ secrets.NX_SELF_HOSTED_REMOTE_CACHE_SERVER }}
1213

@@ -16,23 +17,23 @@ jobs:
1617
runs-on: ubuntu-latest
1718
timeout-minutes: 60
1819
steps:
19-
- uses: actions/checkout@v4
20+
- uses: actions/checkout@v6
2021
with:
2122
fetch-depth: 100
2223

2324
- name: Install pnpm
24-
uses: pnpm/action-setup@v4
25+
uses: pnpm/action-setup@v5
2526

26-
- uses: nrwl/nx-set-shas@v3
27+
- uses: nrwl/nx-set-shas@v5
2728

28-
- uses: actions/setup-node@v4
29+
- uses: actions/setup-node@v6
2930
with:
3031
cache: "pnpm"
3132
cache-dependency-path: "**/pnpm-lock.yaml"
3233
node-version-file: ".nvmrc"
3334

3435
- name: Cache NX
35-
uses: actions/cache@v4
36+
uses: actions/cache@v5
3637
with:
3738
path: .nx/cache
3839
key: nx-${{ env.NX_BRANCH }}-${{ env.NX_RUN_GROUP }}-${{ github.sha }}
@@ -41,8 +42,6 @@ jobs:
4142
nx-${{ env.NX_BRANCH }}-
4243
nx-
4344
44-
# This is needed for the canvas dep, Tiptap V3 should remove the need for this
45-
- 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
4645
- name: Install Dependencies
4746
run: pnpm install
4847

@@ -73,23 +72,23 @@ jobs:
7372
runs-on: ubuntu-latest
7473
timeout-minutes: 30
7574
steps:
76-
- uses: actions/checkout@v4
75+
- uses: actions/checkout@v6
7776
with:
7877
fetch-depth: 100
7978

8079
- name: Install pnpm
81-
uses: pnpm/action-setup@v4
80+
uses: pnpm/action-setup@v5
8281

83-
- uses: nrwl/nx-set-shas@v3
82+
- uses: nrwl/nx-set-shas@v5
8483

85-
- uses: actions/setup-node@v4
84+
- uses: actions/setup-node@v6
8685
with:
8786
cache: "pnpm"
8887
cache-dependency-path: "**/pnpm-lock.yaml"
8988
node-version-file: ".nvmrc"
9089

9190
- name: Cache NX
92-
uses: actions/cache@v4
91+
uses: actions/cache@v5
9392
with:
9493
path: .nx/cache
9594
key: nx-playwright-${{ env.NX_BRANCH }}-${{ env.NX_RUN_GROUP }}-${{ github.sha }}
@@ -98,16 +97,14 @@ jobs:
9897
nx-playwright-${{ env.NX_BRANCH }}-
9998
nx-
10099
101-
- 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
102-
103100
- name: Install dependencies
104101
run: pnpm install
105102

106103
- name: Build packages
107104
run: pnpm run build
108105

109106
- name: Upload build artifacts
110-
uses: actions/upload-artifact@v4
107+
uses: actions/upload-artifact@v7
111108
with:
112109
name: playwright-build
113110
path: |
@@ -129,21 +126,21 @@ jobs:
129126
shardIndex: [1, 2]
130127
shardTotal: [2]
131128
steps:
132-
- uses: actions/checkout@v4
129+
- uses: actions/checkout@v6
133130
with:
134131
fetch-depth: 100
135132

136133
- name: Install pnpm
137-
uses: pnpm/action-setup@v4
134+
uses: pnpm/action-setup@v5
138135

139-
- uses: actions/setup-node@v4
136+
- uses: actions/setup-node@v6
140137
with:
141138
cache: "pnpm"
142139
cache-dependency-path: "**/pnpm-lock.yaml"
143140
node-version-file: ".nvmrc"
144141

145142
- name: Download build artifacts
146-
uses: actions/download-artifact@v4
143+
uses: actions/download-artifact@v8
147144
with:
148145
name: playwright-build
149146

@@ -155,15 +152,15 @@ jobs:
155152
HOME=/root PLAYWRIGHT_CONFIG="--project ${{ matrix.browser }} --shard=${{ matrix.shardIndex }}/${{ matrix.shardTotal }}" pnpm run e2e
156153
157154
- name: Upload blob report
158-
uses: actions/upload-artifact@v4
155+
uses: actions/upload-artifact@v7
159156
if: ${{ !cancelled() }}
160157
with:
161158
name: blob-report-${{ matrix.browser }}-${{ matrix.shardIndex }}
162159
path: tests/blob-report/
163160
retention-days: 1
164161

165162
- name: Upload HTML report
166-
uses: actions/upload-artifact@v4
163+
uses: actions/upload-artifact@v7
167164
if: ${{ !cancelled() }}
168165
with:
169166
name: playwright-report-${{ matrix.browser }}-${{ matrix.shardIndex }}
@@ -176,12 +173,12 @@ jobs:
176173
needs: playwright
177174
runs-on: ubuntu-latest
178175
steps:
179-
- uses: actions/checkout@v4
176+
- uses: actions/checkout@v6
180177

181178
- name: Install pnpm
182-
uses: pnpm/action-setup@v4
179+
uses: pnpm/action-setup@v5
183180

184-
- uses: actions/setup-node@v4
181+
- uses: actions/setup-node@v6
185182
with:
186183
cache: "pnpm"
187184
cache-dependency-path: "**/pnpm-lock.yaml"
@@ -191,7 +188,7 @@ jobs:
191188
run: pnpm install
192189

193190
- name: Download blob reports
194-
uses: actions/download-artifact@v4
191+
uses: actions/download-artifact@v8
195192
with:
196193
path: tests/all-blob-reports
197194
pattern: blob-report-*
@@ -202,7 +199,7 @@ jobs:
202199
working-directory: tests
203200

204201
- name: Upload merged HTML report
205-
uses: actions/upload-artifact@v4
202+
uses: actions/upload-artifact@v7
206203
with:
207204
name: playwright-report-merged
208205
path: tests/playwright-report/

.github/workflows/fresh-install-tests.yml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,27 +14,26 @@ on:
1414
- cron: "0 2 * * *" # Daily at 02:00 UTC
1515
workflow_dispatch: # Allow manual runs
1616

17+
env:
18+
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
19+
1720
jobs:
1821
fresh-install-unit-tests:
1922
name: Unit Tests (Fresh Dep Resolution)
2023
runs-on: ubuntu-latest
2124
timeout-minutes: 30
2225

2326
steps:
24-
- uses: actions/checkout@v4
27+
- uses: actions/checkout@v6
2528

2629
- name: Install pnpm
27-
uses: pnpm/action-setup@v4
30+
uses: pnpm/action-setup@v5
2831

29-
- uses: actions/setup-node@v4
32+
- uses: actions/setup-node@v6
3033
with:
3134
node-version-file: ".nvmrc"
3235
# Intentionally no pnpm cache — we want a genuinely fresh install
3336

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-
3837
- name: Remove lockfile to force fresh dep resolution
3938
# Removing pnpm-lock.yaml causes pnpm to resolve all dependencies to
4039
# the latest versions that satisfy the ranges declared in package.json

.github/workflows/publish.yaml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ on:
1414
type: string
1515

1616
env:
17+
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
1718
NX_SELF_HOSTED_REMOTE_CACHE_ACCESS_TOKEN: ${{ secrets.NX_SELF_HOSTED_REMOTE_CACHE_ACCESS_TOKEN }}
1819
NX_SELF_HOSTED_REMOTE_CACHE_SERVER: ${{ secrets.NX_SELF_HOSTED_REMOTE_CACHE_SERVER }}
1920

@@ -27,7 +28,7 @@ jobs:
2728
attestations: write
2829
timeout-minutes: 10
2930
steps:
30-
- uses: actions/checkout@v4
31+
- uses: actions/checkout@v6
3132
with:
3233
ref: ${{ inputs.version }}
3334
fetch-depth: 100
@@ -39,20 +40,20 @@ jobs:
3940
id: package-manager-version
4041

4142
- name: Install pnpm
42-
uses: pnpm/action-setup@v4
43+
uses: pnpm/action-setup@v5
4344
with:
4445
version: ${{ steps.package-manager-version.outputs.stdout }}
4546

46-
- uses: nrwl/nx-set-shas@v3
47+
- uses: nrwl/nx-set-shas@v5
4748

48-
- uses: actions/setup-node@v4
49+
- uses: actions/setup-node@v6
4950
with:
5051
cache: "pnpm"
5152
cache-dependency-path: "**/pnpm-lock.yaml"
5253
node-version-file: ".nvmrc"
5354

5455
- name: Cache NX
55-
uses: actions/cache@v4
56+
uses: actions/cache@v5
5657
with:
5758
path: .nx/cache
5859
key: nx-${{ env.NX_BRANCH }}-${{ env.NX_RUN_GROUP }}-${{ github.sha }}
@@ -61,8 +62,6 @@ jobs:
6162
nx-${{ env.NX_BRANCH }}-
6263
nx-
6364
64-
- 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
65-
6665
- name: Install Dependencies & Build
6766
run: pnpm install && pnpm build
6867

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
},
2121
"pnpm": {
2222
"ignoredBuiltDependencies": [
23+
"canvas",
2324
"sharp",
2425
"workerd"
2526
],
@@ -28,7 +29,6 @@
2829
"@sentry/cli",
2930
"@tailwindcss/oxide",
3031
"better-sqlite3",
31-
"canvas",
3232
"esbuild",
3333
"msw",
3434
"nx",

pnpm-lock.yaml

Lines changed: 17 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/nextjs-test-app/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
"private": true,
44
"version": "0.0.0",
55
"dependencies": {
6-
"@blocknote/core": "file:.tarballs/blocknote-core-0.47.1.tgz",
7-
"@blocknote/mantine": "file:.tarballs/blocknote-mantine-0.47.1.tgz",
8-
"@blocknote/react": "file:.tarballs/blocknote-react-0.47.1.tgz",
9-
"@blocknote/server-util": "file:.tarballs/blocknote-server-util-0.47.1.tgz",
6+
"@blocknote/core": "file:.tarballs/blocknote-core-0.47.3.tgz",
7+
"@blocknote/mantine": "file:.tarballs/blocknote-mantine-0.47.3.tgz",
8+
"@blocknote/react": "file:.tarballs/blocknote-react-0.47.3.tgz",
9+
"@blocknote/server-util": "file:.tarballs/blocknote-server-util-0.47.3.tgz",
1010
"@mantine/core": "^8.3.11",
1111
"@mantine/hooks": "^8.3.11",
1212
"next": "^16.0.0",

tests/nextjs-test-app/setup.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ EOF
5858

5959
# Install with npm (not pnpm — avoid workspace resolution)
6060
rm -rf node_modules .next package-lock.json
61-
npm install
61+
npm install --ignore-scripts
6262

6363
# Save hash for next run
6464
echo "$CURRENT_HASH" > "$HASH_FILE"

tests/nextjs-test-app/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"incremental": true,
1414
"module": "esnext",
1515
"esModuleInterop": true,
16-
"moduleResolution": "node",
16+
"moduleResolution": "bundler",
1717
"resolveJsonModule": true,
1818
"isolatedModules": true,
1919
"jsx": "react-jsx",

0 commit comments

Comments
 (0)