Skip to content

Commit ca4c63b

Browse files
committed
Add GitHub workflow for CI
Signed-off-by: Jacob Perron <jacobmperron@gmail.com>
1 parent 449ed4b commit ca4c63b

1 file changed

Lines changed: 41 additions & 0 deletions

File tree

.github/workflows/ci.yaml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Build and test
2+
on:
3+
# Run for any commit in origin repository
4+
push:
5+
# And pull requests from forks
6+
pull_request:
7+
branches:
8+
# This avoids running the job twice for PRs from origin repository
9+
- '**:**'
10+
11+
env:
12+
BUILD_TYPE: Release
13+
14+
jobs:
15+
build:
16+
runs-on: ${{ matrix.os }}
17+
strategy:
18+
matrix:
19+
os: [ubuntu-18.04, ubuntu-20.04]
20+
21+
steps:
22+
- name: Install dependencies
23+
run: |
24+
sudo apt install build-essential cmake git libboost-system-dev libboost-thread-dev
25+
git clone https://github.com/google/googletest.git
26+
cd googletest
27+
cmake CMakeLists.txt
28+
make
29+
sudo make install
30+
31+
- uses: actions/checkout@v2
32+
33+
- name: Configure CMake
34+
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_CXX_FLAGS="-Werror"
35+
36+
- name: Build
37+
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
38+
39+
- name: Test
40+
working-directory: ${{github.workspace}}/build
41+
run: ctest -C ${{env.BUILD_TYPE}}

0 commit comments

Comments
 (0)