From 9a1c72e2d652820209bb23b277d1b888e976011d Mon Sep 17 00:00:00 2001 From: Pascal Thomet Date: Wed, 20 Dec 2023 09:53:24 +0100 Subject: [PATCH] CI: MingW for sdl & glfw - Add CI for TestEngine --- .github/workflows/MinGW.yml | 22 +++++++++++++++--- .github/workflows/TestEngine.yml | 35 +++++++++++++++++++++++++++++ .github/workflows/Win_Mac_Linux.yml | 13 +++++++---- README.md | 1 + README.src.md | 1 + 5 files changed, 65 insertions(+), 7 deletions(-) create mode 100644 .github/workflows/TestEngine.yml diff --git a/.github/workflows/MinGW.yml b/.github/workflows/MinGW.yml index 7e5217e8..561bfedc 100644 --- a/.github/workflows/MinGW.yml +++ b/.github/workflows/MinGW.yml @@ -8,6 +8,11 @@ on: jobs: build: runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + window_backend: [ Glfw, Sdl ] + steps: - uses: actions/checkout@master - name: Checkout submodules @@ -28,12 +33,23 @@ jobs: run: | mkdir build_x86_64 cd build_x86_64 - cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=../cmake/mingw_x86_64.cmake + if [ "${{ matrix.window_backend }}" = "Sdl" ]; then + cmake .. -DCMAKE_TOOLCHAIN_FILE=../cmake/mingw_x86_64.cmake -DCMAKE_BUILD_TYPE=Release -DHELLOIMGUI_USE_SDL_OPENGL3=ON + fi + if [ "${{ matrix.window_backend }}" = "Glfw" ]; then + cmake .. -DCMAKE_TOOLCHAIN_FILE=../cmake/mingw_x86_64.cmake -DCMAKE_BUILD_TYPE=Release + fi make -j 4 - name: Build i686 run: | mkdir build_i686 cd build_i686 - cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=../cmake/mingw_i686.cmake - make -j 4 + if [ "${{ matrix.window_backend }}" = "Sdl" ]; then + cmake .. -DCMAKE_TOOLCHAIN_FILE=../cmake/mingw_i686.cmake -DCMAKE_BUILD_TYPE=Release -DHELLOIMGUI_USE_SDL_OPENGL3=ON + fi + if [ "${{ matrix.window_backend }}" = "Glfw" ]; then + cmake .. -DCMAKE_TOOLCHAIN_FILE=../cmake/mingw_i686.cmake -DCMAKE_BUILD_TYPE=Release + fi + make -j 4 + diff --git a/.github/workflows/TestEngine.yml b/.github/workflows/TestEngine.yml new file mode 100644 index 00000000..e14126eb --- /dev/null +++ b/.github/workflows/TestEngine.yml @@ -0,0 +1,35 @@ +name: "TestEngine" + +# Test that a build with ImGui Test Engine works + +on: + workflow_dispatch: + pull_request: + push: + + +jobs: + build: + name: Test + runs-on: ${{ matrix.platform }} + strategy: + fail-fast: false + matrix: + platform: [windows-latest, macos-latest, ubuntu-latest] + + steps: + - uses: actions/checkout@v3 + with: + submodules: true + + - name: apt install xorg-dev libglfw3-dev (ubuntu only) + if: ${{ matrix.platform == 'ubuntu-latest' }} + run: sudo apt-get update && sudo apt-get install -y xorg-dev libglfw3-dev + + - name: Build and install + shell: bash + run: | + mkdir build + cd build + cmake .. -DHELLOIMGUI_WITH_TEST_ENGINE=ON -DCMAKE_BUILD_TYPE=Release + cmake --build . -j 3 diff --git a/.github/workflows/Win_Mac_Linux.yml b/.github/workflows/Win_Mac_Linux.yml index 316818c6..1aa1c61a 100644 --- a/.github/workflows/Win_Mac_Linux.yml +++ b/.github/workflows/Win_Mac_Linux.yml @@ -10,13 +10,13 @@ on: jobs: build: - name: Cpp Lib ${{matrix.platform}} TestNg:${{matrix.test_engine}} + name: Cpp runs-on: ${{ matrix.platform }} strategy: fail-fast: false matrix: platform: [windows-latest, macos-latest, ubuntu-latest] - test_engine: [ON, OFF] + window_backend: [ Glfw, Sdl ] steps: - uses: actions/checkout@v3 @@ -25,12 +25,17 @@ jobs: - name: apt install xorg-dev libglfw3-dev (ubuntu only) if: ${{ matrix.platform == 'ubuntu-latest' }} - run: sudo apt-get update && sudo apt-get install -y xorg-dev libglfw3-dev + run: sudo apt-get update && sudo apt-get install -y xorg-dev libglfw3-dev libsdl2-dev - name: Build and install shell: bash run: | mkdir build cd build - cmake .. -DHELLOIMGUI_WITH_TEST_ENGINE=${{ matrix.test_engine }} -DCMAKE_BUILD_TYPE=Release + if [ "${{ matrix.window_backend }}" = "Sdl" ]; then + cmake .. -DHELLOIMGUI_USE_SDL_OPENGL3=ON -DCMAKE_BUILD_TYPE=Release + fi + if [ "${{ matrix.window_backend }}" = "Glfw" ]; then + cmake .. -DCMAKE_BUILD_TYPE=Release + fi cmake --build . -j 3 diff --git a/README.md b/README.md index a17cf7a3..90890569 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,7 @@ [![Android](https://github.com/pthom/hello_imgui/workflows/Android/badge.svg)](https://github.com/pthom/hello_imgui/actions/workflows/Android.yml) [![Emscripten](https://github.com/pthom/hello_imgui/workflows/Emscripten/badge.svg)](https://github.com/pthom/hello_imgui/actions/workflows/Emscripten.yml) [![StarterTemplate](https://github.com/pthom/hello_imgui/workflows/StarterTemplate/badge.svg)](https://github.com/pthom/hello_imgui/actions/workflows/StarterTemplate.yml) +[![TestEngine](https://github.com/pthom/hello_imgui/workflows/TestEngine/badge.svg)](https://github.com/pthom/hello_imgui/actions/workflows/TestEngine.yml) [![Automate](https://github.com/pthom/hello_imgui/workflows/Automate/badge.svg)](https://github.com/pthom/hello_imgui/actions/workflows/Automate.yml) [![Metal](https://github.com/pthom/hello_imgui/workflows/Metal/badge.svg)](https://github.com/pthom/hello_imgui/actions/workflows/Metal.yml) diff --git a/README.src.md b/README.src.md index 720750aa..24ba85e0 100644 --- a/README.src.md +++ b/README.src.md @@ -6,6 +6,7 @@ [![Android](https://github.com/pthom/hello_imgui/workflows/Android/badge.svg)](https://github.com/pthom/hello_imgui/actions/workflows/Android.yml) [![Emscripten](https://github.com/pthom/hello_imgui/workflows/Emscripten/badge.svg)](https://github.com/pthom/hello_imgui/actions/workflows/Emscripten.yml) [![StarterTemplate](https://github.com/pthom/hello_imgui/workflows/StarterTemplate/badge.svg)](https://github.com/pthom/hello_imgui/actions/workflows/StarterTemplate.yml) +[![TestEngine](https://github.com/pthom/hello_imgui/workflows/TestEngine/badge.svg)](https://github.com/pthom/hello_imgui/actions/workflows/TestEngine.yml) [![Automate](https://github.com/pthom/hello_imgui/workflows/Automate/badge.svg)](https://github.com/pthom/hello_imgui/actions/workflows/Automate.yml) [![Metal](https://github.com/pthom/hello_imgui/workflows/Metal/badge.svg)](https://github.com/pthom/hello_imgui/actions/workflows/Metal.yml)