From 40759ab1a314dd5192d4527ab8f5943a46211972 Mon Sep 17 00:00:00 2001 From: Nicholas Sharp Date: Tue, 6 Feb 2024 18:12:27 -0800 Subject: [PATCH] move CI to github actions (#42) * move to github CI * bump test version to C++14 for googletest * update badge for github actions --- .github/workflows/linux.yml | 28 +++++++++++++++++++++++ .github/workflows/macOS.yml | 25 +++++++++++++++++++++ .github/workflows/windows.yml | 25 +++++++++++++++++++++ .travis.yml | 42 ----------------------------------- README.md | 5 ++++- test/CMakeLists.txt | 4 ++-- 6 files changed, 84 insertions(+), 45 deletions(-) create mode 100644 .github/workflows/linux.yml create mode 100644 .github/workflows/macOS.yml create mode 100644 .github/workflows/windows.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml new file mode 100644 index 0000000..2da36ad --- /dev/null +++ b/.github/workflows/linux.yml @@ -0,0 +1,28 @@ +name: linux + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + build: + strategy: + matrix: + os: [ubuntu-latest] + runs-on: ${{ matrix.os }} + if: "! contains(toJSON(github.event.commits.*.message), '[ci skip]')" + steps: + - uses: actions/checkout@v1 + with: + submodules: true + + - name: configure + run: cd test && mkdir build && cd build && cmake -DCMAKE_BUILD_TYPE=Debug .. + + - name: build + run: cd test/build && make + + - name: run test + run: cd test/build && ./bin/ply-test diff --git a/.github/workflows/macOS.yml b/.github/workflows/macOS.yml new file mode 100644 index 0000000..c288eb8 --- /dev/null +++ b/.github/workflows/macOS.yml @@ -0,0 +1,25 @@ +name: macOS + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + build: + runs-on: macos-latest + if: "! contains(toJSON(github.event.commits.*.message), '[ci skip]')" + steps: + - uses: actions/checkout@v1 + with: + submodules: true + + - name: configure + run: cd test && mkdir build && cd build && cmake -DCMAKE_BUILD_TYPE=Debug .. + + - name: build + run: cd test/build && make + + - name: run test + run: cd test/build && ./bin/ply-test diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml new file mode 100644 index 0000000..67dd3c7 --- /dev/null +++ b/.github/workflows/windows.yml @@ -0,0 +1,25 @@ +name: windows + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + build: + runs-on: windows-latest + if: "! contains(toJSON(github.event.commits.*.message), '[ci skip]')" + steps: + - uses: actions/checkout@v1 + with: + submodules: true + + - name: configure + run: cd test && mkdir build && cd build && cmake -DCMAKE_BUILD_TYPE=Debug .. + + - name: build + run: cd test/build && cmake --build "." + + - name: run test + run: cd test/build && ./bin/Debug/ply-test.exe diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 4035b14..0000000 --- a/.travis.yml +++ /dev/null @@ -1,42 +0,0 @@ -branches: - only: - - master - -language: cpp - -os: - - linux - - osx - -compiler: - - gcc - - clang - -jobs: - # do this here rather than in matrix since we don't need multiple compilers - include: - - os: windows - -before_script: - - cd test - - mkdir build - - cd build - - cmake -DCMAKE_BUILD_TYPE=Debug .. - -script: - - | - if [ "$TRAVIS_OS_NAME" = "linux" ]; then - make - ./bin/ply-test - fi - - | - if [ "$TRAVIS_OS_NAME" = "osx" ]; then - make - ./bin/ply-test - fi - - | - if [ "$TRAVIS_OS_NAME" = "windows" ]; then - cmake --build "." - ls - ./bin/Debug/ply-test.exe - fi diff --git a/README.md b/README.md index 62a8a02..b7196da 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,8 @@ # hapPLY -![](https://travis-ci.com/nmwsharp/happly.svg?branch=master) + +[![actions status linux](https://github.com/nmwsharp/happly/workflows/linux/badge.svg)](https://github.com/nmwsharp/happly/actions) +[![actions status macOS](https://github.com/nmwsharp/happly/workflows/macOS/badge.svg)](https://github.com/nmwsharp/happly/actions) +[![actions status windows](https://github.com/nmwsharp/happly/workflows/windows/badge.svg)](https://github.com/nmwsharp/happly/actions)

diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index b07caf5..518f304 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -14,7 +14,7 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") # using Clang (linux or apple) or GCC message("Using clang/gcc compiler flags") - SET(BASE_CXX_FLAGS "-std=c++11 -Wall -Wextra -Werror -g3") + SET(BASE_CXX_FLAGS "-std=c++14 -Wall -Wextra -Werror -g3") SET(DISABLED_WARNINGS " -Wno-unused-parameter -Wno-unused-variable -Wno-unused-private-field -Wno-unused-function -Wno-deprecated-declarations") SET(TRACE_INCLUDES " -H -Wno-error=unused-command-line-argument") @@ -75,7 +75,7 @@ add_subdirectory(${CMAKE_CURRENT_BINARY_DIR}/googletest-src ${CMAKE_CURRENT_BINARY_DIR}/googletest-build EXCLUDE_FROM_ALL) -set_property(TARGET gtest PROPERTY CXX_STANDARD 11) +set_property(TARGET gtest PROPERTY CXX_STANDARD 14) # Test executable