diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6b4eb835a2..86d33ff01f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,46 +19,46 @@ jobs: fail-fast: false matrix: include: - - name: 'Windows static (BPT)' + - name: 'Windows static - C++/Python' os: windows-latest bindings_python: ON build_shared: OFF unit_tests: ON set_path: $env:Path="C:\libxml2\bin;C:\zlib\bin;"+$env:Path additional_cmake_options: -DLIBXML2_INCLUDE_DIR="C:\libxml2\include\libxml2" -DLIBXML2_LIBRARY="C:\libxml2\lib\libxml2.lib" -DZLIB_INCLUDE_DIR="C:\zlib\include" -DZLIB_LIBRARY="C:\zlib\lib\z_dll.lib" - - name: 'Windows shared (BPT)' + - name: 'Windows shared - C++/Python' os: windows-latest bindings_python: ON build_shared: ON unit_tests: ON set_path: $env:Path="C:\libxml2\bin;C:\zlib\bin;"+$env:Path additional_cmake_options: -DLIBXML2_INCLUDE_DIR="C:\libxml2\include\libxml2" -DLIBXML2_LIBRARY="C:\libxml2\lib\libxml2.lib" -DZLIB_INCLUDE_DIR="C:\zlib\include" -DZLIB_LIBRARY="C:\zlib\lib\z_dll.lib" - - name: 'Linux static (B)' + - name: 'Linux static - C++ (build only)' os: ubuntu-latest bindings_python: OFF build_shared: OFF unit_tests: OFF - - name: 'Linux shared (BPT)' + - name: 'Linux shared - C++/Python' os: ubuntu-latest bindings_python: ON build_shared: ON unit_tests: ON - - name: 'macOS static (Intel) (BT)' + - name: 'macOS static - C++ (Intel)' os: macos-13 bindings_python: OFF build_shared: OFF unit_tests: ON - - name: 'macOS shared (Intel) (BPT)' + - name: 'macOS shared - C++/Python (Intel)' os: macos-13 bindings_python: ON build_shared: ON unit_tests: ON - - name: 'macOS static (ARM) (BT)' + - name: 'macOS static - C++ (ARM)' os: macos-latest bindings_python: OFF build_shared: OFF unit_tests: ON - - name: 'macOS shared (ARM) (BPT)' + - name: 'macOS shared - C++/Python (ARM)' os: macos-latest bindings_python: ON build_shared: ON @@ -109,61 +109,79 @@ jobs: run: | cd build ninja test - code_formatting: - name: Code formatting - runs-on: ubuntu-latest + javascript: + name: JavaScript + runs-on: macos-latest strategy: fail-fast: false + env: + LIBCELLML_WASM_DIR: wasm + LIBXML2_VERSION: 2.9.10 + ZLIB_VERSION: 1.2.3 steps: - name: Check out libCellML uses: actions/checkout@v4 - - name: Install ClangFormat - run: | - sudo apt update - sudo apt install clang-format - name: Install CMake and Ninja uses: lukka/get-cmake@latest - - name: Configure libCellML + - name: Install buildcache + uses: mikehardy/buildcache-action@v2 + - name: Install Emscripten + run: | + brew install --overwrite emscripten + - name: Set up the build directory run: | mkdir build + - name: Build zlib + run: | cd build - cmake -G Ninja .. - - name: Code formatting + ZLIB_BUILD_DIR=zlib-wasm + git clone https://github.com/OpenCMISS-Dependencies/zlib.git -b v${ZLIB_VERSION} + mkdir ${ZLIB_BUILD_DIR} + emcmake cmake -G Ninja -S zlib -B ${ZLIB_BUILD_DIR} -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=~/${LIBCELLML_WASM_DIR} -DBUILD_SHARED_LIBS=OFF + cmake --build ${ZLIB_BUILD_DIR} + cmake --install ${ZLIB_BUILD_DIR} + - name: Build libxml2 run: | cd build - ninja test_clang_format - documentation: - name: Documentation + LIBXML2_BUILD_DIR=libxml2-wasm + git clone https://github.com/OpenCMISS-Dependencies/libxml2.git -b v${LIBXML2_VERSION} + mkdir ${LIBXML2_BUILD_DIR} + emcmake cmake -G Ninja -S libxml2 -B ${LIBXML2_BUILD_DIR} -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=~/${LIBCELLML_WASM_DIR} -DZLIB_DIR=~/${LIBCELLML_WASM_DIR}/lib/cmake/ZLIB-${ZLIB_VERSION} -DBUILD_SHARED_LIBS=OFF -DLIBXML2_WITH_ICONV=OFF -DLIBXML2_WITH_LZMA=OFF -DLIBXML2_WITH_PYTHON=OFF -DLIBXML2_WITH_TESTS=OFF -DLIBXML2_WITH_PROGRAMS=OFF + cmake --build ${LIBXML2_BUILD_DIR} + cmake --install ${LIBXML2_BUILD_DIR} + - name: Build libCellML + run: | + cd build + mkdir ${LIBCELLML_WASM_DIR} + emcmake cmake -G Ninja -S .. -B ${LIBCELLML_WASM_DIR} -DLibXml2_DIR=~/${LIBCELLML_WASM_DIR}/lib/cmake/libxml2-${LIBXML2_VERSION} -DBUILD_TYPE=Release + cmake --build ${LIBCELLML_WASM_DIR} + - name: Unit testing + run: | + cd build + cmake --build ${LIBCELLML_WASM_DIR} --target jest_test + code_formatting: + name: Code formatting runs-on: ubuntu-latest strategy: fail-fast: false steps: - name: Check out libCellML uses: actions/checkout@v4 - - name: Install CMake and Ninja - uses: lukka/get-cmake@latest - - name: Install buildcache - uses: mikehardy/buildcache-action@v2 - - name: Install dot - run: | - sudo apt update - sudo apt install graphviz - - name: Install Doxygen + - name: Install ClangFormat run: | sudo apt update - sudo apt install doxygen - - name: Install Sphinx - run: | - pip3 install sphinx + sudo apt install clang-format + - name: Install CMake and Ninja + uses: lukka/get-cmake@latest - name: Configure libCellML run: | mkdir build cd build - cmake -G Ninja -DBINDINGS_PYTHON=OFF .. - - name: Documentation + cmake -G Ninja .. + - name: Code formatting run: | cd build - ninja docs + ninja test_clang_format coverage: name: Code coverage runs-on: macos-latest @@ -215,15 +233,11 @@ jobs: run: | cd build ninja memcheck - javascript: - name: JavaScript (BT) - runs-on: macos-latest + documentation: + name: Documentation + runs-on: ubuntu-latest strategy: fail-fast: false - env: - LIBCELLML_WASM_DIR: wasm - LIBXML2_VERSION: 2.9.10 - ZLIB_VERSION: 1.2.3 steps: - name: Check out libCellML uses: actions/checkout@v4 @@ -231,37 +245,23 @@ jobs: uses: lukka/get-cmake@latest - name: Install buildcache uses: mikehardy/buildcache-action@v2 - - name: Install Emscripten - run: | - brew install --overwrite emscripten - - name: Set up the build directory + - name: Install dot run: | - mkdir build - - name: Build zlib + sudo apt update + sudo apt install graphviz + - name: Install Doxygen run: | - cd build - ZLIB_BUILD_DIR=zlib-wasm - git clone https://github.com/OpenCMISS-Dependencies/zlib.git -b v${ZLIB_VERSION} - mkdir ${ZLIB_BUILD_DIR} - emcmake cmake -G Ninja -S zlib -B ${ZLIB_BUILD_DIR} -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=~/${LIBCELLML_WASM_DIR} -DBUILD_SHARED_LIBS=OFF - cmake --build ${ZLIB_BUILD_DIR} - cmake --install ${ZLIB_BUILD_DIR} - - name: Build libxml2 + sudo apt update + sudo apt install doxygen + - name: Install Sphinx run: | - cd build - LIBXML2_BUILD_DIR=libxml2-wasm - git clone https://github.com/OpenCMISS-Dependencies/libxml2.git -b v${LIBXML2_VERSION} - mkdir ${LIBXML2_BUILD_DIR} - emcmake cmake -G Ninja -S libxml2 -B ${LIBXML2_BUILD_DIR} -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=~/${LIBCELLML_WASM_DIR} -DZLIB_DIR=~/${LIBCELLML_WASM_DIR}/lib/cmake/ZLIB-${ZLIB_VERSION} -DBUILD_SHARED_LIBS=OFF -DLIBXML2_WITH_ICONV=OFF -DLIBXML2_WITH_LZMA=OFF -DLIBXML2_WITH_PYTHON=OFF -DLIBXML2_WITH_TESTS=OFF -DLIBXML2_WITH_PROGRAMS=OFF - cmake --build ${LIBXML2_BUILD_DIR} - cmake --install ${LIBXML2_BUILD_DIR} - - name: Build libCellML + pip3 install sphinx + - name: Configure libCellML run: | + mkdir build cd build - mkdir ${LIBCELLML_WASM_DIR} - emcmake cmake -G Ninja -S .. -B ${LIBCELLML_WASM_DIR} -DLibXml2_DIR=~/${LIBCELLML_WASM_DIR}/lib/cmake/libxml2-${LIBXML2_VERSION} -DBUILD_TYPE=Release - cmake --build ${LIBCELLML_WASM_DIR} - - name: Unit testing + cmake -G Ninja -DBINDINGS_PYTHON=OFF .. + - name: Documentation run: | cd build - cmake --build ${LIBCELLML_WASM_DIR} --target jest_test + ninja docs