new build system based on conan 2 #732
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: Node.js CI | |
on: | |
push: | |
branches: ["*"] | |
paths-ignore: | |
- 'CHANGELOG.md' | |
- 'README.md' | |
pull_request: | |
branches: main | |
paths-ignore: | |
- 'CHANGELOG.md' | |
- 'README.md' | |
jobs: | |
native: | |
runs-on: ${{ matrix.platform }} | |
strategy: | |
fail-fast: false | |
matrix: | |
platform: [ubuntu-latest, macos-latest, windows-latest] | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
submodules: true | |
- name: Use Node.js 18.x | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18.x | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: "3.11" | |
- name: Cache conan artifacts | |
id: conan-artifacts | |
uses: actions/cache@v3 | |
with: | |
path: ~/.conan2 | |
key: ${{ runner.os }}-conan | |
- name: Install fonts on Ubuntu | |
run: sudo apt-get install -y fonts-ubuntu || true | |
if: startsWith(matrix.platform, 'ubuntu') | |
- name: Install conan dependencies | |
run: npm run conan:native | |
- name: Build magickwand.js | |
run: npm install --build-from-source --verbose | |
- name: magick_configure.log | |
run: cat build/magick_configure.log | |
shell: bash | |
- run: npx @mapbox/node-pre-gyp build | |
- 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-light: | |
runs-on: ${{ matrix.platform }} | |
strategy: | |
fail-fast: false | |
matrix: | |
platform: [ubuntu-latest] | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
submodules: true | |
- name: Use Node.js 18.x | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18.x | |
- name: Cache conan artifacts | |
id: conan-artifacts | |
uses: actions/cache@v3 | |
with: | |
path: ~/.conan2 | |
key: ${{ runner.os }}-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 \ | |
--fonts=false --jpeg=true --png=false --tiff=false \ | |
--webp=false --jpeg2000=false --raw=false --openmedia=false \ | |
--brotli=false --h265=false --exr=false --fftw=false --heif=false \ | |
--jbig=true --color=false --xml=false --gzip=false --zip=false \ | |
--bzip2=true --zstd=false --xz=false --lzma=false --simd=false \ | |
--openmp=true --display=false | |
- name: magick_configure.log | |
run: cat build/magick_configure.log | |
shell: bash | |
- run: npx @mapbox/node-pre-gyp build | |
wasm: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
submodules: true | |
- name: Use Node.js 18.x | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18.x | |
- name: Cache conan artifacts | |
id: conan-artifacts | |
uses: actions/cache@v3 | |
with: | |
path: ~/.conan2 | |
key: wasm-conan | |
- run: npm run conan:emscripten | |
- run: npm install --ignore-scripts | |
- run: npm run deps:download | |
- run: npx @mapbox/node-pre-gyp configure --nodedir=./emscripten --target_arch=wasm32 --target_platform=emscripten | |
- name: magick_configure.log | |
run: cat build/magick_configure.log | |
shell: bash | |
- run: npx @mapbox/node-pre-gyp build | |
- 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: GabrielBB/xvfb-action@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 | |
strategy: | |
fail-fast: false | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
submodules: true | |
- name: Use Node.js 18.x | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18.x | |
- name: Cache conan artifacts | |
id: conan-artifacts | |
uses: actions/cache@v3 | |
with: | |
path: ~/.conan2 | |
key: wasm-light-conan | |
- name: Install conan dependencies (light) | |
run: | | |
npm run conan:emscripten -- \ | |
-ofonts=False -ojpeg=True -opng=False -otiff=False \ | |
-owebp=False -ojpeg2000=False -oraw=False -oopenmedia=False \ | |
-obrotli=False -oh265=False -oexr=False -offtw=False -oheif=False \ | |
-ojbig=True -ocolor=False -oxml=False -ogzip=False -ozip=False \ | |
-obzip2=True -ozstd=False -oxz=False -olzma=False -osimd=False \ | |
-oopenmp=True -odisplay=False | |
- run: npm install --ignore-scripts | |
- run: npm run deps:download | |
- name: Configure WASM version | |
run: npx @mapbox/node-pre-gyp configure --nodedir=./emscripten --target_arch=wasm32 --target_platform=emscripten | |
- name: magick_configure.log | |
run: cat build/magick_configure.log | |
shell: bash | |
- run: npx @mapbox/node-pre-gyp build | |
- 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" | |
debug-asan: | |
runs-on: ${{ matrix.platform }} | |
strategy: | |
fail-fast: false | |
matrix: | |
platform: [ubuntu-22.04] | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
submodules: true | |
- name: Use Node.js 18.x | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18.x | |
- name: Cache conan artifacts | |
id: conan-artifacts | |
uses: actions/cache@v3 | |
with: | |
path: ~/.conan2 | |
key: asan-conan | |
- name: Install fonts on Ubuntu | |
run: sudo apt-get install -y fonts-ubuntu || true | |
if: startsWith(matrix.platform, 'ubuntu') | |
- run: npm run conan:native | |
- run: npm install --ignore-scripts | |
- run: npm run deps:download | |
- run: npx @mapbox/node-pre-gyp configure --debug --enable_asan | |
- name: magick_configure.log | |
run: cat build/magick_configure.log | |
shell: bash | |
- run: npx @mapbox/node-pre-gyp build | |
- 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 |