diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 000000000..6e451c784 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,78 @@ +name: CMake + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +env: + # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) + BUILD_TYPE: Release + +jobs: + build-ubuntu: + name: ubuntu + + # The CMake configure and build commands are platform agnostic and should work equally well on Windows or Mac. + # You can convert this to a matrix build if you need cross-platform coverage. + # See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: Install dependencies + run: | + sudo apt update + sudo apt install libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev libxext-dev + + - name: Configure CMake + # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make. + # See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type + run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} + + - name: Build + # Build your program with the given configuration + run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} + + - name: Test + working-directory: ${{github.workspace}}/build + # Execute tests defined by the CMake configuration. + # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail + run: ./bin/unit_test + + build-macos: + name: macos + runs-on: macos-latest + + steps: + - uses: actions/checkout@v2 + + - name: Configure CMake + run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} + + - name: Build + run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} + + - name: Test + working-directory: ${{github.workspace}}/build + run: ./bin/unit_test + + build-windows: + name: windows + runs-on: windows-latest + + steps: + - uses: actions/checkout@v2 + + - name: Configure CMake + run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} + + - name: Build + run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} + + - name: Test + working-directory: ${{github.workspace}}/build + run: ./bin/${{env.BUILD_TYPE}}/unit_test + \ No newline at end of file diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 6c67aecdd..000000000 --- a/.travis.yml +++ /dev/null @@ -1,32 +0,0 @@ -language: cpp - -dist: bionic - -# This is clang on macOS -compiler: gcc - -branches: - only: - - master - -addons: - apt: - packages: - - libxrandr-dev - - libxinerama-dev - - libxcursor-dev - - libxi-dev - -jobs: - include: - - os: linux - env: - - os: osx - env: - -script: - - mkdir build - - cd build - - cmake .. - - cmake --build . - - ./bin/unit_test diff --git a/README.md b/README.md index e01656322..9cf3bc129 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ ![Box2D Logo](https://box2d.org/images/logo.svg) # Build Status -[![Build Status](https://travis-ci.org/erincatto/box2d.svg?branch=master)](https://travis-ci.org/erincatto/box2d) +[![Build Status](https://github.com/erincatto/box2d/actions/workflows/build.yml/badge.svg)](https://github.com/erincatto/box2d/actions) # Box2D