ci: Migrate to alpine base image #10
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: "C++ Unittests" | |
on: | |
push: | |
paths-ignore: | |
- 'README.md' | |
jobs: | |
unittest: | |
name: "unittests" | |
runs-on: alpine:latest | |
strategy: | |
matrix: | |
cpp17_compatibility: [ "ON", "OFF" ] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install dependencies | |
run: | | |
sudo apk update | |
sudo apk add \ | |
cmake \ | |
gcc \ | |
boost-filesystem \ | |
boost-python3 \ | |
lua-dev \ | |
fmt \ | |
gmock \ | |
gtest | |
- name: Execute cmake | |
run: | | |
CXX=/usr/bin/${{ matrix.cpp_compiler }} \ | |
cmake . -B build \ | |
-DCMAKE_BUILD_TYPE=Debug \ | |
-DPPPLUGIN_ENABLE_TESTS=ON \ | |
-DPPPLUGIN_ENABLE_COVERAGE=ON \ | |
-DPPPLUGIN_ENABLE_CPP17_COMPATIBILITY=${{ matrix.cpp17_compatibility }} | |
- name: Execute make | |
run: | | |
cd build | |
make -j | |
- name: Execute tests | |
run: | | |
cd build | |
lcov -c -i -d . -o baseline_coverage | |
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 |