-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Master - add test prebuilds #2453
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
Open
btsimonh
wants to merge
2
commits into
Automattic:master
Choose a base branch
from
btsimonh:masteraddtestprebuilds
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+204
−0
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
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,204 @@ | ||||||
| # This workflow just installs canvas and tests it. | ||||||
|
|
||||||
| name: Test Prebuilds | ||||||
| on: | ||||||
| workflow_dispatch: | ||||||
| inputs: | ||||||
| os: | ||||||
| description: 'Target os' | ||||||
| required: true | ||||||
| type: choice | ||||||
| options: | ||||||
| - '["ubuntu-latest"]' | ||||||
| - '["windows-latest"]' | ||||||
| - '["macos-13"]' | ||||||
| - '["macos-latest"]' | ||||||
| - '["ubuntu-latest", "windows-latest", "macos-13", "macos-latest"]' | ||||||
| default: '["ubuntu-latest", "windows-latest", "macos-13", "macos-latest"]' | ||||||
| canvas: | ||||||
| description: 'Target node-canvas version' | ||||||
| required: true | ||||||
| type: choice | ||||||
| # add releases here. e.g. | ||||||
| #options: | ||||||
| # - '["vdev"]' | ||||||
| # - '["v3.0.0-rc2"]' | ||||||
| # - '["vdev", "v3.0.0-rc2"]' | ||||||
| #default: '["vdev", "v3.0.0-rc2"]' | ||||||
|
|
||||||
| options: | ||||||
| - '["v3.0.0-rc2"]' | ||||||
| default: '["v3.0.0-rc2"]' | ||||||
| node: | ||||||
| description: 'Target node version' | ||||||
| required: true | ||||||
| type: choice | ||||||
| options: | ||||||
| - '["18"]' | ||||||
| - '["20"]' | ||||||
| - '["21"]' | ||||||
| - '["22"]' | ||||||
| - '["18", "20", "22"]' | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 23, 24, 25? |
||||||
| default: '["18", "20", "22"]' | ||||||
|
|
||||||
|
|
||||||
|
|
||||||
| # UPLOAD_TO can be specified to upload the release assets under a different tag | ||||||
| # name (e.g. for testing). If omitted, the assets are published under the same | ||||||
| # release tag as the canvas version being built. | ||||||
| # env: | ||||||
| # UPLOAD_TO: "v0.0.1" | ||||||
|
|
||||||
| # Node 19 requires a recent node-gyp | ||||||
| # Node 10, 11 require 8 | ||||||
| # Node 8, 9 require 6.1 | ||||||
| # Manually set this file depending on what you're building!! | ||||||
|
|
||||||
| jobs: | ||||||
| Linux: | ||||||
| strategy: | ||||||
| fail-fast: false | ||||||
| matrix: | ||||||
| node: ${{ fromJson(inputs.node) }} | ||||||
| canvas_tag: ${{ fromJson(inputs.canvas) }} # e.g. "v2.6.1" | ||||||
| name: ${{ matrix.canvas_tag }}, Node.js ${{ matrix.node }}, Linux | ||||||
| runs-on: ubuntu-latest | ||||||
| if: contains(fromJson(inputs.os), 'ubuntu-latest') | ||||||
| env: | ||||||
| CANVAS_VERSION_TO_BUILD: ${{ matrix.canvas_tag }} | ||||||
| steps: | ||||||
| - uses: actions/checkout@v2 | ||||||
| with: | ||||||
| ref: ${{ matrix.canvas_tag }} | ||||||
|
|
||||||
| - uses: actions/setup-node@v1 | ||||||
| with: | ||||||
| node-version: ${{ matrix.node }} | ||||||
|
|
||||||
| - name: Build | ||||||
| run: | | ||||||
| npm install | ||||||
|
|
||||||
| - name: Test binary | ||||||
| continue-on-error: true | ||||||
| run: | | ||||||
| set -ex | ||||||
| cd /root/harfbuzz-* && make uninstall | ||||||
| cd /root/cairo-* && make uninstall | ||||||
| cd /root/pango-* && cd _build && ninja uninstall | ||||||
| cd /root/libpng-* && make uninstall | ||||||
| cd /root/libjpeg-* && cd b && make uninstall | ||||||
| cd /root/giflib-* && make uninstall | ||||||
|
|
||||||
| cd $GITHUB_WORKSPACE | ||||||
| npx mocha test/*.test.js | ||||||
|
|
||||||
| macOSarm: | ||||||
| strategy: | ||||||
| fail-fast: false | ||||||
| matrix: | ||||||
| node: ${{ fromJson(inputs.node) }} | ||||||
| canvas_tag: ${{ fromJson(inputs.canvas) }} # e.g. "v2.6.1" | ||||||
| name: ${{ matrix.canvas_tag}}, Node.js ${{ matrix.node }}, macOSarm64 | ||||||
| runs-on: macos-latest # macos-14+ is M1 | ||||||
| if: contains(fromJson(inputs.os), 'macos-latest') | ||||||
| env: | ||||||
| CANVAS_VERSION_TO_BUILD: ${{ matrix.canvas_tag }} | ||||||
| steps: | ||||||
| - uses: actions/checkout@v2 | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| with: | ||||||
| ref: ${{ matrix.canvas_tag }} | ||||||
| # Fetch all commits/all branches so we can checkout the prebuild | ||||||
| # branch's files | ||||||
| fetch-depth: 0 | ||||||
|
|
||||||
| - uses: actions/setup-node@v1 | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| with: | ||||||
| node-version: ${{ matrix.node }} | ||||||
|
|
||||||
| - name: Build | ||||||
| run: | | ||||||
| set -Eeuxo pipefail | ||||||
| git checkout ${{ matrix.canvas_tag }} | ||||||
| npm install | ||||||
|
|
||||||
| - name: Test binary | ||||||
| run: | | ||||||
| brew uninstall --force --ignore-dependencies cairo pango librsvg giflib harfbuzz | ||||||
| npm test | ||||||
|
|
||||||
| macOS: | ||||||
| strategy: | ||||||
| fail-fast: false | ||||||
| matrix: | ||||||
| node: ${{ fromJson(inputs.node) }} | ||||||
| canvas_tag: ${{ fromJson(inputs.canvas) }} # e.g. "v2.6.1" | ||||||
| name: ${{ matrix.canvas_tag}}, Node.js ${{ matrix.node }}, macOS | ||||||
| runs-on: macos-13 # macos-14+ is M1 | ||||||
| if: contains(fromJson(inputs.os), 'macos-13') | ||||||
| env: | ||||||
| CANVAS_VERSION_TO_BUILD: ${{ matrix.canvas_tag }} | ||||||
| steps: | ||||||
| - uses: actions/checkout@v2 | ||||||
| with: | ||||||
| ref: ${{ matrix.canvas_tag }} | ||||||
| # Fetch all commits/all branches so we can checkout the prebuild | ||||||
| # branch's files | ||||||
| fetch-depth: 0 | ||||||
|
|
||||||
| - uses: actions/setup-node@v1 | ||||||
| with: | ||||||
| node-version: ${{ matrix.node }} | ||||||
|
|
||||||
| - name: Build | ||||||
| run: | | ||||||
| set -Eeuxo pipefail | ||||||
| git checkout ${{ matrix.canvas_tag }} | ||||||
| npm install | ||||||
|
|
||||||
| - name: Test binary | ||||||
| run: | | ||||||
| brew uninstall --force --ignore-dependencies cairo pango librsvg giflib harfbuzz | ||||||
| npm test | ||||||
|
|
||||||
| Win: | ||||||
| strategy: | ||||||
| fail-fast: false | ||||||
| matrix: | ||||||
| node: ${{ fromJson(inputs.node) }} | ||||||
| canvas_tag: ${{ fromJson(inputs.canvas) }} # e.g. "v2.6.1" | ||||||
| name: ${{ matrix.canvas_tag}}, Node.js ${{ matrix.node }}, Windows | ||||||
| runs-on: windows-latest | ||||||
| if: contains(fromJson(inputs.os), 'windows-latest') | ||||||
| env: | ||||||
| CANVAS_VERSION_TO_BUILD: ${{ matrix.canvas_tag }} | ||||||
| steps: | ||||||
| # GitHub runners now have msys2 installed, but msys is not on the path and | ||||||
| # is apparently slow to start. | ||||||
| # https://github.com/msys2/setup-msys2#setup-msys2 | ||||||
| # https://github.com/actions/virtual-environments/pull/632 | ||||||
| - uses: msys2/setup-msys2@v2 | ||||||
| with: | ||||||
| msystem: UCRT64 | ||||||
| update: true | ||||||
| path-type: inherit | ||||||
|
|
||||||
| - uses: actions/setup-node@v3 | ||||||
| with: | ||||||
| node-version: ${{ matrix.node }} | ||||||
|
|
||||||
| - uses: actions/checkout@v3 | ||||||
| with: | ||||||
| ref: ${{ matrix.canvas_tag }} | ||||||
| # Fetch all commits/all branches so we can checkout the prebuild | ||||||
| # branch's files | ||||||
| fetch-depth: 0 | ||||||
|
|
||||||
| - name: Build | ||||||
| run: | | ||||||
| git checkout ${{ matrix.canvas_tag }} | ||||||
| npm install | ||||||
|
|
||||||
| - name: Test binary | ||||||
| # By not running in msys2, this doesn't have access to the msys2 libs | ||||||
| run: npm test | ||||||
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.
Replace GitHub Actions runner image
macos-13withmacos-15-intelas recommended in:The currently available GitHub Actions macOS runners are: