GitHub Actions: Test on the latest macOS X64 and ARM64 #712
Workflow file for this run
This file contains 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
name: Test | |
on: | |
push: | |
paths-ignore: | |
- ".github/workflows/prebuild.yaml" | |
pull_request: | |
paths-ignore: | |
- ".github/workflows/prebuild.yaml" | |
jobs: | |
Linux: | |
name: Test on Linux | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
node: [18.12.0, 22] | |
steps: | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node }} | |
- uses: actions/checkout@v4 | |
- name: Install Dependencies | |
run: | | |
sudo apt update | |
sudo apt install -y libcairo2-dev libjpeg-dev libpango1.0-dev libgif-dev librsvg2-dev | |
- name: Install | |
run: npm install --build-from-source | |
- name: Test | |
run: npm test | |
Windows: | |
name: Test on Windows | |
runs-on: windows-2019 | |
strategy: | |
fail-fast: false | |
matrix: | |
# FIXME: Node.js 20.9.0 is currently broken on Windows, in the `registerFont` test: | |
# ENOENT: no such file or directory, lstat 'D:\a\node-canvas\node-canvas\examples\pfennigFont\pfennigMultiByte🚀.ttf' | |
# ref: https://github.com/nodejs/node/issues/48673 | |
# ref: https://github.com/nodejs/node/pull/50650 | |
node: [18.12.0, 20, 22] | |
steps: | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node }} | |
- uses: actions/checkout@v4 | |
- name: Install Dependencies | |
run: | | |
Invoke-WebRequest "https://ftp-osl.osuosl.org/pub/gnome/binaries/win64/gtk+/2.22/gtk+-bundle_2.22.1-20101229_win64.zip" -OutFile "gtk.zip" | |
Expand-Archive gtk.zip -DestinationPath "C:\GTK" | |
Invoke-WebRequest "https://downloads.sourceforge.net/project/libjpeg-turbo/2.0.4/libjpeg-turbo-2.0.4-vc64.exe" -OutFile "libjpeg.exe" -UserAgent NativeHost | |
.\libjpeg.exe /S | |
npm install -g node-gyp@8 | |
npm prefix -g | % {npm config set node_gyp "$_\node_modules\node-gyp\bin\node-gyp.js"} | |
- name: Install | |
run: npm install --build-from-source | |
- name: Test | |
run: npm test | |
macOS: | |
name: Test on macOS | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [macos-13, macos-latest] | |
node: [20, 22] # Node 18 on macOS has node-gyp < v10 which is incompatible with Python 3.12 | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node }} | |
- uses: actions/checkout@v4 | |
- name: Install Dependencies | |
run: | | |
brew update | |
brew install cairo giflib jpeg libpng librsvg pango pkg-config | |
pip install setuptools | |
- name: Install | |
run: npm install --build-from-source | |
- name: Test | |
run: npm test | |
Lint: | |
name: Lint | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 22 | |
- uses: actions/checkout@v4 | |
- name: Install | |
run: npm install --ignore-scripts | |
- name: Lint | |
run: npm run lint | |
- name: Lint Types | |
run: npm run tsd |