CI: put linting and coverage into separate workflow #870
This file contains hidden or 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: CI | |
| on: [push, pull_request] | |
| jobs: | |
| call-quality: | |
| uses: ./.github/workflows/quality.yml | |
| secrets: inherit | |
| test-gcc: | |
| name: gcc ${{ matrix.parallelisation }} (${{ matrix.os }}) | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - os: ubuntu-22.04 | |
| - os: ubuntu-22.04 | |
| parallelisation: "openmp" | |
| env: | |
| BUILD_TYPE: Release | |
| CMAKE_FLAGS: > | |
| -DCMAKE_C_COMPILER=gcc | |
| -DCMAKE_CXX_COMPILER=g++ | |
| -DSPIRIT_UI_USE_IMGUI=ON | |
| -DSPIRIT_UI_CXX_USE_QT=OFF | |
| -DSPIRIT_BUILD_TEST=ON | |
| OMP_NUM_THREADS: 4 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: π Install required system packages | |
| if: matrix.os == 'ubuntu-22.04' | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y xorg-dev libglu1-mesa-dev libgtk-3-dev | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.x' | |
| - name: π Install python packages | |
| run: pip install --user numpy | |
| - name: π Create build folder | |
| run: cmake -E make_directory ${{runner.workspace}}/build | |
| - name: β Configure | |
| if: matrix.parallelisation == '' | |
| shell: bash | |
| working-directory: ${{runner.workspace}}/build | |
| run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE $CMAKE_FLAGS | |
| - name: β Configure with OpenMP | |
| if: matrix.parallelisation == 'openmp' | |
| shell: bash | |
| working-directory: ${{runner.workspace}}/build | |
| run: > | |
| cmake $GITHUB_WORKSPACE | |
| -DCMAKE_BUILD_TYPE=$BUILD_TYPE | |
| -DSPIRIT_USE_OPENMP=ON | |
| $CMAKE_FLAGS | |
| - name: π Build | |
| shell: bash | |
| working-directory: ${{runner.workspace}}/build | |
| run: cmake --build . --config $BUILD_TYPE -j 2 | |
| - name: π§ͺ Test | |
| shell: bash | |
| working-directory: ${{runner.workspace}}/build | |
| run: ctest -C $BUILD_TYPE --output-on-failure | |
| test-clang: | |
| name: clang ${{ matrix.parallelisation }} (${{ matrix.os }}) | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - os: ubuntu-24.04 | |
| parallelisation: "" | |
| - os: ubuntu-24.04 | |
| parallelisation: "openmp" | |
| # this build cannot be configured currently | |
| # - os: ubuntu-24.04 | |
| # parallelisation: "cuda" | |
| - os: macos-14 | |
| parallelisation: "" | |
| - os: macos-14 | |
| parallelisation: "openmp" | |
| - os: windows-2022 | |
| parallelisation: "" | |
| - os: windows-2022 | |
| parallelisation: "openmp" | |
| env: | |
| BUILD_TYPE: Release | |
| BUILD_SYSTEM_FLAG: ${{ matrix.os == 'windows-2022' && '-G Ninja' || '' }} | |
| CMAKE_FLAGS: > | |
| -DCMAKE_C_COMPILER=clang | |
| -DCMAKE_CXX_COMPILER=clang++ | |
| -DSPIRIT_UI_USE_IMGUI=ON | |
| -DSPIRIT_UI_CXX_USE_QT=OFF | |
| -DSPIRIT_BUILD_TEST=ON | |
| OMP_NUM_THREADS: 4 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: π Install LLVM 17 and some libs (Ubuntu) | |
| if: matrix.os == 'ubuntu-24.04' | |
| shell: bash | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y xorg-dev libglu1-mesa-dev libgtk-3-dev clang-17 lldb-17 lld-17 libomp-17-dev | |
| sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-17 10 | |
| sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-17 10 | |
| clang --version | |
| - name: π Install CUDA Toolkit | |
| if: matrix.parallelisation == 'cuda' | |
| shell: bash | |
| run: | | |
| wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2404/x86_64/cuda-keyring_1.1-1_all.deb | |
| sudo dpkg -i cuda-keyring_1.1-1_all.deb | |
| sudo apt-get update | |
| sudo apt-get -y install cuda-toolkit-12-5 | |
| echo "/usr/local/cuda-12.5/bin" >> $GITHUB_PATH | |
| echo "/usr/local/cuda-12.5/lib64" >> $GITHUB_PATH | |
| # Workaround, because the setup-python action doesn't set up the PATH correctly | |
| - name: π Install LLVM and numpy (MacOS) | |
| if: matrix.os == 'macos-14' | |
| shell: bash | |
| run: | | |
| brew update | |
| brew install llvm numpy | |
| echo "/usr/local/opt/llvm/bin" >> $GITHUB_PATH | |
| echo "/opt/homebrew/opt/llvm/bin" >> $GITHUB_PATH | |
| - name: π Install LLVM and Ninja (Windows) | |
| if: matrix.os == 'windows-2022' | |
| shell: pwsh | |
| run: | | |
| choco install llvm ninja -y | |
| choco upgrade llvm | |
| - uses: actions/setup-python@v5 | |
| if: matrix.os != 'macos-14' | |
| with: | |
| python-version: '3.x' | |
| - name: π Install python packages | |
| if: matrix.os != 'macos-14' | |
| run: pip install --user numpy | |
| - name: π Create build folder | |
| run: cmake -E make_directory ${{runner.workspace}}/build | |
| - name: β Configure | |
| if: matrix.parallelisation == '' | |
| shell: bash | |
| working-directory: ${{runner.workspace}}/build | |
| run: > | |
| cmake $GITHUB_WORKSPACE | |
| $BUILD_SYSTEM_FLAG | |
| -DCMAKE_BUILD_TYPE=$BUILD_TYPE | |
| $CMAKE_FLAGS | |
| - name: β Configure with CUDA | |
| if: matrix.parallelisation == 'cuda' | |
| shell: bash | |
| working-directory: ${{runner.workspace}}/build | |
| run: > | |
| CUDA_PATH=/usr/local/cuda-12.5 | |
| cmake $GITHUB_WORKSPACE | |
| -DCMAKE_CUDA_COMPILER=clang++ | |
| -DSPIRIT_CUDA_ARCH=70 | |
| -DCMAKE_BUILD_TYPE=$BUILD_TYPE | |
| $CMAKE_FLAGS | |
| -DSPIRIT_USE_CUDA=ON | |
| - name: β Configure with OpenMP | |
| if: matrix.parallelisation == 'openmp' | |
| shell: bash | |
| working-directory: ${{runner.workspace}}/build | |
| run: > | |
| cmake $GITHUB_WORKSPACE | |
| $BUILD_SYSTEM_FLAG | |
| -DCMAKE_BUILD_TYPE=$BUILD_TYPE | |
| $CMAKE_FLAGS | |
| -DSPIRIT_USE_OPENMP=ON | |
| - name: π Build | |
| shell: bash | |
| working-directory: ${{runner.workspace}}/build | |
| run: cmake --build . --config $BUILD_TYPE -j 2 | |
| - name: π§ͺ Test | |
| if: matrix.parallelisation != 'cuda' | |
| shell: bash | |
| working-directory: ${{runner.workspace}}/build | |
| run: ctest -C $BUILD_TYPE --output-on-failure | |
| test-nvcpp: | |
| name: nvcpp ${{ matrix.parallelisation }} (ubuntu-22.04) | |
| runs-on: ubuntu-22.04 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - parallelisation: "" | |
| # - parallelisation: "openmp" # Some OpenMP that Spirit uses isn't supported by nvc++ | |
| - parallelisation: "cuda" | |
| env: | |
| BUILD_TYPE: Release | |
| CMAKE_FLAGS: > | |
| -DCMAKE_CXX_COMPILER=nvc++ | |
| -DSPIRIT_UI_USE_IMGUI=ON | |
| -DSPIRIT_UI_CXX_USE_QT=OFF | |
| -DSPIRIT_BUILD_TEST=ON | |
| OMP_NUM_THREADS: 4 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Force upgrade to gcc-12 on Ubuntu 22.04 | |
| if: matrix.os == 'ubuntu-22.04' | |
| shell: bash | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get --purge remove -y "g++*" | |
| sudo apt-get install -y g++-12 | |
| sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-12 10 | |
| sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-12 10 | |
| - name: π Install NVIDIA HPC SDK and some libs | |
| shell: bash | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y xorg-dev libglu1-mesa-dev libgtk-3-dev | |
| curl https://developer.download.nvidia.com/hpc-sdk/ubuntu/DEB-GPG-KEY-NVIDIA-HPC-SDK | sudo gpg --dearmor -o /usr/share/keyrings/nvidia-hpcsdk-archive-keyring.gpg | |
| echo 'deb [signed-by=/usr/share/keyrings/nvidia-hpcsdk-archive-keyring.gpg] https://developer.download.nvidia.com/hpc-sdk/ubuntu/amd64 /' | sudo tee /etc/apt/sources.list.d/nvhpc.list | |
| sudo apt-get update -y | |
| sudo apt-get install -y nvhpc-24-5 | |
| echo "/opt/nvidia/hpc_sdk/Linux_x86_64/24.5/compilers/bin" >> $GITHUB_PATH | |
| echo "/opt/nvidia/hpc_sdk/Linux_x86_64/24.5/math_libs/lib64" >> $GITHUB_PATH | |
| - name: Free up space | |
| shell: bash | |
| run: | | |
| sudo rm -rf /usr/share/dotnet | |
| sudo rm -rf /opt/ghc | |
| sudo rm -rf /usr/local/share/boost | |
| sudo rm -rf "$AGENT_TOOLSDIRECTORY" | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.x' | |
| - name: π Install python packages | |
| run: pip install --user numpy | |
| - name: π Create build folder | |
| run: cmake -E make_directory ${{runner.workspace}}/build | |
| - name: β Configure | |
| if: matrix.parallelisation == '' | |
| shell: bash | |
| working-directory: ${{runner.workspace}}/build | |
| run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE $CMAKE_FLAGS | |
| - name: β Configure with OpenMP | |
| if: matrix.parallelisation == 'openmp' | |
| shell: bash | |
| working-directory: ${{runner.workspace}}/build | |
| run: > | |
| cmake $GITHUB_WORKSPACE | |
| -DCMAKE_BUILD_TYPE=$BUILD_TYPE | |
| $CMAKE_FLAGS | |
| -DSPIRIT_USE_OPENMP=ON | |
| - name: β Configure with CUDA | |
| if: matrix.parallelisation == 'cuda' | |
| shell: bash | |
| working-directory: ${{runner.workspace}}/build | |
| run: > | |
| cmake $GITHUB_WORKSPACE | |
| -DCMAKE_BUILD_TYPE=$BUILD_TYPE | |
| $CMAKE_FLAGS | |
| -DSPIRIT_USE_CUDA=ON | |
| -DCUDA_TOOLKIT_ROOT_DIR=/opt/nvidia/hpc_sdk/Linux_x86_64/24.5/cuda/ | |
| - name: π Build | |
| shell: bash | |
| working-directory: ${{runner.workspace}}/build | |
| run: cmake --build . --config $BUILD_TYPE -j 2 | |
| - name: π§ͺ Test | |
| if: matrix.parallelisation != 'cuda' | |
| shell: bash | |
| working-directory: ${{runner.workspace}}/build | |
| run: ctest -C $BUILD_TYPE --output-on-failure | |
| test-msvc: | |
| name: msvc (windows-2025) | |
| runs-on: windows-2025 | |
| env: | |
| BUILD_TYPE: Release | |
| CMAKE_FLAGS: > | |
| -DSPIRIT_UI_USE_IMGUI=ON | |
| -DSPIRIT_UI_CXX_USE_QT=OFF | |
| -DSPIRIT_BUILD_TEST=ON | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: π Create build folder | |
| run: cmake -E make_directory ${{runner.workspace}}/build | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.x' | |
| - name: π Install python packages | |
| run: pip install --user numpy | |
| - name: β Configure | |
| shell: bash | |
| working-directory: ${{runner.workspace}}/build | |
| run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE $CMAKE_FLAGS | |
| - name: π Build | |
| shell: bash | |
| working-directory: ${{runner.workspace}}/build | |
| run: cmake --build . --config $BUILD_TYPE -j 2 | |
| - name: π§ͺ Test | |
| shell: bash | |
| working-directory: ${{runner.workspace}}/build | |
| run: ctest -C $BUILD_TYPE --output-on-failure | |
| test-debug: | |
| name: test debug (${{ matrix.os }}) | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - os: ubuntu-22.04 | |
| - os: macos-14 | |
| env: | |
| BUILD_TYPE: Debug | |
| CMAKE_FLAGS: > | |
| -DSPIRIT_UI_USE_IMGUI=OFF | |
| -DSPIRIT_UI_CXX_USE_QT=OFF | |
| -DSPIRIT_BUILD_TEST=ON | |
| EXCLUDETESTS: solver | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.x' | |
| - name: π Install python packages | |
| run: pip install --user numpy | |
| - name: π Create build folder | |
| run: cmake -E make_directory ${{runner.workspace}}/build | |
| - name: β Configure (without coverage) | |
| shell: bash | |
| working-directory: ${{runner.workspace}}/build | |
| run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE $CMAKE_FLAGS | |
| - name: π Build | |
| shell: bash | |
| working-directory: ${{runner.workspace}}/build | |
| run: cmake --build . --config $BUILD_TYPE -j 2 | |
| - name: π§ͺ Test regular debug build | |
| shell: bash | |
| working-directory: ${{runner.workspace}}/build | |
| run: ctest -C $BUILD_TYPE -E $EXCLUDETESTS --output-on-failure | |
| test-other-configurations: | |
| name: test ${{ matrix.configuration }} (${{ matrix.os }}) | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - configuration: "single-precision" | |
| os: ubuntu-24.04 | |
| - configuration: "single-precision" | |
| os: macos-14 | |
| - configuration: "pinning-and-defects" | |
| os: ubuntu-24.04 | |
| env: | |
| BUILD_TYPE: Release | |
| CMAKE_FLAGS: > | |
| -DSPIRIT_UI_USE_IMGUI=ON | |
| -DSPIRIT_UI_CXX_USE_QT=OFF | |
| -DSPIRIT_BUILD_TEST=ON | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.x' | |
| - name: π Install python packages | |
| run: pip install --user numpy | |
| - name: Force install of gcc-13 on Ubuntu 24.04 | |
| if: matrix.os == 'ubuntu-24.04' | |
| shell: bash | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get --purge remove -y "g++*" | |
| sudo apt-get install -y g++-13 | |
| sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-13 10 | |
| sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-13 10 | |
| - name: π Install required system packages | |
| if: matrix.os == 'ubuntu-24.04' | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y xorg-dev libglu1-mesa-dev libgtk-3-dev | |
| - name: π Create build folder | |
| run: cmake -E make_directory ${{runner.workspace}}/build | |
| - name: β Configure single-precision build | |
| if: matrix.configuration == 'single-precision' | |
| shell: bash | |
| working-directory: ${{runner.workspace}}/build | |
| run: > | |
| cmake $GITHUB_WORKSPACE | |
| -DCMAKE_BUILD_TYPE=$BUILD_TYPE | |
| -DSPIRIT_SCALAR_TYPE="float" | |
| $CMAKE_FLAGS | |
| - name: β Configure pinning-and-defects build | |
| if: matrix.configuration == 'pinning-and-defects' | |
| shell: bash | |
| working-directory: ${{runner.workspace}}/build | |
| run: > | |
| cmake $GITHUB_WORKSPACE | |
| -DCMAKE_BUILD_TYPE=$Debug | |
| -DSPIRIT_ENABLE_PINNING=ON | |
| -DSPIRIT_ENABLE_DEFECTS=ON | |
| $CMAKE_FLAGS | |
| - name: π Build | |
| shell: bash | |
| working-directory: ${{runner.workspace}}/build | |
| run: cmake --build . --config $BUILD_TYPE -j 2 | |
| - name: π§ͺ Test | |
| shell: bash | |
| working-directory: ${{runner.workspace}}/build | |
| run: ctest -C $BUILD_TYPE --output-on-failure | |
| build-cuda: | |
| runs-on: ${{ matrix.config.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| config: | |
| - os: ubuntu-22.04 | |
| env: | |
| BUILD_TYPE: Release | |
| CMAKE_FLAGS: > | |
| -DSPIRIT_UI_USE_IMGUI=OFF | |
| -DSPIRIT_UI_CXX_USE_QT=OFF | |
| -DSPIRIT_USE_CUDA=ON | |
| -DSPIRIT_CUDA_ARCH=70 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Force downgrade to gcc-10 on Ubuntu 22.04 to avoid a bug in gcc-11.3 header | |
| if: matrix.config.os == 'ubuntu-22.04' | |
| shell: bash | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get --purge remove -y "g++*" | |
| sudo apt-get install -y g++-10 cmake | |
| sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-10 10 | |
| sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-10 10 | |
| - name: π Install CUDA | |
| shell: bash | |
| run: | | |
| wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/cuda-keyring_1.1-1_all.deb | |
| sudo dpkg -i cuda-keyring_1.1-1_all.deb | |
| sudo apt-get update | |
| sudo apt-get install -y cuda-toolkit-12-4 | |
| echo "/usr/local/cuda-12.4/bin" >> $GITHUB_PATH | |
| echo "/usr/local/cuda-12.4/lib64" >> $GITHUB_PATH | |
| - name: π Create build folder | |
| run: cmake -E make_directory ${{runner.workspace}}/build | |
| - name: β Configure | |
| shell: bash | |
| working-directory: ${{runner.workspace}}/build | |
| run: > | |
| CUDA_PATH=/usr/local/cuda | |
| cmake $GITHUB_WORKSPACE | |
| -DCMAKE_BUILD_TYPE=$BUILD_TYPE | |
| $CMAKE_FLAGS | |
| - name: π Build | |
| shell: bash | |
| working-directory: ${{runner.workspace}}/build | |
| run: cmake --build . --config $BUILD_TYPE -j 2 | |
| build-ui-qt: | |
| runs-on: ubuntu-22.04 | |
| env: | |
| BUILD_TYPE: Release | |
| CMAKE_FLAGS: -DSPIRIT_UI_USE_IMGUI=OFF -DSPIRIT_UI_CXX_USE_QT=ON | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: π Install Qt5 | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y qtbase5-dev libqt5charts5-dev | |
| - name: π Create build folder | |
| run: cmake -E make_directory ${{runner.workspace}}/build | |
| - name: β Configure | |
| shell: bash | |
| working-directory: ${{runner.workspace}}/build | |
| run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE $CMAKE_FLAGS | |
| - name: π Build | |
| shell: bash | |
| working-directory: ${{runner.workspace}}/build | |
| run: cmake --build . --config $BUILD_TYPE -j 2 | |
| build-webapp: | |
| name: webapp ${{ matrix.target }} (ubuntu-22.04) | |
| runs-on: ubuntu-22.04 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - target: "mobile" | |
| - target: "desktop" | |
| env: | |
| BUILD_TYPE: Release | |
| CMAKE_FLAGS: -DSPIRIT_BUILD_FOR_JS=ON | |
| EMSCRIPTEN_VERSION: "3.1.38" | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: π Install Emscripten | |
| working-directory: ${{runner.workspace}} | |
| run: | | |
| git clone https://github.com/emscripten-core/emsdk.git | |
| cd emsdk | |
| ./emsdk install $EMSCRIPTEN_VERSION | |
| ./emsdk activate $EMSCRIPTEN_VERSION | |
| - name: π Create build folder | |
| run: cmake -E make_directory ${{runner.workspace}}/build | |
| - name: β Configure (mobile) | |
| if: matrix.target == 'mobile' | |
| shell: bash | |
| working-directory: ${{runner.workspace}}/build | |
| run: > | |
| source ${{runner.workspace}}/emsdk/emsdk_env.sh; | |
| cmake $GITHUB_WORKSPACE | |
| -DCMAKE_BUILD_TYPE=$BUILD_TYPE | |
| -DSPIRIT_UI_USE_IMGUI=OFF | |
| $CMAKE_FLAGS | |
| -DCMAKE_TOOLCHAIN_FILE=${{runner.workspace}}/emsdk/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake | |
| - name: β Configure (desktop) | |
| if: matrix.target == 'desktop' | |
| shell: bash | |
| working-directory: ${{runner.workspace}}/build | |
| run: > | |
| source ${{runner.workspace}}/emsdk/emsdk_env.sh; | |
| cmake $GITHUB_WORKSPACE | |
| -DCMAKE_BUILD_TYPE=$BUILD_TYPE | |
| -DSPIRIT_UI_USE_IMGUI=ON $CMAKE_FLAGS | |
| -DCMAKE_TOOLCHAIN_FILE=${{runner.workspace}}/emsdk/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake | |
| - name: π Build | |
| shell: bash | |
| working-directory: ${{runner.workspace}}/build | |
| run: | | |
| source ${{runner.workspace}}/emsdk/emsdk_env.sh | |
| cmake --build . --config $BUILD_TYPE -j 2 | |
| - name: π¦ Archive mobile web app | |
| if: matrix.target == 'mobile' | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: webapp-mobile | |
| path: ui-web/ | |
| if-no-files-found: error | |
| - name: π¦ Archive desktop web app | |
| if: matrix.target == 'desktop' | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: webapp-desktop | |
| path: ui-cpp/ui-imgui/webapp/ | |
| if-no-files-found: error | |
| deploy-package: | |
| if: github.event_name != 'pull_request' | |
| needs: | |
| - call-quality | |
| - test-gcc | |
| - test-clang | |
| - test-nvcpp | |
| - test-msvc | |
| - test-debug | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, macos-latest, windows-latest] | |
| env: | |
| BUILD_TYPE: Release | |
| CMAKE_FLAGS: -DSPIRIT_UI_USE_IMGUI=ON -DSPIRIT_UI_CXX_USE_QT=OFF -DSPIRIT_BUNDLE_APP=ON | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: π Install required system packages | |
| if: matrix.os == 'ubuntu-latest' | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y xorg-dev libglu1-mesa-dev libgtk-3-dev | |
| - name: π Create build folder | |
| run: cmake -E make_directory ${{runner.workspace}}/build | |
| - name: β Configure | |
| shell: bash | |
| working-directory: ${{runner.workspace}}/build | |
| run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE $CMAKE_FLAGS | |
| - name: π Build | |
| shell: bash | |
| working-directory: ${{runner.workspace}}/build | |
| run: | | |
| cmake --build . --config $BUILD_TYPE -j 2 | |
| cmake --install . | |
| cmake --build . --config $BUILD_TYPE -j 2 --target package | |
| - name: π¦ Archive ubuntu package | |
| if: matrix.os == 'ubuntu-latest' | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: spirit-ubuntu | |
| path: ${{runner.workspace}}/build/*.tar.gz | |
| if-no-files-found: error | |
| - name: π¦ Archive macOS package | |
| if: matrix.os == 'macos-latest' | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: spirit-macos | |
| path: | | |
| ${{runner.workspace}}/build/*.dmg | |
| ${{runner.workspace}}/build/install/README.md | |
| ${{runner.workspace}}/build/install/LICENSE.txt | |
| ${{runner.workspace}}/build/install/VERSION.txt | |
| ${{runner.workspace}}/build/install/licenses/ | |
| if-no-files-found: error | |
| - name: π¦ Archive windows package | |
| if: matrix.os == 'windows-latest' | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: spirit-windows | |
| path: ${{runner.workspace}}/build/*.zip | |
| if-no-files-found: error | |
| draft-release: | |
| if: github.event_name == 'push' && startsWith( github.ref, 'refs/tags/' ) | |
| needs: [deploy-package, build-webapp] | |
| runs-on: ubuntu-latest | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: π Generate a changelog | |
| id: changelog | |
| uses: metcalfc/changelog-generator@v1.0.0 | |
| with: | |
| myToken: ${{ secrets.GITHUB_TOKEN }} | |
| - name: π Print the changelog | |
| run: echo "${{ steps.changelog.outputs.changelog }}" | |
| - name: π Create draft release | |
| id: draft_release | |
| uses: actions/create-release@v1 | |
| with: | |
| tag_name: ${{ github.ref }} | |
| release_name: Release ${{ github.ref }} | |
| body: ${{ steps.changelog.outputs.changelog }} | |
| draft: true |