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