Skip to content

Move from Travis CI to GitHub actions #1

Move from Travis CI to GitHub actions

Move from Travis CI to GitHub actions #1

name: Build and test with CMake on Linux
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
env:
BUILD_TYPE: Debug
jobs:
setup:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install prerequisites
run: pip install --user cpp-coveralls
build:
needs: setup
runs-on: ubuntu-latest
steps:
- name: Configure CMake
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCOVERALLS=ON
- name: Build
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
test:
needs: build
runs-on: ubuntu-latest
steps:
- name: Test
working-directory: ${{github.workspace}}/build
run: ctest -C ${{env.BUILD_TYPE}}
- name: Install
run: cmake --install ${{github.workspace}}/build
coverage:
needs: test
runs-on: ubuntu-latest
steps:
- name: Coveralls
run: |
coveralls \
--root ${{github.workspace}}/build \
--build-root ${{github.workspace}}/build \
--exclude build/abseil-cpp \
--exclude build/generated \
--exclude build/CMakeFiles \
--exclude abseil-cpp \
--exclude external_includes \
--exclude test \
--exclude-pattern '.*_test\.cc$' \
--exclude-lines-pattern '.*_test\.cc$' \
--gcov-options '\-lp'