Skip to content

Commit

Permalink
mingw unittest
Browse files Browse the repository at this point in the history
  • Loading branch information
Nopey committed Nov 27, 2024
1 parent f8b5f29 commit 4626fee
Showing 1 changed file with 41 additions and 13 deletions.
54 changes: 41 additions & 13 deletions .github/workflows/compilation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,42 +37,70 @@ jobs:
unittest:
name: Run unit-tests on ${{ matrix.config.name }}
runs-on: ubuntu-24.04
env:
CC: ${{ matrix.config.cc }}

strategy:
fail-fast: false
matrix:
config:
- { name: "gcc 14", cc: gcc-14, tidy: "Off" }
- { name: "clang 18", cc: clang-18, tidy: "On" }
- name: GCC 14
apt_deps: >-
libargtable2-dev libcunit1-dev libsdl2-mixer-dev libconfuse-dev
libenet-dev libsdl2-dev libxmp-dev libpng-dev libepoxy-dev gcc-14
configure_flags: '-DCMAKE_C_COMPILER=gcc-14'
- name: Clang 18
apt_deps: >-
libargtable2-dev libcunit1-dev libsdl2-mixer-dev libconfuse-dev
libenet-dev libsdl2-dev libxmp-dev libpng-dev libepoxy-dev clang-18
clang-tidy-18
configure_flags: '-DCMAKE_C_COMPILER=clang-18 -DUSE_TIDY=ON'
- name: MinGW-w64
is_mingw: true
apt_deps: mingw-w64 wine wine64
configure_flags: >-
--toolchain cmake-scripts/mingw-w64-toolchain.cmake
-DCMAKE_PREFIX_PATH=openomf-win-build-main/
-DCMAKE_INCLUDE_PATH=openomf-win-build-main/include/
-DCMAKE_LIBRARY_PATH=openomf-win-build-main/lib/
-DCMAKE_FIND_ROOT_PATH=openomf-win-build-main/
steps:
- uses: actions/checkout@v4

- name: Install Ubuntu Dependencies
uses: Eeems-Org/[email protected]
with:
packages: cmake cmake-data libargtable2-dev libcunit1-dev
libsdl2-mixer-dev libconfuse-dev libenet-dev libsdl2-dev libxmp-dev libpng-dev
libepoxy-dev clang-tidy-18 ${{ matrix.config.cc }}
packages: cmake cmake-data ninja-build ${{ matrix.config.apt_deps }}

- if: ${{ matrix.config.is_mingw }}
name: Download prebuilt MinGW-W64 dependencies
run: |
wget -q https://github.com/omf2097/openomf-win-build/archive/refs/heads/main.zip
unzip -q main.zip && rm main.zip
- name: Build tests
run: |
mkdir build-test && cd build-test
cmake -DCMAKE_BUILD_TYPE=Debug \
-DUSE_TIDY=${{ matrix.config.tidy }} \
-DUSE_TESTS=On \
-DUSE_SANITIZERS=On \
-DUSE_FATAL_SANITIZERS=On \
-DUSE_TOOLS=On \
..
make -j $(getconf _NPROCESSORS_ONLN)
${{ matrix.config.configure_flags }} \
-G Ninja \
-S. -B build-test
cmake --build build-test
- if: ! ${{ matrix.config.is_mingw }}
name: Run tests (natively)
run: |
cd build-test
./openomf_test_main -V
- name: Run tests
- if: ${{ matrix.config.is_mingw }}
name: Run tests (MinGW, so run via wine)
run: |
cd build-test
make test ARGS="-V"
# TODO: use wine in mingw build
wine openomf_test_main.exe -V
# Build windows package, release artifact (MSVC)
# -----------------------------------------------------------------------------------------------
Expand Down

0 comments on commit 4626fee

Please sign in to comment.