diff --git a/.github/workflows/deploy-github-page.yml b/.github/workflows/deploy-github-page.yml index 74570255..d7753af8 100644 --- a/.github/workflows/deploy-github-page.yml +++ b/.github/workflows/deploy-github-page.yml @@ -2,15 +2,16 @@ name: Build and Deploy on: workflow_dispatch: + pull_request: push: branches: - main - + permissions: contents: read pages: write id-token: write - + jobs: build: runs-on: ${{ matrix.os }} @@ -20,44 +21,37 @@ jobs: matrix: include: - name: Github-page - os: macos-15 + os: ubuntu-24.04 emsdk_ver: "3.1.45" steps: - uses: actions/checkout@v4 with: fetch-depth: 0 - + - name: install mamba uses: mamba-org/setup-micromamba@main with: + environment-file: environment-wasm-build.yml init-shell: bash + environment-name: xeus-cpp-wasm-build - name: Setup default Build Type on *nux if: ${{ runner.os != 'windows' }} run: | echo "ncpus=$(nproc --all)" >> $GITHUB_ENV - - - name: Setup emsdk - shell: bash -l {0} - run: | - cd $HOME - git clone --depth=1 https://github.com/emscripten-core/emsdk.git - cd emsdk - ./emsdk install ${{ matrix.emsdk_ver }} - name: Build xeus-cpp shell: bash -l {0} run: | - $HOME/emsdk/emsdk activate ${{matrix.emsdk_ver}} - source $HOME/emsdk/emsdk_env.sh micromamba create -f environment-wasm-host.yml --platform=emscripten-wasm32 - + mkdir build pushd build + export BUILD_PREFIX=$MAMBA_ROOT_PREFIX/envs/xeus-cpp-wasm-build export PREFIX=$MAMBA_ROOT_PREFIX/envs/xeus-cpp-wasm-host echo "PREFIX=$PREFIX" >> $GITHUB_ENV - export SYSROOT_PATH=$HOME/emsdk/upstream/emscripten/cache/sysroot + export SYSROOT_PATH=$BUILD_PREFIX/opt/emsdk/upstream/emscripten/cache/sysroot emcmake cmake \ -DCMAKE_BUILD_TYPE=Release \ @@ -66,9 +60,9 @@ jobs: -DCMAKE_FIND_ROOT_PATH=$PREFIX \ -DSYSROOT_PATH=$SYSROOT_PATH \ .. - emmake make -j ${{ env.ncpus }} install + emmake make -j ${{ env.ncpus }} install - - name: Jupyter Lite integration + - name: Jupyter Lite integration shell: bash -l {0} run: | micromamba create -n xeus-lite-host jupyterlite-core jupyter_server @@ -89,12 +83,15 @@ jobs: deploy: needs: build + if: github.ref == 'refs/heads/main' permissions: pages: write id-token: write + environment: name: github-pages url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-24.04 steps: - name: Deploy to GitHub Pages diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index fd0ebf8c..3f547655 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -191,19 +191,7 @@ jobs: matrix: include: - name: ubu24 - os: ubuntu-24.04 - emsdk_ver: "3.1.45" - micromamba_shell_init: bash - - name: ubu22 - os: ubuntu-22.04 - emsdk_ver: "3.1.45" - micromamba_shell_init: bash - - name: osx13-x86 - os: macos-13 - emsdk_ver: "3.1.45" - micromamba_shell_init: bash - - name: osx14-arm - os: macos-14 + os: ubuntu-24.04-arm emsdk_ver: "3.1.45" micromamba_shell_init: bash - name: osx15-arm diff --git a/environment-wasm-build.yml b/environment-wasm-build.yml new file mode 100644 index 00000000..a074ec55 --- /dev/null +++ b/environment-wasm-build.yml @@ -0,0 +1,7 @@ +name: xeus-cpp-wasm-build +channels: + - https://repo.mamba.pm/emscripten-forge + - conda-forge +dependencies: + - cmake + - emscripten_emscripten-wasm32==3.1.45 \ No newline at end of file diff --git a/environment-wasm-host.yml b/environment-wasm-host.yml index 9167a746..a7ea2462 100644 --- a/environment-wasm-host.yml +++ b/environment-wasm-host.yml @@ -3,6 +3,7 @@ channels: - https://repo.mamba.pm/emscripten-forge - https://repo.mamba.pm/conda-forge dependencies: + - emscripten-abi==3.1.45 - nlohmann_json - xeus-lite - xeus