Skip to content

CI

CI #60

Workflow file for this run

name: CI
on:
workflow_dispatch:
pull_request:
push:
schedule:
- cron: '0 2 * * *' # run at 2 AM UTC
jobs:
unix:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
steps:
- uses: actions/checkout@v2
- name: install mamba
uses: mamba-org/provision-with-micromamba@main
with:
environment-file: .github/ci_env.yml
environment-name: ci_env
- name: create project with cookiecutter
shell: bash -l {0}
run:
cookiecutter . --config-file .github/ci_context_no_wasm.yml --no-input -f
- name: create and activate env
shell: bash -l {0}
run: |
cd xeus-mylang
$HOME/micromamba-bin/micromamba create -f environment-dev.yml -y --name xeus_cookiecutter_test_env
micromamba activate xeus_cookiecutter_test_env
- name: install cxx compiler
shell: bash -l {0}
run: |
micromamba activate xeus_cookiecutter_test_env
$HOME/micromamba-bin/micromamba install cxx-compiler -c conda-forge -y
- name: cmake configure
shell: bash -l {0}
run: |
micromamba activate xeus_cookiecutter_test_env
cd xeus-mylang
mkdir -p bld
cd bld
cmake .. \
-DCMAKE_PREFIX_PATH=$CONDA_PREFIX \
-DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX
- name: build
shell: bash -l {0}
run: |
cd xeus-mylang/bld
make -j8
- name: install
shell: bash -l {0}
run: |
cd xeus-mylang/bld
make install
- name: test
shell: bash -l {0}
run: |
micromamba activate xeus_cookiecutter_test_env
cd xeus-mylang/test
pytest . --reruns 5
win:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ windows-latest]
steps:
- uses: actions/checkout@v2
- name: install mamba
uses: mamba-org/provision-with-micromamba@main
with:
environment-file: .github/ci_env.yml
environment-name: ci_env
- name: micromamba shell hook
shell: powershell
run: |
micromamba shell hook -s cmd.exe -p C:\Users\runneradmin\micromamba-root
- name: create project with cookiecutter
shell: powershell
run:
cookiecutter . --no-input -f
- name: create and activate env
shell: powershell
run: |
micromamba create -f xeus-mylang\environment-dev.yml -y --name xeus_cookiecutter_test_env
micromamba activate xeus_cookiecutter_test_env
- name: install cxx compiler
shell: cmd
run: |
call C:\Users\runneradmin\micromamba-root\condabin\micromamba.bat activate xeus_cookiecutter_test_env
call C:\Users\runneradmin\micromamba-root\condabin\micromamba.bat install cxx-compiler -c conda-forge -y
- name: cmake configure
shell: cmd
run: |
call C:\Users\runneradmin\micromamba-root\condabin\micromamba.bat activate xeus_cookiecutter_test_env
cd xeus-mylang
mkdir -p bld
cd bld
cmake .. -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=Release -DXEUS_BUILD_TESTS=ON -DDEPENDENCY_SEARCH_PREFIX="%CONDA_PREFIX%\Library" -DCMAKE_PREFIX_PATH="%CONDA_PREFIX%\Library" -DCMAKE_INSTALL_PREFIX="%CONDA_PREFIX%"
- name: build
shell: cmd
run: |
call C:\Users\runneradmin\micromamba-root\condabin\micromamba.bat activate xeus_cookiecutter_test_env
cd xeus-mylang/bld
set CL=/MP
nmake install
- name: test
shell: cmd
run: |
call C:\Users\runneradmin\micromamba-root\condabin\micromamba.bat activate xeus_cookiecutter_test_env
cd xeus-mylang/test
pytest . --reruns 5
emscripten_wasm:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
emsdk_ver: ["2.0.34", "3.1.3", "latest"]
# os: [ubuntu-latest, "macos-latest"]
steps:
- uses: actions/checkout@v2
- name: make_install_dir
shell: bash -l {0}
run: |
mkdir -p $GITHUB_WORKSPACE/custom_sysroot
- name: install emsdk
shell: bash -l {0}
run: |
git clone https://github.com/emscripten-core/emsdk.git /opt/emsdk
cd /opt/emsdk
./emsdk install ${{matrix.emsdk_ver}}
- name: install mamba
uses: mamba-org/provision-with-micromamba@main
with:
environment-file: .github/ci_env.yml
environment-name: ci_env
- name: create project with cookiecutter
shell: bash -l {0}
run:
cookiecutter . --config-file .github/ci_context_wasm.yml --no-input -f
- name: "install xtl"
run: |
cd /opt/emsdk
./emsdk activate ${{matrix.emsdk_ver}}
source "/opt/emsdk/emsdk_env.sh"
mkdir -p /opt/xtl/build
git clone https://github.com/xtensor-stack/xtl.git /opt/xtl/src
cd /opt/xtl/src
git checkout 0.7.2
cd /opt/xtl/build
emcmake cmake ../src/ -DCMAKE_INSTALL_PREFIX=$GITHUB_WORKSPACE/custom_sysroot
emmake make -j2 install
- name: "install nlohmann-json"
run: |
cd /opt/emsdk
./emsdk activate ${{matrix.emsdk_ver}}
source "/opt/emsdk/emsdk_env.sh"
mkdir -p /opt/nlohmannjson/build
git clone https://github.com/nlohmann/json.git /opt/nlohmannjson/src
cd /opt/nlohmannjson/src
git checkout v3.9.0
cd /opt/nlohmannjson/build
emcmake cmake ../src/ -DJSON_BuildTests=OFF -DCMAKE_INSTALL_PREFIX=$GITHUB_WORKSPACE/custom_sysroot
emmake make -j2 install
- name: "install xeus"
run: |
cd /opt/emsdk
./emsdk activate ${{matrix.emsdk_ver}}
source "/opt/emsdk/emsdk_env.sh"
mkdir -p /opt/xeus/build
git clone https://github.com/jupyter-xeus/xeus.git /opt/xeus/src
cd /opt/xeus/src
git checkout 3.0.5
cd /opt/xeus/build
emcmake cmake ../src \
-DXEUS_EMSCRIPTEN_WASM_BUILD=ON \
-DXEUS_BUILD_TESTS=OFF \
-Dxtl_DIR=$GITHUB_WORKSPACE/custom_sysroot/share/cmake/xtl \
-Dnlohmann_json_DIR=$GITHUB_WORKSPACE/custom_sysroot/lib/cmake/nlohmann_json \
-DCMAKE_INSTALL_PREFIX=$GITHUB_WORKSPACE/custom_sysroot
emmake make -j2
emmake make -j2 install
- name: "install xeus-lite"
run: |
cd /opt/emsdk
./emsdk activate ${{matrix.emsdk_ver}}
source "/opt/emsdk/emsdk_env.sh"
mkdir -p /opt/xeus-lite/build
git clone https://github.com/jupyter-xeus/xeus-lite.git /opt/xeus-lite/src
cd /opt/xeus-lite/src
git checkout 1.0.1
cd /opt/xeus-lite/build
emcmake cmake ../src \
-DCMAKE_INSTALL_PREFIX=$GITHUB_WORKSPACE/custom_sysroot \
-Dnlohmann_json_DIR=$GITHUB_WORKSPACE/custom_sysroot/lib/cmake/nlohmann_json \
-Dxtl_DIR=$GITHUB_WORKSPACE/custom_sysroot/share/cmake/xtl \
-Dxeus_DIR=$GITHUB_WORKSPACE/custom_sysroot/lib/cmake/xeus
emmake make -j2
emmake make -j2 install
- name: cmake configure rendered project
shell: bash -l {0}
run: |
cd /opt/emsdk
./emsdk activate ${{matrix.emsdk_ver}}
source "/opt/emsdk/emsdk_env.sh"
cd $GITHUB_WORKSPACE/xeus-mylang
mkdir -p bld
cd bld
emcmake cmake .. \
-DCMAKE_INSTALL_PREFIX=$GITHUB_WORKSPACE/custom_sysroot \
-DXEUS_MYLANG_EMSCRIPTEN_WASM_BUILD=ON \
-Dxtl_DIR=$GITHUB_WORKSPACE/custom_sysroot/share/cmake/xtl \
-Dnlohmann_json_DIR=$GITHUB_WORKSPACE/custom_sysroot/lib/cmake/nlohmann_json \
-Dxeus_DIR=$GITHUB_WORKSPACE/custom_sysroot/lib/cmake/xeus \
-Dxeus-lite_DIR=$GITHUB_WORKSPACE/custom_sysroot/lib/cmake/xeus-lite
- name: build rendered project
shell: bash
run: |
cd /opt/emsdk
./emsdk activate ${{matrix.emsdk_ver}}
source "/opt/emsdk/emsdk_env.sh"
cd $GITHUB_WORKSPACE/xeus-mylang/bld
emmake make -j8
- name: install rendered project
shell: bash -l {0}
run: |
cd /opt/emsdk
./emsdk activate ${{matrix.emsdk_ver}}
source "/opt/emsdk/emsdk_env.sh"
cd $GITHUB_WORKSPACE/xeus-mylang/bld
make install
push:
needs: [unix, win, emscripten_wasm]
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: install mamba
uses: mamba-org/provision-with-micromamba@main
with:
environment-file: .github/ci_env.yml
environment-name: ci_env
- name: create project with cookiecutter
shell: bash -l {0}
run:
cookiecutter . --config-file .github/ci_context_wasm.yml --no-input -f
- name: Push to rendered branch
if: github.repository == 'jupyter-xeus/xeus-cookiecutter' && github.ref == 'refs/heads/main'
uses: s0/git-publish-subdir-action@develop
env:
REPO: self
BRANCH: rendered
FOLDER: xeus-mylang
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
MESSAGE: "added rendered: ({sha}) {msg}"
# GITHUB_TOKEN permmissions cannot be changed for forks
continue-on-error: true