use node to get the workspace from the environment #1406
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: 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: | |
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 | |
uses: | |
mmomtchev/magickwand.js/.github/workflows/build.yml@xpack-install | |
with: | |
native: true | |
wasm: false | |
platform: ${{ matrix.platform }} | |
dependencies: ${{ matrix.dependencies }} | |
integration: node | |
install_cmd: "node -e \"fs.symlinkSync(process.env.GITHUB_WORKSPACE, path.resolve('node_modules', 'magickwand.js'), os.platform() == 'win32' ? 'junction': 'dir')\"" | |
light: ${{ matrix.dependencies == 'conan' && '' || '1' }} | |
extralight: ${{ matrix.dependencies == 'system' && startsWith(matrix.platform, 'windows') }} | |
conan_id: native | |
native-light: | |
needs: swig | |
strategy: | |
fail-fast: false | |
matrix: | |
platform: [ubuntu-latest] | |
uses: | |
mmomtchev/magickwand.js/.github/workflows/build.yml@xpack-install | |
with: | |
native: true | |
wasm: false | |
platform: ${{ matrix.platform }} | |
dependencies: conan | |
integration: '' | |
install_cmd: '' | |
light: true | |
extra_npm_opts: '--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' | |
conan_id: native-light | |
native-xpack: | |
needs: swig | |
strategy: | |
fail-fast: false | |
matrix: | |
platform: | |
- ubuntu-20.04 | |
- ubuntu-22.04 | |
- ubuntu-24.04 | |
- macos-12 | |
- macos-latest | |
- windows-latest | |
uses: | |
mmomtchev/magickwand.js/.github/workflows/build.yml@xpack-install | |
with: | |
native: true | |
wasm: false | |
platform: ${{ matrix.platform }} | |
dependencies: conan | |
integration: node | |
install_cmd: "node -e \"fs.symlinkSync(process.env.GITHUB_WORKSPACE, path.resolve('node_modules', 'magickwand.js'), os.platform() == 'win32' ? 'junction': 'dir')\"" | |
extra_npm_opts: '--enable-standalone-build' | |
conan_id: native-xpack | |
native-xpack-minimal-container: | |
needs: swig | |
uses: | |
mmomtchev/magickwand.js/.github/workflows/build.yml@xpack-install | |
with: | |
native: true | |
wasm: false | |
platform: ubuntu-latest | |
dependencies: conan | |
integration: node | |
install_cmd: "node -e \"fs.symlinkSync(process.env.GITHUB_WORKSPACE, path.resolve('node_modules', 'magickwand.js'), os.platform() == 'win32' ? 'junction': 'dir')\"" | |
extra_npm_opts: '--enable-standalone-build' | |
container: ubuntu:latest | |
container_init: 'apt-get update && apt-get install -y libc6-dev libstdc++-11-dev libgcc-11-dev binutils ca-certificates fonts-ubuntu' | |
conan_id: native-xpack-minimal-container | |
wasm: | |
needs: swig | |
uses: | |
mmomtchev/magickwand.js/.github/workflows/build.yml@xpack-install | |
with: | |
native: false | |
wasm: true | |
platform: ubuntu-latest | |
dependencies: conan | |
integration: browser | |
install_cmd: "node -e \"fs.symlinkSync(process.env.GITHUB_WORKSPACE, path.resolve('node_modules', 'magickwand.js'), os.platform() == 'win32' ? 'junction': 'dir')\"" | |
conan_id: wasm | |
wasm-light: | |
needs: swig | |
uses: | |
mmomtchev/magickwand.js/.github/workflows/build.yml@xpack-install | |
with: | |
native: false | |
wasm: true | |
platform: ubuntu-latest | |
dependencies: conan | |
integration: browser | |
install_cmd: "node -e \"fs.symlinkSync(process.env.GITHUB_WORKSPACE, path.resolve('node_modules', 'magickwand.js'), os.platform() == 'win32' ? 'junction': 'dir')\"" | |
light: true | |
extra_npm_opts: '--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' | |
conan_id: wasm-light | |
external: | |
needs: swig | |
uses: | |
mmomtchev/magickwand.js/.github/workflows/build.yml@xpack-install | |
with: | |
native: true | |
wasm: false | |
platform: ubuntu-22.04 | |
dependencies: conan | |
integration: node | |
install_cmd: "node -e \"fs.symlinkSync(process.env.GITHUB_WORKSPACE, path.resolve('node_modules', 'magickwand.js'), os.platform() == 'win32' ? 'junction': 'dir')\"" | |
container_init: 'cd deps/ImageMagick && sh configure --prefix /usr && make -j4 && sudo make install' | |
extra_npm_opts: '--enable-external --enable-shared --cpp-args="`pkg-config --cflags Magick++`" --cpp-link-args="`pkg-config --libs Magick++`"' | |
conan_id: external | |
debug-asan: | |
runs-on: ubuntu-22.04 | |
needs: swig | |
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 | |
- 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 |