Skip to content

Commit

Permalink
Add support for canvas v3
Browse files Browse the repository at this point in the history
For now, we support both v2 and v3, since they both seem to work. We'd prefer to only support one major version for ease of maintenance, but currently v3 is in the RC stage, and v2 doesn't work with the latest versions of Node.js, so this seems worthwhile until v3 graduates to a full release.

Closes #3795.
  • Loading branch information
alumni authored Dec 20, 2024
1 parent 8dfe288 commit 8955c99
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 11 deletions.
14 changes: 11 additions & 3 deletions .github/workflows/jsdom-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,21 +29,29 @@ jobs:
env:
TEST_SUITE: 'node-canvas'
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- node-version: '20'
canvas-version: '^2.11.2'
- node-version: '22'
canvas-version: '^3.0.0-rc3'
steps:
- uses: actions/checkout@v4
with:
submodules: 'recursive'
- uses: actions/setup-node@v4
with:
node-version: '20'
node-version: ${{ matrix.node-version }}
- name: Install required image manipulation packages with APT
run: sudo apt-get install build-essential libcairo2-dev libpango1.0-dev libjpeg-dev libgif-dev librsvg2-dev
- name: Setup HOSTS file for Web Platform Test server
run: ./test/web-platform-tests/tests/wpt make-hosts-file | sudo tee -a /etc/hosts
- name: Install dependencies
run: npm ci
run: npm ci && npm install canvas@${{ matrix.canvas-version }}
- name: Run tests
run: npm install canvas && npm test -- --retries 1
run: npm test -- --retries 1
build:
name: Tests
runs-on: ubuntu-latest
Expand Down
14 changes: 7 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"xml-name-validator": "^5.0.0"
},
"peerDependencies": {
"canvas": "^2.11.2"
"canvas": "^2.11.2 || ^3.0.0-rc3"
},
"peerDependenciesMeta": {
"canvas": {
Expand Down

0 comments on commit 8955c99

Please sign in to comment.