Add MinGW support #523
Workflow file for this run
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: Omath CI | |
| on: | |
| push: | |
| branches: [ main ] | |
| pull_request: | |
| branches: [ main ] | |
| concurrency: | |
| group: ci-${{ github.ref }} | |
| cancel-in-progress: true | |
| ############################################################################## | |
| # 1) Arch Linux – Clang / Ninja | |
| ############################################################################## | |
| jobs: | |
| arch-build-and-test: | |
| name: Arch Linux (Clang) (x64-linux) | |
| runs-on: ubuntu-latest | |
| container: archlinux:latest | |
| env: | |
| VCPKG_ROOT: ${{ github.workspace }}/vcpkg | |
| steps: | |
| - name: Install basic tool-chain with pacman | |
| shell: bash | |
| run: | | |
| pacman -Sy --noconfirm archlinux-keyring | |
| pacman -Syu --noconfirm --needed \ | |
| git base-devel clang cmake ninja zip unzip fmt | |
| - name: Checkout repository (with sub-modules) | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Set up vcpkg | |
| shell: bash | |
| run: | | |
| git clone https://github.com/microsoft/vcpkg "$VCPKG_ROOT" | |
| - name: Configure (cmake --preset) | |
| shell: bash | |
| run: cmake --preset linux-release-vcpkg -DOMATH_BUILD_TESTS=ON -DOMATH_BUILD_BENCHMARK=OFF -DVCPKG_MANIFEST_FEATURES="imgui;avx2;tests" | |
| - name: Build | |
| shell: bash | |
| run: cmake --build cmake-build/build/linux-release-vcpkg --target unit_tests omath | |
| - name: Run unit_tests | |
| shell: bash | |
| run: ./out/Release/unit_tests | |
| ############################################################################## | |
| # 2) Windows x64 – MSVC (x64-windows) | |
| ############################################################################## | |
| windows-build-and-test: | |
| name: Windows (MSVC) (x64-windows) | |
| runs-on: windows-latest | |
| env: | |
| OMATH_BUILD_VIA_VCPKG: ON | |
| steps: | |
| - name: Checkout repository (with sub-modules) | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Install Ninja | |
| uses: seanmiddleditch/gha-setup-ninja@v4 | |
| - name: Set up MSVC developer command-prompt | |
| uses: ilammy/msvc-dev-cmd@v1 | |
| - name: Configure (cmake --preset) | |
| shell: bash | |
| run: cmake --preset windows-release-vcpkg -DOMATH_BUILD_TESTS=ON -DOMATH_BUILD_BENCHMARK=OFF -DVCPKG_MANIFEST_FEATURES="imgui;avx2;tests" | |
| - name: Build | |
| shell: bash | |
| run: cmake --build cmake-build/build/windows-release-vcpkg --target unit_tests omath | |
| - name: Run unit_tests.exe | |
| shell: bash | |
| run: ./out/Release/unit_tests.exe | |
| ############################################################################## | |
| # 3) Windows x86 – MSVC (x86-windows) | |
| ############################################################################## | |
| windows-x86-build-and-test: | |
| name: Windows (MSVC) (x86-windows) | |
| runs-on: windows-latest | |
| env: | |
| OMATH_BUILD_VIA_VCPKG: ON | |
| steps: | |
| - name: Checkout repository (with sub-modules) | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Install Ninja | |
| uses: seanmiddleditch/gha-setup-ninja@v4 | |
| - name: Set up MSVC developer command-prompt | |
| uses: ilammy/msvc-dev-cmd@v1 | |
| with: | |
| arch: amd64_x86 | |
| - name: Configure (cmake --preset) | |
| shell: bash | |
| run: cmake --preset windows-release-vcpkg-x86 -DOMATH_BUILD_TESTS=ON -DOMATH_BUILD_BENCHMARK=OFF -DVCPKG_MANIFEST_FEATURES="imgui;avx2;tests" | |
| - name: Build | |
| shell: bash | |
| run: cmake --build cmake-build/build/windows-release-vcpkg-x86 --target unit_tests omath | |
| - name: Run unit_tests.exe | |
| shell: bash | |
| run: ./out/Release/unit_tests.exe | |
| ############################################################################## | |
| # 3) macOS – AppleClang / Ninja | |
| ############################################################################## | |
| macosx-build-and-test: | |
| name: macOS (AppleClang) (arm64-osx) | |
| runs-on: macOS-latest | |
| env: | |
| VCPKG_ROOT: ${{ github.workspace }}/vcpkg | |
| steps: | |
| - name: Install basic tool-chain with Homebrew | |
| shell: bash | |
| run: | | |
| brew install cmake ninja | |
| - name: Checkout repository (with sub-modules) | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Set up vcpkg | |
| shell: bash | |
| run: | | |
| git clone https://github.com/microsoft/vcpkg "$VCPKG_ROOT" | |
| - name: Configure (cmake --preset) | |
| shell: bash | |
| run: cmake --preset darwin-release-vcpkg -DOMATH_BUILD_TESTS=ON -DOMATH_BUILD_BENCHMARK=OFF -DVCPKG_MANIFEST_FEATURES="imgui;avx2;tests" | |
| - name: Build | |
| shell: bash | |
| run: cmake --build cmake-build/build/darwin-release-vcpkg --target unit_tests omath | |
| - name: Run unit_tests | |
| shell: bash | |
| run: ./out/Release/unit_tests | |
| ############################################################################## | |
| # 4) iOS – AppleClang / Xcode / arm64-ios | |
| ############################################################################## | |
| ios-build: | |
| name: iOS (AppleClang) (arm64-ios) | |
| runs-on: macOS-latest | |
| env: | |
| VCPKG_ROOT: ${{ github.workspace }}/vcpkg | |
| steps: | |
| - name: Install CMake tooling | |
| shell: bash | |
| run: | | |
| brew install cmake ninja | |
| - name: Checkout repository (with sub-modules) | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Set up vcpkg | |
| shell: bash | |
| run: | | |
| git clone https://github.com/microsoft/vcpkg "$VCPKG_ROOT" | |
| cd "$VCPKG_ROOT" | |
| ./bootstrap-vcpkg.sh | |
| - name: Configure (cmake --preset) | |
| shell: bash | |
| run: | | |
| cmake --preset ios-release-vcpkg \ | |
| -DVCPKG_INSTALL_OPTIONS="--allow-unsupported" \ | |
| -DOMATH_BUILD_TESTS=ON \ | |
| -DOMATH_BUILD_BENCHMARK=OFF \ | |
| -DVCPKG_MANIFEST_FEATURES="imgui;tests" | |
| - name: Build | |
| shell: bash | |
| run: | | |
| cmake --build cmake-build/build/ios-release-vcpkg --config Release --target unit_tests omath | |
| ############################################################################## | |
| # 5) FreeBSD – Clang / Ninja | |
| ############################################################################## | |
| freebsd-build-and-test: | |
| name: FreeBSD (Clang) (x64-freebsd) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository (with sub-modules) | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Build and Test | |
| uses: vmactions/freebsd-vm@v1 | |
| with: | |
| usesh: true | |
| sync: sshfs | |
| mem: 12288 | |
| copyback: false | |
| prepare: pkg install -y git curl zip unzip gmake llvm gsed bash perl5 openssl 7-zip coreutils cmake ninja pkgconf patchelf | |
| run: | | |
| git config --global --add safe.directory `pwd` | |
| # Build vcpkg in /tmp to avoid sshfs timestamp sync issues | |
| # This prevents PCH timestamp mismatches during parallel builds | |
| export VCPKG_ROOT=/tmp/vcpkg | |
| rm -rf "$VCPKG_ROOT" | |
| git clone https://github.com/microsoft/vcpkg "$VCPKG_ROOT" | |
| cd "$VCPKG_ROOT" | |
| # Bootstrap vcpkg - it will build from source on FreeBSD | |
| # Building in /tmp avoids sshfs timestamp issues that break PCH | |
| ./bootstrap-vcpkg.sh | |
| cd - | |
| export VCPKG_FORCE_SYSTEM_BINARIES=0 | |
| # VCPKG_ROOT is set to /tmp/vcpkg, which CMake will use via the preset | |
| cmake --preset freebsd-release-vcpkg -DOMATH_BUILD_TESTS=ON -DOMATH_BUILD_BENCHMARK=OFF -DVCPKG_MANIFEST_FEATURES="imgui;avx2;tests" -DVCPKG_INSTALL_OPTIONS="--allow-unsupported" | |
| cmake --build cmake-build/build/freebsd-release-vcpkg --target unit_tests omath | |
| ./out/Release/unit_tests | |
| ############################################################################## | |
| # 5) Android NDK – Clang / Ninja / arm64-android | |
| ############################################################################## | |
| android-build-and-test: | |
| name: Android NDK (arm64-android) | |
| runs-on: ubuntu-latest | |
| env: | |
| VCPKG_ROOT: ${{ github.workspace }}/vcpkg | |
| ANDROID_NDK_HOME: ${{ github.workspace }}/android-ndk | |
| steps: | |
| - name: Checkout repository (with sub-modules) | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Install Android NDK | |
| shell: bash | |
| run: | | |
| NDK_VERSION="r28c" | |
| NDK_ZIP="android-ndk-${NDK_VERSION}-linux.zip" | |
| wget -q "https://dl.google.com/android/repository/${NDK_ZIP}" | |
| unzip -q "${NDK_ZIP}" -d "${{ github.workspace }}" | |
| mv "${{ github.workspace }}/android-ndk-${NDK_VERSION}" "$ANDROID_NDK_HOME" | |
| rm "${NDK_ZIP}" | |
| echo "ANDROID_NDK_HOME=${ANDROID_NDK_HOME}" >> $GITHUB_ENV | |
| echo "Android NDK installed at: ${ANDROID_NDK_HOME}" | |
| ls -la "${ANDROID_NDK_HOME}" | head -5 | |
| - name: Install basic tool-chain | |
| shell: bash | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y ninja-build cmake | |
| - name: Set up vcpkg | |
| shell: bash | |
| run: | | |
| git clone https://github.com/microsoft/vcpkg "$VCPKG_ROOT" | |
| cd "$VCPKG_ROOT" | |
| ./bootstrap-vcpkg.sh | |
| - name: Configure (cmake --preset) | |
| shell: bash | |
| run: | | |
| cmake --preset android-release-vcpkg \ | |
| -DVCPKG_INSTALL_OPTIONS="--allow-unsupported" \ | |
| -DOMATH_BUILD_TESTS=ON \ | |
| -DOMATH_BUILD_BENCHMARK=OFF \ | |
| -DVCPKG_MANIFEST_FEATURES="imgui;tests" | |
| - name: Build | |
| shell: bash | |
| run: | | |
| cmake --build cmake-build/build/android-release-vcpkg --target unit_tests omath | |
| ############################################################################## | |
| # 6) WebAssembly (Emscripten) – Clang / Ninja / wasm32-emscripten | |
| ############################################################################## | |
| wasm-build-and-test: | |
| name: WebAssembly (Emscripten) (wasm32-emscripten) | |
| runs-on: ubuntu-latest | |
| env: | |
| VCPKG_ROOT: ${{ github.workspace }}/vcpkg | |
| steps: | |
| - name: Checkout repository (with sub-modules) | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Install basic tool-chain | |
| shell: bash | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y ninja-build | |
| - name: Setup Emscripten | |
| uses: mymindstorm/setup-emsdk@v14 | |
| with: | |
| version: 'latest' | |
| - name: Verify Emscripten | |
| shell: bash | |
| run: | | |
| echo "EMSDK=$EMSDK" | |
| emcc --version | |
| # Verify toolchain file exists | |
| ls -la "$EMSDK/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake" | |
| - name: Set up vcpkg | |
| shell: bash | |
| run: | | |
| git clone https://github.com/microsoft/vcpkg "$VCPKG_ROOT" | |
| cd "$VCPKG_ROOT" | |
| ./bootstrap-vcpkg.sh | |
| - name: Configure (cmake --preset) | |
| shell: bash | |
| run: | | |
| cmake --preset wasm-release-vcpkg \ | |
| -DVCPKG_INSTALL_OPTIONS="--allow-unsupported" \ | |
| -DOMATH_BUILD_TESTS=ON \ | |
| -DOMATH_BUILD_BENCHMARK=OFF \ | |
| -DVCPKG_MANIFEST_FEATURES="imgui;tests" | |
| - name: Build | |
| shell: bash | |
| run: | | |
| cmake --build cmake-build/build/wasm-release-vcpkg --target unit_tests omath | |
| ############################################################################## | |
| # 7) Windows MSYS2 MinGW – GCC / Ninja / x64-mingw-dynamic | |
| ############################################################################## | |
| mingw-build-and-test: | |
| name: MINGW64 (MSYS2) (x64-mingw-dynamic) | |
| runs-on: windows-latest | |
| defaults: | |
| run: | |
| shell: msys2 {0} | |
| env: | |
| VCPKG_ROOT: ${{ github.workspace }}/vcpkg | |
| steps: | |
| - name: Setup MSYS2 | |
| uses: msys2/setup-msys2@v2 | |
| with: | |
| msystem: MINGW64 | |
| update: true | |
| install: >- | |
| mingw-w64-x86_64-toolchain | |
| mingw-w64-x86_64-cmake | |
| mingw-w64-x86_64-ninja | |
| mingw-w64-x86_64-pkg-config | |
| git | |
| base-devel | |
| - name: Checkout repository (with sub-modules) | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Set up vcpkg | |
| run: | | |
| git clone https://github.com/microsoft/vcpkg "$VCPKG_ROOT" | |
| cd "$VCPKG_ROOT" | |
| ./bootstrap-vcpkg.sh | |
| - name: Configure (cmake --preset) | |
| run: | | |
| cmake --preset mingw-release-vcpkg \ | |
| -DVCPKG_INSTALL_OPTIONS="--allow-unsupported" \ | |
| -DOMATH_BUILD_TESTS=ON \ | |
| -DOMATH_BUILD_BENCHMARK=OFF \ | |
| -DVCPKG_MANIFEST_FEATURES="imgui;tests" | |
| - name: Build | |
| run: | | |
| cmake --build cmake-build/build/mingw-release-vcpkg --target unit_tests omath | |
| - name: Run unit_tests.exe | |
| run: | | |
| ./out/Release/unit_tests.exe | |
| ############################################################################## | |
| # 8) Windows UCRT64 MSYS2 MinGW – GCC / Ninja / x64-mingw-dynamic | |
| ############################################################################## | |
| mingw-ucrt-build-and-test: | |
| name: UCRT64 (MSYS2) (x64-mingw-dynamic) | |
| runs-on: windows-latest | |
| defaults: | |
| run: | |
| shell: msys2 {0} | |
| env: | |
| VCPKG_ROOT: ${{ github.workspace }}/vcpkg | |
| steps: | |
| - name: Setup MSYS2 | |
| uses: msys2/setup-msys2@v2 | |
| with: | |
| msystem: UCRT64 | |
| update: true | |
| install: >- | |
| mingw-w64-ucrt-x86_64-toolchain | |
| mingw-w64-ucrt-x86_64-cmake | |
| mingw-w64-ucrt-x86_64-ninja | |
| mingw-w64-ucrt-x86_64-pkg-config | |
| git | |
| base-devel | |
| - name: Checkout repository (with sub-modules) | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Set up vcpkg | |
| run: | | |
| git clone https://github.com/microsoft/vcpkg "$VCPKG_ROOT" | |
| cd "$VCPKG_ROOT" | |
| ./bootstrap-vcpkg.sh | |
| - name: Configure (cmake --preset) | |
| run: | | |
| cmake --preset mingw-release-vcpkg \ | |
| -DVCPKG_INSTALL_OPTIONS="--allow-unsupported" \ | |
| -DOMATH_BUILD_TESTS=ON \ | |
| -DOMATH_BUILD_BENCHMARK=OFF \ | |
| -DVCPKG_MANIFEST_FEATURES="imgui;tests" | |
| - name: Build | |
| run: | | |
| cmake --build cmake-build/build/mingw-release-vcpkg --target unit_tests omath | |
| - name: Run unit_tests.exe | |
| run: | | |
| ./out/Release/unit_tests.exe | |
| ############################################################################## | |
| # 9) Windows MSYS2 MinGW32 – GCC / Ninja / x86-mingw-dynamic | |
| ############################################################################## | |
| mingw32-build-and-test: | |
| name: MINGW32 (MSYS2) (x86-mingw-dynamic) | |
| runs-on: windows-latest | |
| defaults: | |
| run: | |
| shell: msys2 {0} | |
| env: | |
| VCPKG_ROOT: ${{ github.workspace }}/vcpkg | |
| steps: | |
| - name: Setup MSYS2 | |
| uses: msys2/setup-msys2@v2 | |
| with: | |
| msystem: MINGW32 | |
| update: true | |
| install: >- | |
| mingw-w64-i686-toolchain | |
| mingw-w64-i686-cmake | |
| mingw-w64-i686-ninja | |
| mingw-w64-i686-pkg-config | |
| git | |
| base-devel | |
| - name: Checkout repository (with sub-modules) | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Set up vcpkg | |
| run: | | |
| git clone https://github.com/microsoft/vcpkg "$VCPKG_ROOT" | |
| cd "$VCPKG_ROOT" | |
| ./bootstrap-vcpkg.sh | |
| - name: Configure (cmake --preset) | |
| run: | | |
| cmake --preset mingw32-release-vcpkg \ | |
| -DVCPKG_INSTALL_OPTIONS="--allow-unsupported" \ | |
| -DOMATH_BUILD_TESTS=ON \ | |
| -DOMATH_BUILD_BENCHMARK=OFF \ | |
| -DVCPKG_MANIFEST_FEATURES="imgui;tests" | |
| - name: Build | |
| run: | | |
| cmake --build cmake-build/build/mingw32-release-vcpkg --target unit_tests omath | |
| - name: Run unit_tests.exe | |
| run: | | |
| ./out/Release/unit_tests.exe |