Merge pull request #740 from Afforix/loch-msvc #68
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: CMake | |
| permissions: | |
| contents: read | |
| on: [push, pull_request] | |
| jobs: | |
| Ubuntu: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| include: | |
| - { os: ubuntu-22.04, cc: gcc, cxx: g++, type: Release, pkgs: "libwxgtk3.0-gtk3-dev libvtk9-dev", args: "-DUSE_BUNDLED_CATCH2=ON" } | |
| - { os: ubuntu-22.04, cc: clang, cxx: clang++, type: Release, pkgs: "catch2 libwxgtk3.0-gtk3-dev libvtk9-dev", args: "" } | |
| - { os: ubuntu-24.04, cc: gcc, cxx: g++, type: Release, pkgs: "catch2 libwxgtk3.2-dev libvtk9-dev", args: "-DCMAKE_CXX_FLAGS=\"-Wno-array-bounds -Wno-stringop-overflow\"" } | |
| - { os: ubuntu-24.04, cc: clang, cxx: clang++, type: RelWithDebInfo, pkgs: "catch2 libwxgtk3.2-dev libvtk9-dev", args: "-DECM_ENABLE_SANITIZERS=address" } | |
| - { os: ubuntu-24.04, cc: clang, cxx: clang++, type: Debug, pkgs: "catch2 libwxgtk3.2-dev libvtk9-dev", args: "-DENABLE_CLANG_TIDY=ON" } | |
| env: | |
| CC: ${{ matrix.cc }} | |
| CXX: ${{ matrix.cxx }} | |
| CTEST_OUTPUT_ON_FAILURE: 1 | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: install dependencies | |
| run: | | |
| sudo apt -qq update | |
| sudo apt install -y ${{ matrix.pkgs }} texlive-binaries texlive-metapost libproj-dev libshp-dev survex imagemagick ghostscript ninja-build clang-tidy gettext libfmt-dev | |
| - name: install additional texlive languages | |
| if: matrix.os == 'ubuntu-24.04' | |
| run: sudo apt install -y texlive-lang-czechslovak texlive-lang-cyrillic | |
| - name: Configure CMake | |
| run: | | |
| mkdir build && cd build && \ | |
| cmake -G Ninja \ | |
| -DCMAKE_BUILD_TYPE=${{ matrix.type }} \ | |
| -DCMAKE_COMPILE_WARNING_AS_ERROR=ON \ | |
| -DUSE_BUNDLED_SHAPELIB=OFF \ | |
| ${{ matrix.args }} .. | |
| - run: cmake --build build | |
| - run: cmake --build build -t test | |
| - name: Run samples | |
| if: matrix.os == 'ubuntu-24.04' | |
| run: cmake --build build -t samples-verify-crc -- -j 4 | |
| - run: cmake --build build -t samples-verify-ref -- -j 4 | |
| - uses: actions/upload-artifact@v6 | |
| if: matrix.os == 'ubuntu-24.04' && always() | |
| with: | |
| name: samples-${{ matrix.os }}-${{ matrix.cc }}-${{ matrix.type }} | |
| path: build/samples/ | |
| - name: Install | |
| run: sudo cmake --build build -t install | |
| macOS: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| os: [macos-14, macos-15, macos-26] | |
| env: | |
| CTEST_OUTPUT_ON_FAILURE: 1 | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: install dependencies | |
| run: | | |
| find /usr/local/bin -lname '*/Library/Frameworks/Python.framework/*' -delete -print | |
| brew unlink python && brew link --overwrite python | |
| brew update # try to comment out in case of package problems | |
| brew install wxwidgets vtk proj basictex fmt catch2 imagemagick | |
| - name: Configure CMake | |
| run: | | |
| mkdir build && cd build && cmake -G Ninja -DECM_ENABLE_SANITIZERS=address -DCMAKE_COMPILE_WARNING_AS_ERROR=ON -DBUILD_THBOOK=OFF .. | |
| - run: cmake --build build -t therion loch utest | |
| - run: cmake --build build -t test | |
| - name: Run samples | |
| run: | | |
| eval "$(/usr/libexec/path_helper)" | |
| sudo tlmgr update --self | |
| sudo tlmgr install collection-langcyrillic | |
| sudo tlmgr install collection-langczechslovak | |
| cmake --build build -t samples-verify-crc -- -j 4 | |
| cmake --build build -t samples-verify-ref -- -j 4 | |
| - uses: actions/upload-artifact@v6 | |
| if: always() | |
| with: | |
| name: samples-${{ matrix.os }} | |
| path: build/samples/ | |
| - name: Install | |
| run: sudo cmake --build build -t install | |
| Windows: | |
| runs-on: windows-latest | |
| strategy: | |
| matrix: | |
| config: | |
| - { msystem: UCRT64, arch: ucrt-x86_64, args: "" } | |
| - { msystem: CLANG64, arch: clang-x86_64, args: "-DECM_ENABLE_SANITIZERS=address -DENABLE_PROJ_CMAKE=ON -DCMAKE_CXX_FLAGS=\"-Qunused-arguments\"" } | |
| defaults: | |
| run: | |
| shell: msys2 {0} | |
| env: | |
| THDIR: ${{ github.workspace }} | |
| CTEST_OUTPUT_ON_FAILURE: 1 | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: msys2/setup-msys2@v2 | |
| with: | |
| msystem: ${{ matrix.config.msystem }} | |
| update: true | |
| install: > | |
| make | |
| git | |
| python | |
| diffutils | |
| mingw-w64-${{ matrix.config.arch }}-freetype | |
| mingw-w64-${{ matrix.config.arch }}-cmake | |
| mingw-w64-${{ matrix.config.arch }}-proj | |
| mingw-w64-${{ matrix.config.arch }}-shapelib | |
| mingw-w64-${{ matrix.config.arch }}-vtk | |
| mingw-w64-${{ matrix.config.arch }}-wxwidgets3.2-gtk3 | |
| mingw-w64-${{ matrix.config.arch }}-wxwidgets3.2-msw | |
| mingw-w64-${{ matrix.config.arch }}-gcc | |
| mingw-w64-${{ matrix.config.arch }}-make | |
| mingw-w64-${{ matrix.config.arch }}-bwidget | |
| mingw-w64-${{ matrix.config.arch }}-fmt | |
| mingw-w64-${{ matrix.config.arch }}-catch | |
| - run: mkdir build && cd build && cmake -G "MSYS Makefiles" -DCMAKE_COMPILE_WARNING_AS_ERROR=ON -DBUILD_THBOOK=OFF ${{ matrix.config.args }} .. | |
| - run: cmake --build build -t therion loch utest -- -j 4 | |
| - name: Set up the batteries | |
| run: | | |
| THDIR="${THDIR:0:2}/a/therion" | |
| reg add HKCU\\Software\\Therion //v InstallDir //t REG_SZ //d "${THDIR}/therion-batteries" | |
| mkdir -p $HOME/.therion | |
| echo -e "mpost-path ${THDIR}/therion-batteries/bin/windows/mpost.exe\npdftex-path ${THDIR}/therion-batteries/bin/windows/pdftex.exe\nidentify-path ${THDIR}/therion-batteries/bin/identify.exe\nconvert-path ${THDIR}/therion-batteries/bin/convert.exe\n" > $HOME/.therion/therion.ini | |
| wget -qO - https://github.com/therion/therion-batteries/archive/master.tar.gz | tar -xzf - && mv therion-batteries-master ../therion-batteries | |
| cp -r ../therion-batteries/_proj/{proj-$(awk -F "=" '/version/{print $2}' build/innosetup.ini),proj-datumgrid}/ ../therion-batteries/lib/ | |
| - run: cmake --build build -t test | |
| - run: cmake --build build -t samples-verify-crc -- -j 4 | |
| - run: cmake --build build -t samples-verify-ref -- -j 4 | |
| - uses: actions/upload-artifact@v6 | |
| if: always() | |
| with: | |
| name: samples-windows-${{ matrix.config.msystem }} | |
| path: build/samples/ | |
| - run: cmake --build build -t deploy -- -j 4 |