Skip to content

ci: Migrate to alpine base image #17

ci: Migrate to alpine base image

ci: Migrate to alpine base image #17

Workflow file for this run

name: "C++ Unittests"
on:
push:
paths-ignore:
- 'README.md'
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
- name: Install dependencies
run: |
apk update
apk add \
cmake \
ninja-build \
gcc \
boost-filesystem \
boost-python3 \
lua-dev \
fmt \
gmock \
gtest \
lcov
shell: alpine.sh --root {0}
- name: Prepare
run: |
CXX=/usr/bin/${{ matrix.cpp_compiler }} \
CMAKE_MAKE_PROGRAM=/usr/lib/ninja-build/bin/ninja \
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 -c -i -d . -o baseline_coverage
build/test/tests || echo $?
lcov -c -d . -o total_coverage
lcov -a baseline_coverage -a total_coverage -o measured_coverage
lcov -r measured_coverage "/usr*" -o coverage_without_system_files
lcov -r coverage_without_system_files "*/test/*" -o 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}