Skip to content

Run lua_plugin example with two lua plugins #35

Run lua_plugin example with two lua plugins

Run lua_plugin example with two lua plugins #35

Workflow file for this run

name: "C++ Unittests"
on:
# always run on main branch
push:
branches: [ main ]
paths-ignore:
- 'README.md'
- 'CONTRIBUTING.md'
- 'LICENSE'
# run on PR to main branch if relevant files changed
pull_request:
branches: [ main ]
paths:
- 'src/**'
- 'include/**'
- 'test/**'
- 'CMakeLists.txt'
- '.github/workflows/cpp-unittest.yml'
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
unittest:
name: "unittests"
runs-on: ubuntu-latest
strategy:
matrix:
cpp17_compatibility: [ "ON", "OFF" ]
steps:
- uses: actions/checkout@v3
- uses: jirutka/setup-alpine@v1
with:
branch: edge
extra-repositories: |
http://dl-cdn.alpinelinux.org/alpine/edge/testing
- name: Install dependencies
run: |
apk update
apk add \
cmake \
ninja-build \
g++ \
boost-dev \
boost-filesystem \
boost-python3 \
lua5.2-dev \
python3-dev \
fmt-dev \
gtest-dev \
lcov gzip
shell: alpine.sh --root {0}
- name: Fixup environment
run: |
ln -s liblua-5.2.so.0 /usr/lib/liblua-5.2.so
ln -s /usr/lib/ninja-build/bin/ninja /usr/bin/ninja
shell: alpine.sh --root {0}
- name: Prepare
run: |
cmake . -B build -G Ninja \
-DCMAKE_BUILD_TYPE=Debug \
-DPPPLUGIN_ENABLE_TESTS=ON \
-DPPPLUGIN_ENABLE_COVERAGE=ON \
-DPPPLUGIN_ENABLE_CPP17_COMPATIBILITY=${{ matrix.cpp17_compatibility }}
shell: alpine.sh {0}
- name: Build
run: |
cmake --build build -j
shell: alpine.sh {0}
- name: Execute tests
run: |
lcov --capture --initial \
--directory . \
--ignore-errors mismatch \
--output-file baseline_coverage
build/test/tests || echo $?
lcov --capture \
--directory . \
--ignore-errors mismatch \
--output-file total_coverage
lcov \
--add-tracefile baseline_coverage \
--add-tracefile total_coverage \
--ignore-errors mismatch \
--output-file measured_coverage
lcov --remove measured_coverage "/usr*" \
--ignore-errors mismatch \
--output-file coverage_without_system_files
lcov --remove coverage_without_system_files "*/test/*" \
--ignore-errors mismatch \
--output-file coverage_without_system_and_test_files
genhtml \
--output-directory coverage \
--legend coverage_without_system_and_test_files
lcov --list coverage_without_system_and_test_files
shell: alpine.sh {0}