Move from Travis CI to GitHub actions #1
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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' |