From d5b5a81946c5ecf40f1b083eee96ebf8ef472f79 Mon Sep 17 00:00:00 2001 From: Rokas Kupstys Date: Wed, 23 Oct 2019 18:10:47 +0300 Subject: [PATCH] GitHub Actions CI script for Windows/Linux/MacOS/iOS/Emscripten builds. --- .github/workflows/build.yml | 108 ++++++++++++++++++++++++++++++++++++ docs/CHANGELOG.txt | 2 + docs/README.md | 4 +- 3 files changed, 112 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 000000000..54d267aeb --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,108 @@ +name: build + +on: [push, pull_request] + +jobs: + Windows: + runs-on: windows-2019 + env: + MSBUILD_PATH: C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\ + steps: + - uses: actions/checkout@v1 + with: + fetch-depth: 1 + + - name: Fix Projects + shell: powershell + run: | + # Replace v110 toolset with v142. Only v141 and v142 toolsets are available on CI workers. + # Replace 8.1 platform sdk with 10.0.18362.0. Workers do not contain legacy SDKs. + # WARNING: This will need updating if toolset/sdk change in project files! + gci -recurse -filter "*.vcxproj" | ForEach-Object { + (Get-Content $_.FullName) -Replace "v110","v142" -Replace "8.1","10.0.18362.0" | Set-Content -Path $_.FullName + } + + - name: Build x86 + shell: cmd + run: | + "%MSBUILD_PATH%\MSBuild.exe" /p:Platform=Win32 /p:Configuration=Release examples/imgui_examples.sln + + - name: Build x64 + shell: cmd + run: | + "%MSBUILD_PATH%\MSBuild.exe" /p:Platform=x64 /p:Configuration=Release examples/imgui_examples.sln + + Linux: + runs-on: ubuntu-18.04 + steps: + - uses: actions/checkout@v1 + with: + fetch-depth: 1 + + - name: Install Dependencies + run: | + sudo apt-get update + sudo apt-get install -y libglfw3-dev libsdl2-dev + + - name: Build + run: | + make -C examples/example_null + make -C examples/example_glfw_opengl2 + make -C examples/example_glfw_opengl3 + make -C examples/example_sdl_opengl2 + make -C examples/example_sdl_opengl3 + + MacOS: + runs-on: macOS-10.14 + steps: + - uses: actions/checkout@v1 + with: + fetch-depth: 1 + + - name: Install Dependencies + run: | + brew install glfw3 + brew install sdl2 + + - name: Build + run: | + make -C examples/example_null + make -C examples/example_glfw_opengl2 + make -C examples/example_glfw_opengl3 + make -C examples/example_glfw_metal + make -C examples/example_sdl_opengl2 + make -C examples/example_sdl_opengl3 + xcodebuild -project examples/example_apple_metal/example_apple_metal.xcodeproj -target example_apple_metal_macos + xcodebuild -project examples/example_apple_opengl2/example_apple_opengl2.xcodeproj -target example_osx_opengl2 + + iOS: + runs-on: macOS-10.14 + steps: + - uses: actions/checkout@v1 + with: + fetch-depth: 1 + + - name: Build + run: | + # Code signing is required, but we disable it because it is irrelevant for CI builds. + xcodebuild -project examples/example_apple_metal/example_apple_metal.xcodeproj -target example_apple_metal_ios CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO CODE_SIGNING_ALLOWED=NO + + Emscripten: + runs-on: ubuntu-18.04 + steps: + - uses: actions/checkout@v1 + with: + fetch-depth: 1 + + - name: Install Dependencies + run: | + wget -q https://s3.amazonaws.com/mozilla-games/emscripten/releases/emsdk-portable.tar.gz + tar -xvf emsdk-portable.tar.gz + emsdk-portable/emsdk update + emsdk-portable/emsdk install latest + emsdk-portable/emsdk activate latest + + - name: Build + run: | + source emsdk-portable/emsdk_env.sh + make -C examples/example_emscripten diff --git a/docs/CHANGELOG.txt b/docs/CHANGELOG.txt index 46948ecca..d52561d69 100644 --- a/docs/CHANGELOG.txt +++ b/docs/CHANGELOG.txt @@ -75,6 +75,8 @@ Other Changes: - Examples: Emscripten: Removed NO_FILESYSTEM from Makefile, seems to fail on some setup. (#2734) [@Funto] - Backends: OSX: Fix using Backspace key. (#2578, #2817, #2818) [@DiligentGraphics] - Backends: GLFW: Previously installed user callbacks are now restored on shutdown. (#2836) [@malte-v] +- CI: Set up a bunch of continuous-integration tests using GitHub Actions. We now compile many of the example + applications on Windows, Linux, MacOS, iOS, Emscripten. Removed Travis integration. (#2865) [@rokups] ----------------------------------------------------------------------- diff --git a/docs/README.md b/docs/README.md index e91db64cf..ac2e03a26 100644 --- a/docs/README.md +++ b/docs/README.md @@ -1,6 +1,6 @@ dear imgui ===== -[![Build Status](https://api.travis-ci.com/ocornut/imgui.svg?branch=master)](https://travis-ci.com/ocornut/imgui) +[![Build Status](https://github.com/ocornut/imgui/workflows/build/badge.svg)](https://github.com/ocornut/imgui/actions?workflow=build) [![Coverity Status](https://scan.coverity.com/projects/4720/badge.svg)](https://scan.coverity.com/projects/4720) (This library is available under a free and permissive license, but needs financial support to sustain its continued improvements. In addition to maintenance and stability there are many desirable features yet to be added. If your company is using dear imgui, please consider reaching out. If you are an individual using dear imgui, please consider supporting the project via Patreon or PayPal.) @@ -33,7 +33,7 @@ Dear ImGui is particularly suited to integration in games engine (for tooling), **No specific build process is required**. You can add the .cpp files to your existing project. -You will need a backend to integrate Dear ImGui in your app. The backend passes mouse/keyboard/gamepad inputs and variety of settings to Dear ImGui, and is in charge of rendering the resulting vertices. +You will need a backend to integrate Dear ImGui in your app. The backend passes mouse/keyboard/gamepad inputs and variety of settings to Dear ImGui, and is in charge of rendering the resulting vertices. **Backends for a variety of graphics api and rendering platforms** are provided in the [examples/](https://github.com/ocornut/imgui/tree/master/examples) folder, along with example applications. See the [Integration](#integration) section of this document for details. You may also create your own backend. Anywhere where you can render textured triangles, you can render Dear ImGui.