@@ -21,30 +21,20 @@ jobs:
2121 fail-fast : false
2222 matrix :
2323 include :
24- - name : ubu24-arm-gcc12-clang-repl-19-emscripten
25- os : ubuntu-24.04-arm
26- compiler : gcc-12
27- clang-runtime : ' 19'
28- cling : Off
29- llvm_enable_projects : " clang;lld"
30- llvm_targets_to_build : " WebAssembly"
31- emsdk_ver : " 3.1.73"
3224 - name : osx15-arm-clang-clang-repl-19-emscripten
3325 os : macos-15
3426 compiler : clang
3527 clang-runtime : ' 19'
3628 cling : Off
3729 llvm_enable_projects : " clang;lld"
38- llvm_targets_to_build : " WebAssembly"
39- emsdk_ver : " 3.1.73"
30+ llvm_targets_to_build : " WebAssembly"
4031 - name : ubu24-x86-gcc12-clang-repl-19-emscripten
4132 os : ubuntu-24.04
4233 compiler : gcc-12
4334 clang-runtime : ' 19'
4435 cling : Off
4536 llvm_enable_projects : " clang;lld"
4637 llvm_targets_to_build : " WebAssembly"
47- emsdk_ver : " 3.1.73"
4838
4939 steps :
5040 - uses : actions/checkout@v4
@@ -115,13 +105,6 @@ jobs:
115105 key : ${{ env.CLING_HASH }}-${{ runner.os }}-${{ matrix.os }}-${{ matrix.compiler }}-clang-${{ matrix.clang-runtime }}.x-emscripten
116106 lookup-only : true
117107
118- - name : Setup emsdk
119- if : ${{ runner.os != 'windows' && steps.cache.outputs.cache-hit != 'true' }}
120- run : |
121- git clone --depth=1 https://github.com/emscripten-core/emsdk.git
122- cd emsdk
123- ./emsdk install ${{ matrix.emsdk_ver }}
124-
125108 - name : Setup default Build Type on *nux
126109 if : ${{ runner.os != 'windows' && steps.cache.outputs.cache-hit != 'true' }}
127110 run : |
@@ -262,11 +245,17 @@ jobs:
262245 sudo apt-get autoremove
263246 sudo apt-get clean
264247
248+ - name : install mamba
249+ if : ${{ steps.cache.outputs.cache-hit != 'true' }}
250+ uses : mamba-org/setup-micromamba@main
251+ with :
252+ environment-file : environment-wasm-build.yml
253+ init-shell : bash
254+ environment-name : CppInterOp-wasm-build
255+
265256 - name : Build LLVM/Cling on Unix systems if the cache is invalid (emscripten)
266257 if : ${{ runner.os != 'windows' && steps.cache.outputs.cache-hit != 'true' }}
267258 run : |
268- ./emsdk/emsdk activate ${{matrix.emsdk_ver}}
269- source ./emsdk/emsdk_env.sh
270259 cling_on=$(echo "${{ matrix.cling }}" | tr '[:lower:]' '[:upper:]')
271260 if [[ "${cling_on}" == "ON" ]]; then
272261 git clone https://github.com/root-project/cling.git
@@ -465,21 +454,12 @@ jobs:
465454 clang-runtime : ' 19'
466455 cling : Off
467456 micromamba_shell_init : bash
468- emsdk_ver : " 3.1.73"
469457 - name : osx15-arm-clang-clang-repl-19-emscripten_wasm
470458 os : macos-15
471459 compiler : clang
472460 clang-runtime : ' 19'
473461 cling : Off
474462 micromamba_shell_init : bash
475- emsdk_ver : " 3.1.73"
476- - name : ubu24-arm-gcc12-clang-repl-19-emscripten_wasm
477- os : ubuntu-24.04-arm
478- compiler : gcc-12
479- clang-runtime : ' 19'
480- cling : Off
481- micromamba_shell_init : bash
482- emsdk_ver : " 3.1.73"
483463
484464 steps :
485465 - uses : actions/checkout@v4
@@ -524,19 +504,6 @@ jobs:
524504 echo "ncpus=$(nproc --all)" >> $GITHUB_ENV
525505 fi
526506
527- - name : install mamba
528- uses : mamba-org/setup-micromamba@main
529- with :
530- init-shell : >-
531- ${{ matrix.micromamba_shell_init }}
532-
533- - name : Setup emsdk
534- shell : bash -l {0}
535- run : |
536- git clone --depth=1 https://github.com/emscripten-core/emsdk.git
537- cd emsdk
538- ./emsdk install ${{ matrix.emsdk_ver }}
539-
540507 - name : Restore Cache LLVM/Clang runtime build directory
541508 uses : actions/cache/restore@v4
542509 id : cache
@@ -545,16 +512,22 @@ jobs:
545512 llvm-project
546513 ${{ matrix.cling=='On' && 'cling' || '' }}
547514 key : ${{ env.CLING_HASH }}-${{ runner.os }}-${{ matrix.os }}-${{ matrix.compiler }}-clang-${{ matrix.clang-runtime }}.x-emscripten
515+
516+ - name : install mamba
517+ uses : mamba-org/setup-micromamba@main
518+ with :
519+ environment-file : environment-wasm-build.yml
520+ init-shell : bash
521+ environment-name : CppInterOp-wasm-build
548522
549523 - name : Emscripten build of CppInterOp on Unix systems
550524 if : ${{ runner.os != 'windows' }}
551525 shell : bash -l {0}
552526 run : |
553- ./emsdk/emsdk activate ${{matrix.emsdk_ver}}
554- source ./emsdk/emsdk_env.sh
555- micromamba create -f environment-wasm.yml --platform=emscripten-wasm32
527+ micromamba create -f environment-wasm-host.yml --platform=emscripten-wasm32
556528
557- export PREFIX=$MAMBA_ROOT_PREFIX/envs/CppInterOp-wasm
529+ export PREFIX=$MAMBA_ROOT_PREFIX/envs/CppInterOp-wasm-host
530+ export BUILD_PREFIX=$MAMBA_ROOT_PREFIX/envs/CppInterOp-wasm-build
558531 export CMAKE_PREFIX_PATH=$PREFIX
559532 export CMAKE_SYSTEM_PREFIX_PATH=$PREFIX
560533
@@ -597,7 +570,6 @@ jobs:
597570 -DBUILD_SHARED_LIBS=ON \
598571 -DCODE_COVERAGE=${{ env.CODE_COVERAGE }} \
599572 -DCMAKE_INSTALL_PREFIX=$PREFIX \
600- -DCMAKE_FIND_ROOT_PATH_MODE_PACKAGE=ON \
601573 -DLLVM_ENABLE_WERROR=On \
602574 ../
603575 fi
@@ -612,26 +584,22 @@ jobs:
612584 echo "LLVM_BUILD_DIR=$LLVM_BUILD_DIR" >> $GITHUB_ENV
613585 echo "CPLUS_INCLUDE_PATH=$CPLUS_INCLUDE_PATH" >> $GITHUB_ENV
614586 echo "PREFIX=$PREFIX" >> $GITHUB_ENV
587+ echo "BUILD_PREFIX=$BUILD_PREFIX" >> $GITHUB_ENV
615588
616589 - name : Build xeus-cpp
617590 shell : bash -l {0}
618591 run : |
619- ./emsdk/emsdk activate ${{matrix.emsdk_ver}}
620- source ./emsdk/emsdk_env.sh
621- export SYSROOT_PATH=$PWD/emsdk/upstream/emscripten/cache/sysroot
622- micromamba activate CppInterOp-wasm
592+ export SYSROOT_PATH=$BUILD_PREFIX/opt/emsdk/upstream/emscripten/cache/sysroot
623593 git clone --depth=1 https://github.com/compiler-research/xeus-cpp.git
624594 cd ./xeus-cpp
625595 mkdir build
626596 pushd build
627- export CMAKE_PREFIX_PATH=${{ env.PREFIX }}
628- export CMAKE_SYSTEM_PREFIX_PATH=${{ env.PREFIX }}
629597 emcmake cmake \
630598 -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} \
631599 -DCMAKE_PREFIX_PATH=${{ env.PREFIX }} \
632600 -DCMAKE_INSTALL_PREFIX=${{ env.PREFIX }} \
633601 -DXEUS_CPP_EMSCRIPTEN_WASM_BUILD=ON \
634- -DCMAKE_FIND_ROOT_PATH_MODE_PACKAGE=ON \
602+ -DCMAKE_FIND_ROOT_PATH_MODE_PACKAGE=ON \
635603 -DCppInterOp_DIR="${{ env.CPPINTEROP_BUILD_DIR }}/lib/cmake/CppInterOp" \
636604 -DSYSROOT_PATH=$SYSROOT_PATH \
637605 ..
0 commit comments