From 300d4e0135673afb6703a1b36a034fdfe2e77a7f Mon Sep 17 00:00:00 2001 From: 500-internal-server-error <76838083+500-internal-server-error@users.noreply.github.com> Date: Wed, 19 Feb 2025 21:53:51 +0700 Subject: [PATCH] Fix CI for Windows MinGW builds --- .github/workflows/build_cmake.yml | 32 +++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/.github/workflows/build_cmake.yml b/.github/workflows/build_cmake.yml index e45e448..10d2044 100644 --- a/.github/workflows/build_cmake.yml +++ b/.github/workflows/build_cmake.yml @@ -157,6 +157,7 @@ jobs: brew install ${{ matrix.config.packages }} - name: Configure project + if: matrix.config.msystem == '' shell: bash run: | export CC=${{ matrix.config.cc }} @@ -171,12 +172,43 @@ jobs: args+=(-DCMAKE_INSTALL_PREFIX:PATH=install) cmake "${args[@]}" + - name: Configure project (MSYS2) + if: matrix.config.msystem != '' + shell: msys2 {0} + run: | + export CC=${{ matrix.config.cc }} + export CXX=${{ matrix.config.cxx }} + ninja --version + cmake --version + mkdir build + mkdir install + args=(-G "${{ matrix.config.generator }}" -S . -B build -DCMAKE_BUILD_TYPE=${{ matrix.config.build_type }}) + [[ "${{ matrix.config.build_type }}" == "Debug" ]] && args+=(-DGHC_COVERAGE=ON) + [[ -n "${{ matrix.config.msystem }}" ]] && args+=(-DGHC_FILESYSTEM_BUILD_STD_TESTING=NO) + args+=(-DCMAKE_INSTALL_PREFIX:PATH=install) + cmake "${args[@]}" + - name: Build project + if: matrix.config.msystem == '' shell: bash run: | cmake --build build --config ${{ matrix.config.build_type }} + - name: Build project (MSYS2) + if: matrix.config.msystem != '' + shell: msys2 {0} + run: | + cmake --build build --config ${{ matrix.config.build_type }} + - name: Run tests + if: matrix.config.msystem == '' + shell: bash + run: | + cd build && ctest -C ${{ matrix.config.build_type }} + + - name: Run tests (MSYS2) + if: matrix.config.msystem != '' + shell: msys2 {0} run: | cd build && ctest -C ${{ matrix.config.build_type }}