refs #14579 / refs #10543 - fixed compilation on Alpine Linux / added… #339
This file contains hidden or 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
| # Syntax reference https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions | |
| # Environment reference https://help.github.com/en/actions/reference/virtual-environments-for-github-hosted-runners | |
| name: CI-unixish-docker | |
| on: | |
| push: | |
| branches: | |
| - 'main' | |
| - 'releases/**' | |
| - '2.*' | |
| tags: | |
| - '2.*' | |
| pull_request: | |
| permissions: | |
| contents: read | |
| jobs: | |
| build_cmake: | |
| strategy: | |
| matrix: | |
| include: | |
| - image: "ubuntu:24.04" | |
| with_gui: true | |
| full_build: true | |
| - image: "ubuntu:25.10" | |
| with_gui: true | |
| full_build: true | |
| - image: "alpine:3.23" | |
| with_gui: false # it appears FindQt6.cmake is not provided by any package | |
| full_build: false # FIXME: test-signalhandler.cpp fails to build since feenableexcept() is missing | |
| fail-fast: false # Prefer quick result | |
| runs-on: ubuntu-22.04 | |
| # TODO: is this actually applied to the guest? | |
| env: | |
| # TODO: figure out why there are cache misses with PCH enabled | |
| CCACHE_SLOPPINESS: pch_defines,time_macros | |
| container: | |
| image: ${{ matrix.image }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| persist-credentials: false | |
| - name: Install missing software on ubuntu | |
| if: contains(matrix.image, 'ubuntu') | |
| run: | | |
| apt-get update | |
| apt-get install -y cmake g++ make libxml2-utils libpcre3-dev | |
| - name: Install missing software (gui) on latest ubuntu | |
| if: contains(matrix.image, 'ubuntu') | |
| run: | | |
| apt-get install -y qt6-base-dev qt6-charts-dev qt6-tools-dev | |
| - name: Install missing software on Alpine | |
| if: contains(matrix.image, 'alpine') | |
| run: | | |
| apk add cmake make g++ pcre-dev | |
| # needs to be called after the package installation since | |
| # - it doesn't call "apt-get update" | |
| - name: ccache | |
| uses: hendrikmuhs/ccache-action@v1.2 | |
| with: | |
| key: ${{ github.workflow }}-${{ matrix.image }} | |
| - name: Run CMake | |
| run: | | |
| cmake -S . -B cmake.output -Werror=dev -DHAVE_RULES=On -DBUILD_TESTING=On -DBUILD_GUI=${{ matrix.with_gui }} -DWITH_QCHART=On -DBUILD_TRIAGE=${{ matrix.with_gui }} -DCMAKE_COMPILE_WARNING_AS_ERROR=On -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache | |
| - name: CMake build | |
| if: matrix.full_build | |
| run: | | |
| cmake --build cmake.output -- -j$(nproc) | |
| - name: Run CMake test | |
| run: | | |
| cmake --build cmake.output --target check -- -j$(nproc) | |
| build_make: | |
| strategy: | |
| matrix: | |
| image: ["ubuntu:24.04", "ubuntu:25.10", "alpine:3.23"] | |
| fail-fast: false # Prefer quick result | |
| runs-on: ubuntu-22.04 | |
| container: | |
| image: ${{ matrix.image }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| persist-credentials: false | |
| - name: Install missing software on ubuntu | |
| if: contains(matrix.image, 'ubuntu') | |
| run: | | |
| apt-get update | |
| apt-get install -y g++ make python3 libxml2-utils libpcre3-dev | |
| - name: Install missing software on Alpine | |
| if: contains(matrix.image, 'alpine') | |
| run: | | |
| apk add make g++ pcre-dev bash python3 libxml2-utils | |
| # needs to be called after the package installation since | |
| # - it doesn't call "apt-get update" | |
| - name: ccache | |
| uses: hendrikmuhs/ccache-action@v1.2 | |
| with: | |
| key: ${{ github.workflow }}-${{ matrix.image }} | |
| # /usr/lib/ccache/bin - Alpine Linux | |
| - name: Build cppcheck | |
| run: | | |
| export PATH="/usr/lib/ccache/bin:/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH" | |
| make -j$(nproc) HAVE_RULES=yes CXXOPTS="-Werror" | |
| - name: Build test | |
| run: | | |
| export PATH="/usr/lib/ccache/bin:/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH" | |
| make -j$(nproc) HAVE_RULES=yes CXXOPTS="-Werror" testrunner | |
| - name: Run test | |
| run: | | |
| make -j$(nproc) HAVE_RULES=yes test | |
| # requires python3 | |
| - name: Run extra tests | |
| run: | | |
| test/scripts/generate_and_run_more_tests.sh | |
| # requires which | |
| - name: Validate | |
| run: | | |
| make -j$(nproc) checkCWEEntries validateXML | |
| - name: Test addons | |
| run: | | |
| ./cppcheck --addon=threadsafety addons/test/threadsafety | |
| ./cppcheck --addon=threadsafety --std=c++03 addons/test/threadsafety |