From 03a63bd43ad0c6d7654470964cb909cbb333dcad Mon Sep 17 00:00:00 2001 From: Duncan Ogilvie Date: Mon, 10 Jan 2022 22:08:42 +0100 Subject: [PATCH] Switch to GitHub Actions --- .github/workflows/build.yml | 42 +++++++++++++++++++++++++++++++++++++ .gitignore | 2 ++ .travis.yml | 33 ----------------------------- CMakeLists.txt | 2 ++ README.md | 9 +++----- appveyor.yml | 8 ------- 6 files changed, 49 insertions(+), 47 deletions(-) create mode 100644 .github/workflows/build.yml delete mode 100644 .travis.yml delete mode 100644 appveyor.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..9d74cc0 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,42 @@ +name: CMake + +on: [push, pull_request] + +jobs: + build: + # Skip building pull requests from the same repository + if: ${{ github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository) }} + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [windows-2019, ubuntu-20.04, macos-11] + env: + BUILD_TYPE: Release + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Install ninja-build tool + uses: seanmiddleditch/gha-setup-ninja@v3 + + - name: Enable Developer Command Prompt + if: ${{ runner.os == 'Windows' }} + uses: ilammy/msvc-dev-cmd@v1.7.0 + + - name: Set up GCC + if: ${{ runner.os == 'Linux' }} + uses: egor-tensin/setup-gcc@v1 + with: + version: 11 + + - name: Build + run: | + cmake -B build -G Ninja -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} -DVTIL_BUILD_TESTS=ON + cmake --build build --config ${{ env.BUILD_TYPE }} --parallel + + - name: Test + run: | + ctest --version + cd build + ctest . -C ${{ env.BUILD_TYPE }} --verbose diff --git a/.gitignore b/.gitignore index 6408703..47ed8a1 100644 --- a/.gitignore +++ b/.gitignore @@ -379,3 +379,5 @@ build/ ## Intel VTune VTune Results/ +cmake-build-*/ +.idea/ diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 3a3b2e8..0000000 --- a/.travis.yml +++ /dev/null @@ -1,33 +0,0 @@ -language: cpp - -os: linux -dist: bionic - -addons: - apt: - sources: - - sourceline: 'deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic-10 main' - key_url: 'https://apt.llvm.org/llvm-snapshot.gpg.key' - - sourceline: 'deb https://apt.kitware.com/ubuntu/ xenial main' - key_url: 'https://apt.kitware.com/keys/kitware-archive-latest.asc' - update: true - packages: - - clang++-10 - - clang-10 - - libc++-10-dev - - libc++abi-10-dev - - cmake - - cmake-data - - ninja-build - -script: - # Fix issue caused by previous cmake version. - - alias cmake='/usr/bin/cmake' - - /usr/bin/cmake --version - - # Build and run tests. - - mkdir build - - cd build - - /usr/bin/cmake -G Ninja -DCMAKE_C_COMPILER=clang-10 -DCMAKE_CXX_COMPILER=clang++-10 -DCMAKE_CXX_FLAGS="-stdlib=libc++" -DVTIL_BUILD_TESTS=ON .. - - ninja -j8 - - ./VTIL-Tests/VTIL-Tests diff --git a/CMakeLists.txt b/CMakeLists.txt index 1fe58ef..106f388 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -30,4 +30,6 @@ add_subdirectory(VTIL) # Tests if(VTIL_BUILD_TESTS) add_subdirectory(VTIL-Tests) + enable_testing() + add_test(NAME VTIL-Tests COMMAND "$") endif() diff --git a/README.md b/README.md index e4c8589..888e76a 100644 --- a/README.md +++ b/README.md @@ -7,14 +7,11 @@

VTIL

- - travis-ci - - - appveyor-ci + + github-actions - license + license discord diff --git a/appveyor.yml b/appveyor.yml deleted file mode 100644 index 8126d34..0000000 --- a/appveyor.yml +++ /dev/null @@ -1,8 +0,0 @@ -version: 1.0.{build} -image: Visual Studio 2019 -build_script: -- cmd: mkdir build && cd build -- cmd: cmake -DVTIL_BUILD_TESTS=ON .. -- cmd: cmake --build . --config Release -test_script: -- cmd: VTIL-Tests\Release\VTIL-Tests.exe \ No newline at end of file