From ca4c63b5a88ab4cc24ce212727613dc47af3904d Mon Sep 17 00:00:00 2001 From: Jacob Perron Date: Wed, 5 May 2021 21:10:18 -0700 Subject: [PATCH] Add GitHub workflow for CI Signed-off-by: Jacob Perron --- .github/workflows/ci.yaml | 41 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 .github/workflows/ci.yaml diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 0000000..6653702 --- /dev/null +++ b/.github/workflows/ci.yaml @@ -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}}