diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 84b8c99..d956f78 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,4 +1,3 @@ -# https://github.com/openblack/bgfx.cmake/blob/master/.github/workflows/ci.yml name: CI on: @@ -7,10 +6,41 @@ on: pull_request: branches: [ master ] +env: + # Indicates the CMake build directory where project files and binaries are being produced. + CMAKE_BUILD_DIR: ${{ github.workspace }}/build/ + jobs: + minimum-cmake-version: + name: Check compatibility with minimum cmake version + runs-on: ubuntu-latest + env: + CMAKE_VERSION: 3.6.0 + steps: + - uses: actions/checkout@v2 + with: + submodules: recursive + - name: Install Linux dependencies + run: | + sudo apt-get update + sudo apt install -y libgl1-mesa-dev + - uses: lukka/get-cmake@latest + with: + cmakeVersion: ${{ env.CMAKE_VERSION }} + - name: Check cmake version + run: | + cmake --version | grep ${{ env.CMAKE_VERSION }} + - name: Test config + # old way of configuring a build directory + run: | + mkdir -p "${{ env.CMAKE_BUILD_DIR }}" + cd "${{ env.CMAKE_BUILD_DIR }}" + cmake ${{ github.workspace }} -GNinja -DCMAKE_BUILD_TYPE=Release + native: name: ${{ matrix.os }} ${{ matrix.cc }} runs-on: ${{ matrix.os }} + needs: minimum-cmake-version strategy: fail-fast: false matrix: @@ -23,14 +53,9 @@ jobs: cc: clang cxx: clang++ - os: macos-latest - env: - # Indicates the CMake build directory where project files and binaries are being produced. - CMAKE_BUILD_DIR: ${{ github.workspace }}/build/ - CC: ${{ matrix.cc }} CXX: ${{ matrix.cxx }} - steps: - uses: actions/checkout@v2 with: @@ -65,13 +90,9 @@ jobs: cross-android: name: cross-android runs-on: ubuntu-latest + needs: minimum-cmake-version strategy: fail-fast: false - - env: - # Indicates the CMake build directory where project files and binaries are being produced. - CMAKE_BUILD_DIR: ${{ github.workspace }}/build/ - steps: - uses: actions/checkout@v2 with: diff --git a/CMakeLists.txt b/CMakeLists.txt index b0432a6..3eb016d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -8,7 +8,7 @@ # You should have received a copy of the CC0 Public Domain Dedication along with # this software. If not, see . -cmake_minimum_required(VERSION 3.6) +cmake_minimum_required(VERSION 3.6.0) # version supported by android studio project(bgfx) cmake_policy(SET CMP0054 NEW)