diff --git a/.github/workflows/cmake-lint.yml b/.github/workflows/cmake-lint.yml index 22b96df..714b438 100644 --- a/.github/workflows/cmake-lint.yml +++ b/.github/workflows/cmake-lint.yml @@ -8,13 +8,13 @@ on: jobs: lint: name: "cmake lint" - runs-on: ubuntu-22.04 + runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - name: Install dependencies run: | - sudo apt-get update -y - sudo apt-get -y --no-install-recommends install \ + sudo apt update -y + sudo apt -y --no-install-recommends install \ python3-pip='22.*' pip install cmakelint - name: Execute cmakelint diff --git a/.github/workflows/cpp-build.yml b/.github/workflows/cpp-build.yml index 7b57e61..e2550a7 100644 --- a/.github/workflows/cpp-build.yml +++ b/.github/workflows/cpp-build.yml @@ -8,40 +8,48 @@ on: jobs: build: name: "gcc/clang build" - runs-on: ubuntu-22.04 + runs-on: ubuntu-latest strategy: matrix: cpp17_compatibility: [ "ON", "OFF" ] cpp_compiler: [ "g++", "clang++" ] steps: - uses: actions/checkout@v3 + - uses: jirutka/setup-alpine@v1 + with: + branch: v3.19 - name: Install dependencies run: | - sudo apt-get update -y - sudo apt-get -y --no-install-recommends install \ - cmake='3.22.*' \ - gcc-11='11.*' \ - clang='1:14.*' \ - libboost-filesystem-dev='1.74.*' \ - libboost-python-dev='1.74.*' \ - liblua5.4-dev='5.*' \ - libfmt-dev='8.*' \ - libgmock-dev='1.11.*' \ - libgtest-dev='1.11.*' - - name: Execute cmake + apk update + apk add \ + cmake \ + ninja-build \ + g++ \ + boost-dev \ + boost-filesystem \ + boost-python3 \ + lua-dev \ + lua5.2-dev \ + python3-dev \ + fmt-dev \ + gtest-dev + shell: alpine.sh --root {0} + - name: Prepare run: | CXX=/usr/bin/${{ matrix.cpp_compiler }} \ - cmake . -B build \ + cmake . -B build -G Ninja \ + -DCMAKE_MAKE_PROGRAM=/usr/lib/ninja-build/bin/ninja \ -DCMAKE_BUILD_TYPE=Debug \ -DPPPLUGIN_SHARED=ON \ -DPPPLUGIN_ENABLE_EXAMPLES=ON \ -DPPPLUGIN_ENABLE_TESTS=ON \ -DPPPLUGIN_ENABLE_CPP17_COMPATIBILITY=${{ matrix.cpp17_compatibility }} - - name: Execute make + shell: alpine.sh {0} + - name: Build run: | - cd build - make -j + cmake --build build -j + shell: alpine.sh {0} - name: Install run: | - cd build - make install + cmake --install build + shell: alpine.sh {0} diff --git a/.github/workflows/cpp-lint.yml b/.github/workflows/cpp-lint.yml index 5fb3de7..3776f20 100644 --- a/.github/workflows/cpp-lint.yml +++ b/.github/workflows/cpp-lint.yml @@ -8,27 +8,37 @@ on: jobs: lint: name: "clang-tidy" - runs-on: ubuntu-22.04 + runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 + - uses: jirutka/setup-alpine@v1 + with: + branch: v3.19 - name: Install dependencies run: | - sudo apt-get update -y - sudo apt-get -y --no-install-recommends install \ - cmake='3.22.*' \ - gcc-11='11.*' \ - clang-tidy='1:14.*' \ - libboost-filesystem-dev='1.74.*' \ - libboost-python-dev='1.74.*' \ - liblua5.4-dev='5.*' \ - libfmt-dev='8.*' \ - libgmock-dev='1.11.*' \ - libgtest-dev='1.11.*' + apk update + apk add \ + cmake \ + ninja-build \ + g++ \ + boost-dev \ + boost-filesystem \ + boost-python3 \ + lua-dev \ + lua5.2-dev \ + python3-dev \ + fmt-dev \ + gtest-dev \ + clang-extra-tools + shell: alpine.sh --root {0} - name: Generate compile_commands.json run: | - mkdir -pv build - cd build - cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=ON .. + cmake . -B build -G Ninja \ + -DCMAKE_MAKE_PROGRAM=/usr/lib/ninja-build/bin/ninja \ + -DPPPLUGIN_ENABLE_EXAMPLES=ON \ + -DPPPLUGIN_ENABLE_TESTS=ON \ + -DCMAKE_EXPORT_COMPILE_COMMANDS=ON + shell: alpine.sh {0} # Check all source and header C++ files; # ignore files in the build directory or in hidden directories - name: Execute clang-tidy @@ -36,3 +46,4 @@ jobs: \( -type f -a \( -iname '*.cpp' -o -iname '*.h' \) \) -exec echo "Linting '{}'..." \; -exec clang-tidy -p build --warnings-as-errors='*' {} + + shell: alpine.sh {0} diff --git a/.github/workflows/cpp-unittest.yml b/.github/workflows/cpp-unittest.yml index bf046e7..6c1e9ee 100644 --- a/.github/workflows/cpp-unittest.yml +++ b/.github/workflows/cpp-unittest.yml @@ -8,45 +8,56 @@ on: jobs: unittest: name: "unittests" - runs-on: ubuntu-22.04 + 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: | - sudo apt-get update -y - sudo apt-get -y --no-install-recommends install \ - cmake='3.22.*' \ - gcc-11='11.*' \ - clang='1:14.*' \ - libboost-filesystem-dev='1.74.*' \ - libboost-python-dev='1.74.*' \ - liblua5.4-dev='5.*' \ - libfmt-dev='8.*' \ - libgmock-dev='1.11.*' \ - libgtest-dev='1.11.*' - - name: Execute cmake + apk update + apk add \ + cmake \ + ninja-build \ + g++ \ + boost-dev \ + boost-filesystem \ + boost-python3 \ + lua-dev \ + lua5.2-dev \ + python3-dev \ + fmt-dev \ + gtest-dev \ + lcov + shell: alpine.sh --root {0} + - name: Prepare run: | CXX=/usr/bin/${{ matrix.cpp_compiler }} \ - cmake . -B build \ + cmake . -B build -G Ninja \ + -DCMAKE_MAKE_PROGRAM=/usr/lib/ninja-build/bin/ninja \ -DCMAKE_BUILD_TYPE=Debug \ -DPPPLUGIN_ENABLE_TESTS=ON \ -DPPPLUGIN_ENABLE_COVERAGE=ON \ -DPPPLUGIN_ENABLE_CPP17_COMPATIBILITY=${{ matrix.cpp17_compatibility }} - - name: Execute make + shell: alpine.sh {0} + - name: Build run: | - cd build - make -j + cmake --build build -j + shell: alpine.sh {0} - name: Execute tests run: | - cd build lcov -c -i -d . -o baseline_coverage - test/tests || echo $? + 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} diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml index 9a7969e..c3a0ba7 100644 --- a/.github/workflows/format.yml +++ b/.github/workflows/format.yml @@ -8,24 +8,31 @@ on: jobs: format: name: "clang-format/cmake-format" - runs-on: ubuntu-22.04 + runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 + - uses: jirutka/setup-alpine@v1 + with: + branch: v3.19 - name: Install dependencies run: | - sudo apt-get update -y - sudo apt-get -y --no-install-recommends install \ - clang-format='1:14.*' \ - cmake-format='0.6.*' + apk update + apk add \ + clang-extra-tools \ + py3-pip + pip install --break-system-packages cmake-format + shell: alpine.sh --root {0} # Check all source and header C++ files; ignore files in hidden directories - name: Execute clang-format run: find . \( -path '*/.*' -prune \) -o \( -type f -a \( -iname '*.cpp' -o -iname '*.h' \) \) -exec echo "Format checking '{}'..." \; -exec clang-format --dry-run --Werror --Wno-error=unknown {} + + shell: alpine.sh {0} # Check all cmake files; ignore files in hidden directories - name: Execute cmake-format run: find . \( -path '*/.*' -prune \) -o \( -type f -a -name 'CMakeLists.txt' \) -exec echo "Format checking '{}'..." \; -exec cmake-format --check -- {} + + shell: alpine.sh {0}