From 11729ca941e978449e503b4132afca87cba80737 Mon Sep 17 00:00:00 2001 From: Erin Catto Date: Wed, 29 Dec 2021 13:50:44 -0800 Subject: [PATCH 1/3] Create cmake.yml (#707) Switch from travis to Github Actions for CI and testing --- .github/workflows/build.yml | 42 +++++++++++++++++++++++++++++++++++++ .travis.yml | 32 ---------------------------- README.md | 2 +- 3 files changed, 43 insertions(+), 33 deletions(-) create mode 100644 .github/workflows/build.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 000000000..3b64c34a9 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,42 @@ +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: + # 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 + 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..bae3c7292 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.xml/badge.svg) # Box2D From 0e45a814ef961b5318c8cc0592576172b3827e1b Mon Sep 17 00:00:00 2001 From: Erin Catto Date: Wed, 29 Dec 2021 13:56:25 -0800 Subject: [PATCH 2/3] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index bae3c7292..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://github.com/erincatto/box2d/actions/workflows/build.xml/badge.svg) +[![Build Status](https://github.com/erincatto/box2d/actions/workflows/build.yml/badge.svg)](https://github.com/erincatto/box2d/actions) # Box2D From c6cc3646d1701ab3c0750ef397d2d68fc6dbcff2 Mon Sep 17 00:00:00 2001 From: Erin Catto Date: Wed, 29 Dec 2021 23:33:24 -0800 Subject: [PATCH 3/3] Added macos and windows build to CI (#708) --- .github/workflows/build.yml | 38 ++++++++++++++++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3b64c34a9..6e451c784 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -11,7 +11,9 @@ env: BUILD_TYPE: Release jobs: - build: + 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 @@ -40,3 +42,37 @@ jobs: # 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