From 22e608c5e0879e07483b5e54ea17622e06135b1a Mon Sep 17 00:00:00 2001 From: loanselot1 Date: Sat, 1 May 2021 15:42:31 +0300 Subject: [PATCH] Change CI --- .github/workflows/ci.yml | 55 ++++++++++++ .github/workflows/release.yml | 54 +++++++++++ .travis.yml | 164 ---------------------------------- 3 files changed, 109 insertions(+), 164 deletions(-) create mode 100644 .github/workflows/ci.yml create mode 100644 .github/workflows/release.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..5ab75fe --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,55 @@ +# https://github.com/openblack/bgfx.cmake/blob/master/.github/workflows/ci.yml +name: CI + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + job: + name: ${{ matrix.os }} ${{ matrix.cc }} + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + include: + - os: windows-latest + - os: ubuntu-latest + cc: gcc + cxx: g++ + - os: ubuntu-latest + 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: + submodules: recursive + - name: Install Linux dependencies + run: | + sudo apt install -y libgl1-mesa-dev + if: matrix.os == 'ubuntu-latest' + + # Setup the build machine with the most recent versions of CMake and Ninja. Both are cached if not already: on subsequent runs both will be quickly restored from GitHub cache service. + - uses: lukka/get-cmake@latest + + # On Windows runners, let's ensure to have the Developer Command Prompt environment setup correctly. As used here the Developer Command Prompt created is targeting x64 and using the default the Windows SDK. + - uses: ilammy/msvc-dev-cmd@v1 + + # Run CMake to generate Ninja project files + - name: Generate project files + run: | + cmake -B "${{ env.CMAKE_BUILD_DIR }}" -GNinja -DCMAKE_BUILD_TYPE=Release + # Build the whole project with Ninja (which is spawn by CMake). + - name: Build + run: | + cmake --build "${{ env.CMAKE_BUILD_DIR }}" \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..599c8b0 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,54 @@ +# https://github.com/openblack/bgfx.cmake/blob/master/.github/workflows/release.yml + +name: Release + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + job: + name: ${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + include: + - os: windows-latest + - os: ubuntu-latest + + env: + # Indicates the CMake build directory where project files and binaries are being produced. + CMAKE_BUILD_DIR: ${{ github.workspace }}/build/ + CMAKE_INSTALL_DIR: ${{ github.workspace }}/install/ + + steps: + - uses: actions/checkout@v2 + with: + submodules: recursive + - name: Install Linux dependencies + run: | + sudo apt install -y libgl1-mesa-dev + if: matrix.os == 'ubuntu-latest' + + # Setup the build machine with the most recent versions of CMake and Ninja. Both are cached if not already: on subsequent runs both will be quickly restored from GitHub cache service. + - uses: lukka/get-cmake@latest + + # On Windows runners, let's ensure to have the Developer Command Prompt environment setup correctly. As used here the Developer Command Prompt created is targeting x64 and using the default the Windows SDK. + - uses: ilammy/msvc-dev-cmd@v1 + + # Run CMake to generate project files + - name: Generate project files + run: | + cmake -B "${{ env.CMAKE_BUILD_DIR }}" -DCMAKE_INSTALL_PREFIX="${{ env.CMAKE_INSTALL_DIR }}" -DCMAKE_DEBUG_POSTFIX=d -DBGFX_BUILD_EXAMPLES=OFF -DBGFX_BUILD_TOOLS=ON -DBGFX_INSTALL=ON + # Build the install targets + - name: Build + run: | + cmake --build "${{ env.CMAKE_BUILD_DIR }}" --target install --config Debug + cmake --build "${{ env.CMAKE_BUILD_DIR }}" --target install --config Release + - uses: actions/upload-artifact@v2 + with: + name: ${{ matrix.os }} + path: ${{ github.workspace }}/install/ \ No newline at end of file diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 22306ad..0000000 --- a/.travis.yml +++ /dev/null @@ -1,164 +0,0 @@ -language: cpp - -addons: - apt_packages: - - libgl1-mesa-dev - homebrew: - packages: - - cmake - update: true - -matrix: - include: - - - name: "Linux gcc" - os: linux - dist: xenial - compiler: gcc - env: - - AMALGAMATED=OFF - - - name: "Linux gcc Amalgamated" - os: linux - dist: xenial - compiler: gcc - env: - - AMALGAMATED=ON - - - name: "Linux clang" - os: linux - dist: xenial - compiler: clang - env: - - AMALGAMATED=OFF - - - name: "Linux clang Amalgamated" - os: linux - dist: xenial - compiler: clang - env: - - AMALGAMATED=ON - - - name: "macOS Xcode 10" - os: osx - osx_image: xcode10 - env: - - CMAKE_FLAGS="-GXcode" - - AMALGAMATED=OFF - - - name: "macOS Xcode 10 Amalgamated" - os: osx - osx_image: xcode10 - env: - - CMAKE_FLAGS="-GXcode" - - AMALGAMATED=ON - - - name: "macOS Xcode 10 (Makefiles)" - os: osx - osx_image: xcode10 - env: - - AMALGAMATED=OFF - - - name: "macOS Xcode 10 Amalgamated (Makefiles)" - os: osx - osx_image: xcode10 - env: - - AMALGAMATED=ON - - #- name: "iOS Xcode 10" - # os: osx - # osx_image: xcode10 - # env: - # - CMAKE_FLAGS="-GXcode -DCMAKE_SYSTEM_NAME=iOS -DBGFX_BUILD_TOOLS=OFF -DCMAKE_OSX_SYSROOT=iphonesimulator" - # - AMALGAMATED=OFF - - #- name: "iOS Xcode 10 Amalgamated" - # os: osx - # osx_image: xcode10 - # env: - # - CMAKE_FLAGS="-GXcode -DCMAKE_SYSTEM_NAME=iOS -DBGFX_BUILD_TOOLS=OFF -DCMAKE_OSX_SYSROOT=iphonesimulator" - # - AMALGAMATED=ON - - - name: "Visual studio 15 2017" - os: windows - env: - - AMALGAMATED=OFF - - - - name: "Visual studio 15 2017 Amalgamated" - os: windows - env: - - AMALGAMATED=ON - - - name: "Emscripten" - os: linux - dist: xenial - language: node_js - services: - - docker - before_script: - - docker run -dit --name emscripten -v $(pwd):/src trzeci/emscripten:sdk-incoming-64bit bash - script: - - docker exec -it emscripten emconfigure cmake . -DBGFX_BUILD_TOOLS=OFF -DBGFX_AMALGAMATED=$AMALGAMATED -DBX_AMALGAMATED=$AMALGAMATED - - docker exec -it emscripten emmake make - env: - - AMALGAMATED=OFF - - - name: "Emscripten Amalgamated" - os: linux - dist: xenial - language: node_js - services: - - docker - before_script: - - docker run -dit --name emscripten -v $(pwd):/src trzeci/emscripten:sdk-incoming-64bit bash - script: - - docker exec -it emscripten emconfigure cmake . -DBGFX_BUILD_TOOLS=OFF -DBGFX_AMALGAMATED=$AMALGAMATED -DBX_AMALGAMATED=$AMALGAMATED - - docker exec -it emscripten emmake make - env: - - AMALGAMATED=OFF - - - name: "Android armeabi-v7a" - language: android - android: &androidComponents - components: - - tools - - platform-tools - - build-tools-26.0.1 - env: - - CMAKE_FLAGS="-DCMAKE_SYSTEM_NAME=Android -DBGFX_BUILD_TOOLS=OFF -DBGFX_BUILD_EXAMPLES=OFF -DCMAKE_ANDROID_NDK=$TRAVIS_BUILD_DIR/android-ndk-r18b -DCMAKE_ANDROID_ARCH_ABI=armeabi-v7a -DCMAKE_ANDROID_NDK_TOOLCHAIN_VERSION=clang -DCMAKE_ANDROID_STL_TYPE=c++_shared -DCMAKE_ANDROID_API=26" - - AMALGAMATED=OFF - install: &androidInstall - - echo y | sdkmanager "cmake;3.10.2.4988404" - - sudo ln -sf /usr/local/android-sdk/cmake/3.10.2.4988404/bin/cmake /usr/bin/cmake - - wget https://dl.google.com/android/repository/android-ndk-r18b-linux-x86_64.zip - - unzip -qq android-ndk-r18b-linux-x86_64.zip - - - name: "Android armeabi-v7a Amalgamated" - language: android - android: *androidComponents - env: - - CMAKE_FLAGS="-DCMAKE_SYSTEM_NAME=Android -DBGFX_BUILD_TOOLS=OFF -DBGFX_BUILD_EXAMPLES=OFF -DCMAKE_ANDROID_NDK=$TRAVIS_BUILD_DIR/android-ndk-r18b -DCMAKE_ANDROID_ARCH_ABI=armeabi-v7a -DCMAKE_ANDROID_NDK_TOOLCHAIN_VERSION=clang -DCMAKE_ANDROID_STL_TYPE=c++_shared -DCMAKE_ANDROID_API=26" - - AMALGAMATED=ON - install: *androidInstall - - - name: "Android x86" - language: android - android: *androidComponents - env: - - CMAKE_FLAGS="-DCMAKE_SYSTEM_NAME=Android -DBGFX_BUILD_TOOLS=OFF -DBGFX_BUILD_EXAMPLES=OFF -DCMAKE_ANDROID_NDK=$TRAVIS_BUILD_DIR/android-ndk-r18b -DCMAKE_ANDROID_ARCH_ABI=x86 -DCMAKE_ANDROID_NDK_TOOLCHAIN_VERSION=clang -DCMAKE_ANDROID_STL_TYPE=c++_shared -DCMAKE_ANDROID_API=26" - - AMALGAMATED=OFF - install: *androidInstall - - - name: "Android x86 Amalgamated" - language: android - android: *androidComponents - env: - - CMAKE_FLAGS="-DCMAKE_SYSTEM_NAME=Android -DBGFX_BUILD_TOOLS=OFF -DBGFX_BUILD_EXAMPLES=OFF -DCMAKE_ANDROID_NDK=$TRAVIS_BUILD_DIR/android-ndk-r18b -DCMAKE_ANDROID_ARCH_ABI=x86 -DCMAKE_ANDROID_NDK_TOOLCHAIN_VERSION=clang -DCMAKE_ANDROID_STL_TYPE=c++_shared -DCMAKE_ANDROID_API=26" - - AMALGAMATED=ON - install: *androidInstall - -script: - - mkdir build && cd build - - cmake $CMAKE_FLAGS -DBGFX_INSTALL_EXAMPLES=ON -DBGFX_AMALGAMATED=$AMALGAMATED -DBX_AMALGAMATED=$AMALGAMATED .. - - cmake --build .