Update docker and automatic formatting for vscode #162
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 | |
on: | |
pull_request: | |
push: | |
branches: | |
- master | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
include: | |
- build_type: Debug | |
- build_type: Release | |
env: | |
EXTERNAL_ROOT: /home/runner/3party | |
BUILD_TYPE: ${{ matrix.build_type }} | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- name: Install latest Boost | |
shell: bash | |
run: | | |
sudo apt-add-repository ppa:mhier/libboost-latest | |
sudo apt install libboost1.74-dev | |
- name: Install libfmt | |
shell: bash | |
run: | | |
sudo apt install libfmt-dev | |
- name: Install dependencies from source | |
run: .ci/fetch_system_dependencies.sh | |
- name: Create Build Environment | |
run: cmake -E make_directory ${{runner.workspace}}/terminalpp/build | |
- name: Configure CMake | |
shell: bash | |
working-directory: ${{runner.workspace}}/terminalpp/build | |
run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCMAKE_PREFIX_PATH=$EXTERNAL_ROOT | |
- name: Build | |
shell: bash | |
working-directory: ${{runner.workspace}}/terminalpp/build | |
run: cmake --build . --config $BUILD_TYPE | |
- name: Test | |
working-directory: ${{runner.workspace}}/terminalpp/build | |
shell: bash | |
run: ctest -C $BUILD_TYPE | |
build-coverage: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
include: | |
- build_type: Debug | |
env: | |
EXTERNAL_ROOT: /home/runner/3party | |
BUILD_TYPE: ${{ matrix.build_type }} | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- name: Install latest Boost | |
shell: bash | |
run: | | |
sudo apt-add-repository ppa:mhier/libboost-latest | |
sudo apt install libboost1.74-dev | |
- name: Install libfmt | |
shell: bash | |
run: | | |
sudo apt install libfmt-dev | |
- name: Extract branch name | |
shell: bash | |
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})" | |
id: extract_branch | |
# Build a cache for LCOV. | |
- name: Cache lcov | |
uses: actions/cache@v2 | |
with: | |
path: ~/.lcov | |
key: lcov-cache-${{ steps.extract_branch.outputs.branch }} | |
restore-keys: | | |
lcov-cache-master | |
- name: Install LCOV | |
shell: bash | |
run: | | |
if [ ! -f "$HOME/.lcov/usr/local/bin/lcov" ]; then | |
mkdir $HOME/.lcov-build || true; | |
cd $HOME/.lcov-build; | |
wget https://github.com/linux-test-project/lcov/releases/download/v1.16/lcov-1.16.tar.gz | |
tar -xzf lcov-1.16.tar.gz; | |
mkdir -p $HOME/.lcov || true; | |
DESTDIR=$HOME/.lcov make -C lcov-1.16/ install; | |
fi | |
echo "##[set-output name=bin;]$(echo $HOME/.lcov/usr/local/bin/lcov)" | |
id: lcov | |
- name: Install dependencies from source | |
run: .ci/fetch_system_dependencies.sh | |
- name: Create Build Environment | |
run: cmake -E make_directory ${{runner.workspace}}/terminalpp/build | |
- name: Configure CMake | |
shell: bash | |
working-directory: ${{runner.workspace}}/terminalpp/build | |
run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCMAKE_PREFIX_PATH=$EXTERNAL_ROOT -DTERMINALPP_COVERAGE=True | |
- name: Build | |
shell: bash | |
working-directory: ${{runner.workspace}}/terminalpp/build | |
run: cmake --build . --config $BUILD_TYPE | |
- name: Zero test counters | |
shell: bash | |
run: ${{ steps.lcov.outputs.bin }} --gcov-tool=gcov-11 --base-directory ${{runner.workspace}}/terminalpp/build --directory ${{runner.workspace}}/terminalpp/build --zerocounters -q | |
- name: Test | |
working-directory: ${{runner.workspace}}/terminalpp/build | |
shell: bash | |
run: ctest -C $BUILD_TYPE | |
- name: Calculate coverage | |
shell: bash | |
run: | | |
${{ steps.lcov.outputs.bin }} --gcov-tool=gcov-11 --base-directory ${{runner.workspace}}/terminalpp/build --directory ${{runner.workspace}}/terminalpp/build --capture --output-file coverage.info; | |
${{ steps.lcov.outputs.bin }} --gcov-tool=gcov-11 --remove coverage.info '*/test/*' '/usr/*' '*/3party/*' --output-file coverage.info; | |
${{ steps.lcov.outputs.bin }} --gcov-tool=gcov-11 --list coverage.info; | |
- name: Post coverage to Coveralls | |
uses: coverallsapp/github-action@master | |
with: | |
path-to-lcov: coverage.info | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Post coverage to Codacy | |
uses: codacy/codacy-coverage-reporter-action@v1 | |
with: | |
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }} | |
coverage-reports: coverage.info | |
build-docs: | |
runs-on: ubuntu-latest | |
# Only build documentation for valid builds on master. | |
needs: [build] | |
if: github.ref == 'refs/heads/master' | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- name: Install Doxygen | |
shell: bash | |
run: sudo apt install doxygen | |
- name: Create Build Environment | |
run: cmake -E make_directory ${{runner.workspace}}/terminalpp/build | |
- name: Configure CMake | |
shell: bash | |
working-directory: ${{runner.workspace}}/terminalpp/build | |
run: cmake $GITHUB_WORKSPACE -DTERMINALPP_DOC_ONLY=True | |
- name: Build | |
working-directory: ${{runner.workspace}}/terminalpp/build | |
shell: bash | |
run: cmake --build . --target terminalpp_doc | |
- uses: peaceiris/actions-gh-pages@v3 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ${{runner.workspace}}/terminalpp/build/html |