Skip to content

libpng-dev is missing from some runners #1393

libpng-dev is missing from some runners

libpng-dev is missing from some runners #1393

Workflow file for this run

name: Development CI
on:
push:
branches: ["*"]
paths-ignore:
- 'CHANGELOG.md'
- 'README.md'
pull_request:
branches: main
paths-ignore:
- 'CHANGELOG.md'
- 'README.md'
jobs:
lint:
runs-on: ubuntu-latest
name: Lint
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install the dependencies
run: npm install --skip-magickwand-native --skip-magickwand-wasm
- name: Lint
run: npm run lint
swig:
runs-on: ubuntu-latest
name: Generate the SWIG wrappers
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: true
- uses: mmomtchev/setup-swig@main
with:
branch: jse
version: v5.0.5
- name: Verify SWIG
run: swig-jse -version
- name: Run SWIG to generated the wrappers
run: npx xpm run generate
- name: Upload SWIG-generated wrappers
uses: actions/upload-artifact@v4
with:
name: swig
path: swig/*
native:
runs-on: ${{ matrix.platform }}
needs: swig
strategy:
fail-fast: false
matrix:
platform:
- ubuntu-20.04
- ubuntu-22.04
- ubuntu-24.04
- macos-12
- macos-latest
- windows-latest
dependencies:
- system
- conan
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: true
- name: Use Node.js 18.x
uses: actions/setup-node@v4
with:
node-version: 18.x
- name: Download the SWIG-generated wrappers
uses: actions/download-artifact@v4
with:
name: swig
path: swig
- name: Install the xpacks
run: |
npm install xpm
npx xpm install
- name: Get conan home
shell: bash
id: conan_home
run: |
npx xpm run -q conan -- version
echo path=`npx xpm run -q conan -- config home` >> $GITHUB_OUTPUT
- name: Cache conan artifacts
id: conan-artifacts
uses: actions/cache@v4
with:
path: ${{ steps.conan_home.outputs.path }}
key: conan-${{ matrix.platform }}
- name: Install fonts on Ubuntu
run: sudo apt-get install -y fonts-ubuntu || true
if: startsWith(matrix.platform, 'ubuntu')
- name: Install libpng-dev and libjpeg-dev on Ubuntu 24.04
run: sudo apt-get install -y libpng-dev libjpeg-dev
if: matrix.platform == 'ubuntu-24.04' && matrix.dependencies == 'system'
- name: Do not use GHA pkg-config on Windows
shell: bash
run: rm `which pkg-config`*
if: runner.os == 'Windows'
- name: Build magickwand.js
run: npm install --build-from-source --verbose --foreground-scripts --skip-magickwand-wasm ${{ matrix.dependencies == 'conan' && '--enable-conan' || '--disable-conan' }}
# Because of https://github.com/mmomtchev/hadron/issues/37
env:
C_INCLUDE_PATH: /usr/local/include
CPLUS_INCLUDE_PATH: /usr/local/include
- name: Locate addon file
shell: bash
id: addon
run: node -p '"addon=" + path.resolve(__dirname, "lib", "binding", `${os.platform()}-${os.arch()}`, "magickwand.node")' >> $GITHUB_OUTPUT
- name: List linked libraries (Linux)
run: ldd ${{ steps.addon.outputs.addon }}
if: runner.os == 'Linux'
- name: List linked libraries (macOS)
run: otool -L ${{ steps.addon.outputs.addon }}
if: runner.os == 'macOS'
- run: npx mocha test/node.test.ts test/integration.test.ts
env:
MOCHA_INTEGRATION: node
MOCHA_MAGICK_INSTALL: "node -e \"fs.symlinkSync(process.env.GITHUB_WORKSPACE, path.resolve('node_modules', 'magickwand.js'), os.platform() == 'win32' ? 'junction': 'dir')\""
MOCHA_LIGHT: ${{ matrix.dependencies == 'conan' && '' || '1' }}
MOCHA_EXTRALIGHT: ${{ (matrix.dependencies == 'system' && runner.os == 'Windows') && '1' || '' }}
native-light:
runs-on: ${{ matrix.platform }}
needs: swig
strategy:
fail-fast: false
matrix:
platform: [ubuntu-latest]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: true
- name: Use Node.js 18.x
uses: actions/setup-node@v4
with:
node-version: 18.x
- name: Download the SWIG-generated wrappers
uses: actions/download-artifact@v4
with:
name: swig
path: swig
- name: Install the xpacks
run: |
npm install xpm
npx xpm install
- name: Get conan home
shell: bash
id: conan_home
run: |
npx xpm run -q conan -- version
echo path=`npx xpm run -q conan -- config home` >> $GITHUB_OUTPUT
- name: Cache conan artifacts
id: conan-artifacts
uses: actions/cache@v4
with:
path: ${{ steps.conan_home.outputs.path }}
key: linux-light-conan
- name: Install fonts on Ubuntu
run: sudo apt-get install -y fonts-ubuntu || true
if: startsWith(matrix.platform, 'ubuntu')
shell: bash
- name: Build magickwand.js
run: |
npm install --build-from-source --verbose --foreground-scripts --enable-shared \
--disable-fonts --enable-jpeg --enable-png --disable-tiff \
--disable-webp --disable-jpeg2000 --disable-raw --disable-openmedia \
--disable-brotli --disable-h265 --disable-exr --disable-fftw --disable-heif \
--disable-color --disable-xml --enable-gzip --disable-zip \
--disable-bzip2 --disable-zstd --disable-xz --disable-lzma --disable-simd \
--disable-openmp --disable-display --disable-jbig --disable-cairo \
--skip-magickwand-wasm
- name: Locate addon file
shell: bash
id: addon
run: node -p '"addon=" + path.resolve(__dirname, "lib", "binding", `${os.platform()}-${os.arch()}`, "magickwand.node")' >> $GITHUB_OUTPUT
- name: List linked libraries (Linux)
run: ldd ${{ steps.addon.outputs.addon }}
if: runner.os == 'Linux'
- name: List linked libraries (macOS)
run: otool -L ${{ steps.addon.outputs.addon }}
if: runner.os == 'macOS'
- run: npx mocha test/node.test.ts
env:
MOCHA_LIGHT: 1
native-xpack:
runs-on: ${{ matrix.platform }}
needs: swig
strategy:
fail-fast: false
matrix:
platform:
- ubuntu-20.04
- ubuntu-22.04
- ubuntu-24.04
- macos-12
- macos-latest
- windows-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: true
- name: Use Node.js 18.x
uses: actions/setup-node@v4
with:
node-version: 18.x
- name: Download the SWIG-generated wrappers
uses: actions/download-artifact@v4
with:
name: swig
path: swig
- name: Install the xpacks
run: |
npm install xpm
npx xpm install
- name: Get conan home
shell: bash
id: conan_home
run: |
npx xpm run -q conan -- version
echo path=`npx xpm run -q conan -- config home` >> $GITHUB_OUTPUT
- name: Cache conan artifacts
id: conan-artifacts
uses: actions/cache@v4
with:
path: ${{ steps.conan_home.outputs.path }}
key: conan-xpack-${{ matrix.platform }}
- name: Install fonts on Ubuntu
run: sudo apt-get install -y fonts-ubuntu || true
if: startsWith(matrix.platform, 'ubuntu')
- name: Do not use GHA pkg-config on Windows
shell: bash
run: rm `which pkg-config`*
if: runner.os == 'Windows'
- name: Build with xPack
run: |
npx xpm install
npx xpm install --config native-xpack
npx xpm run prepare --config native-xpack
npx xpm run build --config native-xpack
env:
npm_config_enable_conan: true
C_INCLUDE_PATH: /usr/local/include
CPLUS_INCLUDE_PATH: /usr/local/include
- name: Locate addon file
shell: bash
id: addon
run: node -p '"addon=" + path.resolve(__dirname, "lib", "binding", `${os.platform()}-${os.arch()}`, "magickwand.node")' >> $GITHUB_OUTPUT
- name: List linked libraries (Linux)
run: ldd ${{ steps.addon.outputs.addon }}
if: runner.os == 'Linux'
- name: List linked libraries (macOS)
run: otool -L ${{ steps.addon.outputs.addon }}
if: runner.os == 'macOS'
- run: npx mocha test/node.test.ts test/integration.test.ts
env:
MOCHA_INTEGRATION: node
MOCHA_MAGICK_INSTALL: "node -e \"fs.symlinkSync(process.env.GITHUB_WORKSPACE, path.resolve('node_modules', 'magickwand.js'), os.platform() == 'win32' ? 'junction': 'dir')\""
native-xpack-minimal-container:
runs-on: ubuntu-latest
needs: swig
container: ubuntu:latest
steps:
- name: Install libc6-dev
run: |
apt-get update
apt-get install -y libc6-dev libstdc++-11-dev libgcc-11-dev binutils ca-certificates
- uses: actions/checkout@v4
- uses: actions/checkout@v4
name: Checkout ImageMagick
with:
repository: mmomtchev/ImageMagick
path: ${{ github.workspace }}/deps/ImageMagick
- name: Use Node.js 20.x
uses: actions/setup-node@v4
with:
node-version: 20.x
- name: Download the SWIG-generated wrappers
uses: actions/download-artifact@v4
with:
name: swig
path: swig
- name: Install the xpacks
run: |
npm install xpm
npx xpm install
- name: Get conan home
shell: bash
id: conan_home
run: |
npx xpm run -q conan -- version
echo path=`npx xpm run -q conan -- config home` >> $GITHUB_OUTPUT
- name: Cache conan artifacts
id: conan-artifacts
uses: actions/cache@v4
with:
path: ${{ steps.conan_home.outputs.path }}
key: conan-xpack-minimal-Linux
- name: Install fonts on Ubuntu
run: apt-get install -y fonts-ubuntu
- name: Build with xPack
run: |
npx xpm install
npx xpm install --config native-xpack
npx xpm run prepare --config native-xpack
npx xpm run build --config native-xpack
env:
npm_config_enable_conan: true
C_INCLUDE_PATH: /usr/local/include
CPLUS_INCLUDE_PATH: /usr/local/include
- name: Locate addon file
shell: bash
id: addon
run: node -p '"addon=" + path.resolve(__dirname, "lib", "binding", `${os.platform()}-${os.arch()}`, "magickwand.node")' >> $GITHUB_OUTPUT
- name: List linked libraries (Linux)
run: ldd ${{ steps.addon.outputs.addon }}
- run: npx mocha test/node.test.ts test/integration.test.ts
env:
MOCHA_INTEGRATION: node
MOCHA_MAGICK_INSTALL: "node -e \"fs.symlinkSync(process.env.GITHUB_WORKSPACE, path.resolve('node_modules', 'magickwand.js'), os.platform() == 'win32' ? 'junction': 'dir')\""
wasm:
runs-on: ubuntu-latest
needs: swig
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: true
- name: Use Node.js 18.x
uses: actions/setup-node@v4
with:
node-version: 18.x
- name: Setup emscripten
uses: mymindstorm/setup-emsdk@v14
with:
version: 3.1.53
- name: Download the SWIG-generated wrappers
uses: actions/download-artifact@v4
with:
name: swig
path: swig
- name: Install the xpacks
run: |
npm install xpm
npx xpm install
- name: Get conan home
shell: bash
id: conan_home
run: |
npx xpm run -q conan -- version
echo path=`npx xpm run -q conan -- config home` >> $GITHUB_OUTPUT
- name: Cache conan artifacts
id: conan-artifacts
uses: actions/cache@v4
with:
path: ${{ steps.conan_home.outputs.path }}
key: wasm-conan
- name: Build magickwand.js
run: npm install --build-wasm-from-source --verbose --foreground-scripts --skip-magickwand-native --enable-conan
- name: Check size
run: |
echo "::notice::Default WASM version is $(( `gzip -9c lib/binding/emscripten-wasm32/magickwand.wasm | wc -c` / 1024 )) KBytes gzipped"
echo "::notice::Default WASM version is $(( `brotli -9c lib/binding/emscripten-wasm32/magickwand.wasm | wc -c` / 1024 )) KBytes brotlied"
- name: Run headless test
uses: coactions/setup-xvfb@v1
env:
MOCHA_INTEGRATION: browser
MOCHA_MAGICK_INSTALL: ln -s ${{ github.workspace }} node_modules/magickwand.js
with:
run: npx mocha test/browser.test.ts test/integration.test.ts
wasm-light:
runs-on: ubuntu-latest
needs: swig
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: true
- name: Use Node.js 18.x
uses: actions/setup-node@v4
with:
node-version: 18.x
- name: Setup emscripten
uses: mymindstorm/setup-emsdk@v14
with:
version: 3.1.53
- name: Download the SWIG-generated wrappers
uses: actions/download-artifact@v4
with:
name: swig
path: swig
- name: Install the xpacks
run: |
npm install xpm
npx xpm install
- name: Get conan home
shell: bash
id: conan_home
run: |
npx xpm run -q conan -- version
echo path=`npx xpm run -q conan -- config home` >> $GITHUB_OUTPUT
- name: Cache conan artifacts
id: conan-artifacts
uses: actions/cache@v4
with:
path: ${{ steps.conan_home.outputs.path }}
key: wasm-light-conan
- name: Build magickwand.js
run: |
npm install --build-wasm-from-source --verbose --foreground-scripts \
--enable-conan \
--disable-fonts --enable-jpeg --enable-png --disable-tiff \
--disable-webp --disable-jpeg2000 --disable-raw --disable-openmedia \
--disable-brotli --disable-h265 --disable-exr --disable-fftw --disable-heif \
--disable-color --disable-xml --enable-gzip --disable-zip \
--disable-bzip2 --disable-zstd --disable-xz --disable-lzma --disable-simd \
--disable-openmp --disable-display --disable-jbig --disable-cairo \
--skip-magickwand-native
- name: Check size
run: |
echo "::notice::Light WASM version is $(( `gzip -9c lib/binding/emscripten-wasm32/magickwand.wasm | wc -c` / 1024 )) KBytes gzipped"
echo "::notice::Light WASM version is $(( `brotli -9c lib/binding/emscripten-wasm32/magickwand.wasm | wc -c` / 1024 )) KBytes brotlied"
- name: Run headless test
uses: coactions/setup-xvfb@v1
env:
MOCHA_LIGHT: 1
MOCHA_INTEGRATION: browser
with:
run: npx mocha test/browser.test.ts
debug-asan:
runs-on: ${{ matrix.platform }}
needs: swig
strategy:
fail-fast: false
matrix:
platform: [ubuntu-22.04]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: true
- name: Use Node.js 18.x
uses: actions/setup-node@v4
with:
node-version: 18.x
- name: Download the SWIG-generated wrappers
uses: actions/download-artifact@v4
with:
name: swig
path: swig
- name: Install the xpacks
run: |
npm install xpm
npx xpm install
- name: Get conan home
shell: bash
id: conan_home
run: |
npx xpm run -q conan -- version
echo path=`npx xpm run -q conan -- config home` >> $GITHUB_OUTPUT
- name: Cache conan artifacts
id: conan-artifacts
uses: actions/cache@v4
with:
path: ${{ steps.conan_home.outputs.path }}
key: linux-debug-asan-conan
- name: Install fonts on Ubuntu
run: sudo apt-get install -y fonts-ubuntu || true
if: startsWith(matrix.platform, 'ubuntu')
- name: Install the dependencies
run: npm install --skip-magickwand-wasm --skip-magickwand-native
- name: Build with ASAN
run: |
npx xpm install
npx xpm run prepare --config native-debug
npx xpm run configure --config native-debug -- -Db_sanitize=address
npx xpm run build --config native-debug
env:
npm_config_enable_conan: true
- run: node node_modules/mocha/bin/mocha.js -i -g Security --repeats 1000 test/node.test.ts
env:
LD_PRELOAD: /usr/lib/x86_64-linux-gnu/libasan.so.6
LSAN_OPTIONS: suppressions=${{ github.workspace }}/test/napi-leaks-suppression.txt
external:
runs-on: ${{ matrix.platform }}
needs: swig
strategy:
fail-fast: false
matrix:
platform: [ubuntu-22.04]
steps:
- name: Use Node.js 20.x
uses: actions/setup-node@v4
with:
node-version: 20.x
- uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: true
- name: Download the SWIG-generated wrappers
uses: actions/download-artifact@v4
with:
name: swig
path: swig
- name: Build and install ImageMagick-7
run: |
cd deps/ImageMagick
sh configure --prefix /usr
make -j4
sudo make install
- name: Install fonts on Ubuntu
run: sudo apt-get install -y fonts-ubuntu || true
if: startsWith(matrix.platform, 'ubuntu')
- name: Build with external ImageMagick library
run: |
npm install --verbose --foreground-scripts=true --build-from-source \
--enable-external --enable-shared \
--cpp-args="`pkg-config --cflags Magick++`" \
--cpp-link-args="`pkg-config --libs Magick++`" \
--skip-magickwand-wasm
shell: bash
- run: npx mocha test/node.test.ts test/integration.test.ts
env:
MOCHA_INTEGRATION: node
MOCHA_MAGICK_INSTALL: "node -e \"fs.symlinkSync(process.env.GITHUB_WORKSPACE, path.resolve('node_modules', 'magickwand.js'), os.platform() == 'win32' ? 'junction': 'dir')\""