Switch to GitHub Actions

This commit is contained in:
Duncan Ogilvie 2022-01-10 22:08:42 +01:00
parent c658914c53
commit 03a63bd43a
6 changed files with 49 additions and 47 deletions

42
.github/workflows/build.yml vendored Normal file
View file

@ -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

2
.gitignore vendored
View file

@ -379,3 +379,5 @@ build/
## Intel VTune
VTune Results/
cmake-build-*/
.idea/

View file

@ -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

View file

@ -30,4 +30,6 @@ add_subdirectory(VTIL)
# Tests
if(VTIL_BUILD_TESTS)
add_subdirectory(VTIL-Tests)
enable_testing()
add_test(NAME VTIL-Tests COMMAND "$<TARGET_FILE:VTIL-Tests>")
endif()

View file

@ -7,14 +7,11 @@
<h1 align="center">VTIL</h1>
<p align="center">
<a href="https://travis-ci.com/vtil-project/VTIL-Core">
<img src="https://img.shields.io/travis/com/vtil-project/vtil-core/master.svg?logo=travis&style=flat-square" alt="travis-ci"/>
</a>
<a href="https://ci.appveyor.com/project/can1357/vtil-core">
<img src="https://img.shields.io/appveyor/build/can1357/VTIL-Core?logo=appveyor&style=flat-square" alt="appveyor-ci"/>
<a href="https://github.com/vtil-project/VTIL-Core/actions/workflows/build.yml">
<img alt="github-actions" src="https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fvtil-project%2FVTIL-Core%2Fbadge&style=flat-square"/>
</a>
<a href="https://github.com/vtil-project/vtil-core/blob/master/LICENSE.md">
<img src="https://img.shields.io/github/license/vtil-project/vtil-core.svg?style=flat-square" alt="license"/>
<img alt="license" src="https://img.shields.io/github/license/vtil-project/vtil-core.svg?style=flat-square"/>
</a>
<a href="https://discord.gg/VdMdkze">
<img alt="discord" src="https://img.shields.io/discord/724300992023232533?label=chat&logo=Discord&style=flat-square">

View file

@ -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