Add GitHub workflow for CI
Signed-off-by: Jacob Perron <jacobmperron@gmail.com>
This commit is contained in:
parent
449ed4b093
commit
ca4c63b5a8
1 changed files with 41 additions and 0 deletions
41
.github/workflows/ci.yaml
vendored
Normal file
41
.github/workflows/ci.yaml
vendored
Normal file
|
@ -0,0 +1,41 @@
|
|||
name: Build and test
|
||||
on:
|
||||
# Run for any commit in origin repository
|
||||
push:
|
||||
# And pull requests from forks
|
||||
pull_request:
|
||||
branches:
|
||||
# This avoids running the job twice for PRs from origin repository
|
||||
- '**:**'
|
||||
|
||||
env:
|
||||
BUILD_TYPE: Release
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ubuntu-18.04, ubuntu-20.04]
|
||||
|
||||
steps:
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
sudo apt install build-essential cmake git libboost-system-dev libboost-thread-dev
|
||||
git clone https://github.com/google/googletest.git
|
||||
cd googletest
|
||||
cmake CMakeLists.txt
|
||||
make
|
||||
sudo make install
|
||||
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: Configure CMake
|
||||
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_CXX_FLAGS="-Werror"
|
||||
|
||||
- name: Build
|
||||
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
|
||||
|
||||
- name: Test
|
||||
working-directory: ${{github.workspace}}/build
|
||||
run: ctest -C ${{env.BUILD_TYPE}}
|
Loading…
Add table
Add a link
Reference in a new issue