Pin the gcovr version to help fix build issues #6427
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
| name: cesium-native | |
| on: [push, pull_request] | |
| env: | |
| VCPKG_BINARY_SOURCES: 'clear;x-aws,s3://cesium-builds/vcpkg/cesium-native-cache/,readwrite' | |
| AWS_ACCESS_KEY_ID: ${{ secrets.AWS_INTERNAL_SERVICES_VCPKG_ACCESS_KEY }} | |
| AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_INTERNAL_SERVICES_VCPKG_SECRET_KEY }} | |
| AWS_REGION: us-east-1 | |
| jobs: | |
| QuickChecks: | |
| name: "Quick Checks" | |
| runs-on: ubuntu-22.04 | |
| steps: | |
| - name: Check out repository code | |
| uses: actions/checkout@v4 | |
| - name: Check source formatting | |
| run: | | |
| npm install | |
| npm run format -- --dry-run -Werror | |
| Linting: | |
| name: "Linting" | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - name: Check out repository code | |
| uses: actions/checkout@v4 | |
| - name: Install latest CMake 3 and Ninja | |
| uses: lukka/get-cmake@latest | |
| with: | |
| cmakeVersion: "3.31.6" | |
| - name: ccache | |
| uses: hendrikmuhs/ccache-action@v1.2.9 | |
| with: | |
| key: ccache-ubuntu-24.04-clang-clang-tidy | |
| - name: Install latest clang and clang-tidy | |
| run: | | |
| wget https://apt.llvm.org/llvm.sh | |
| chmod +x llvm.sh | |
| sudo ./llvm.sh 19 | |
| sudo apt-get install clang-tidy-19 | |
| - name: Set CC and CXX | |
| run: | | |
| echo "CC=/usr/bin/clang-19" >> "$GITHUB_ENV" | |
| echo "CXX=/usr/bin/clang++-19" >> "$GITHUB_ENV" | |
| echo "VCPKG_ROOT=${VCPKG_INSTALLATION_ROOT}" >> "$GITHUB_ENV" | |
| - name: Make more swap space available | |
| run: | | |
| sudo swapoff -a | |
| sudo fallocate -l 10G /mnt/swapfile | |
| sudo chmod 600 /mnt/swapfile | |
| sudo mkswap /mnt/swapfile | |
| sudo swapon /mnt/swapfile | |
| sudo swapon --show | |
| - name: Run clang-tidy | |
| run: | | |
| echo `$CC --version | head -n 1`, `cmake --version | head -n 1` | |
| cp doc/cmake-presets/CMakeUserPresets.json . | |
| cmake --preset=vcpkg-linux -DCMAKE_BUILD_TYPE=Debug -DCESIUM_CLANG_TIDY_USE_THREADS=4 | |
| cmake --build build --target clang-tidy > output.log | |
| - name: Print vcpkg problems | |
| if: ${{ failure() }} | |
| run: | | |
| cat "/usr/local/share/vcpkg/buildtrees/doctest/config-x64-linux-dbg-out.log" | |
| cat "/usr/local/share/vcpkg/buildtrees/doctest/config-x64-linux-dbg-err.log" | |
| - name: List clang-tidy warnings & errors | |
| if: ${{ !cancelled() }} | |
| run: | | |
| sed -n '/\(error\|warning\):/,/^$/p' output.log | |
| # On macOS, the above doesn't work because the escaped pipe is not supported. | |
| # Instead, use two commands: | |
| # sed -n '/error:/,/^$/p' output.log | |
| # sed -n '/warning:/,/^$/p' output.log | |
| Documentation: | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - name: Install Doxygen | |
| run: | | |
| cd ~ | |
| wget https://github.com/doxygen/doxygen/releases/download/Release_1_13_2/doxygen-1.13.2.linux.bin.tar.gz | |
| tar xzf doxygen-1.13.2.linux.bin.tar.gz | |
| export PATH=$PWD/doxygen-1.13.2/bin:$PATH | |
| echo "PATH=$PATH" >> "$GITHUB_ENV" | |
| echo "VCPKG_ROOT=${VCPKG_INSTALLATION_ROOT}" >> "$GITHUB_ENV" | |
| doxygen --version | |
| - name: Install latest CMake 3 and Ninja | |
| uses: lukka/get-cmake@latest | |
| with: | |
| cmakeVersion: "3.31.6" | |
| - name: Check out repository code | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: ccache | |
| uses: hendrikmuhs/ccache-action@v1.2.9 | |
| with: | |
| key: ccache-ubuntu-24.04-doxygen | |
| - name: Generate Documentation | |
| run: | | |
| npm install | |
| cp doc/cmake-presets/CMakeUserPresets.json . | |
| cmake --preset=vcpkg-linux | |
| cmake --build build --target cesium-native-docs | |
| - name: Publish Documentation Artifact | |
| if: ${{ success() }} | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ReferenceDocumentation | |
| path: build/doc/html | |
| Coverage: | |
| name: "Coverage (Ubuntu GCC)" | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - name: Check out repository code | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Install latest CMake 3 and Ninja | |
| uses: lukka/get-cmake@latest | |
| with: | |
| cmakeVersion: "3.31.6" | |
| - name: Install coverage tools | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y jq python3-pip | |
| - name: Install pinned gcovr | |
| run: | | |
| python3 -m pip install --user --upgrade gcovr==8.4 | |
| echo "$HOME/.local/bin" >> "$GITHUB_PATH" | |
| gcovr --version | |
| - name: Add VCPKG_ROOT | |
| run: | | |
| echo "VCPKG_ROOT=${VCPKG_INSTALLATION_ROOT}" >> "$GITHUB_ENV" | |
| - name: Make more swap space available | |
| run: | | |
| sudo swapoff -a | |
| sudo fallocate -l 10G /mnt/swapfile | |
| sudo chmod 600 /mnt/swapfile | |
| sudo mkswap /mnt/swapfile | |
| sudo swapon /mnt/swapfile | |
| sudo swapon --show | |
| - name: Configure coverage build | |
| run: | | |
| cp doc/cmake-presets/CMakeUserPresets.json . | |
| cmake --preset=vcpkg-linux -DCMAKE_BUILD_TYPE=Debug -DCESIUM_COVERAGE_ENABLED=ON | |
| - name: Run coverage target | |
| run: | | |
| cmake --build build --target cesium-native-tests-coverage --parallel 2 | |
| - name: Generate machine-readable coverage summary | |
| run: | | |
| gcovr --json-summary --json-summary-pretty \ | |
| -r . \ | |
| -e ".*/extern/.*" \ | |
| -e ".*/generated/.*" \ | |
| -e ".*/test/.*" \ | |
| -e ".*/build.*" \ | |
| --object-directory build \ | |
| -o build/coverage-summary.json | |
| - name: Upload HTML coverage report | |
| if: ${{ !cancelled() }} | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: CoverageReportHtml | |
| path: build/cesium-native-tests-coverage | |
| - name: Upload current coverage summary | |
| if: ${{ !cancelled() }} | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: coverage-current-summary | |
| path: build/coverage-summary.json | |
| WindowsBuild: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| platform: [windows-2022] | |
| build_type: [Debug, RelWithDebInfo] | |
| name: "${{matrix.platform}} / ${{matrix.build_type}}" | |
| env: | |
| CACHE_KEY: "${{ matrix.platform }}" | |
| runs-on: ${{ matrix.platform }} | |
| steps: | |
| - name: Install latest CMake 3 and Ninja | |
| uses: lukka/get-cmake@latest | |
| with: | |
| cmakeVersion: "3.31.6" | |
| - name: Install nasm | |
| uses: ilammy/setup-nasm@v1 | |
| - name: Check out repository code | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Setup MSVC for command-line builds | |
| uses: ilammy/msvc-dev-cmd@v1 | |
| - name: sccache | |
| uses: hendrikmuhs/ccache-action@v1.2.9 | |
| with: | |
| key: ccache-${{ env.CACHE_KEY}}-${{matrix.build_type}}-1 | |
| variant: sccache | |
| - name: Compile ${{matrix.build_type}} Configuration | |
| run: | | |
| $env:VCPKG_ROOT="$env:VCPKG_INSTALLATION_ROOT" | |
| Copy .\doc\cmake-presets\CMakeUserPresets.json .\ | |
| cmake --preset=vcpkg-windows -G Ninja -DCMAKE_BUILD_TYPE=${{matrix.build_type}} -DCMAKE_C_COMPILER_LAUNCHER=C:\\Users\\runneradmin\\.cargo\\bin\\sccache -DCMAKE_CXX_COMPILER_LAUNCHER=C:\\Users\\runneradmin\\.cargo\\bin\\sccache | |
| cmake --build build | |
| - name: Test ${{matrix.build_type}} Configuration | |
| run: | | |
| cd build | |
| ctest -V | |
| PosixBuild: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| compiler: [ gcc, clang ] | |
| platform: [ ubuntu-24.04, ubuntu-22.04, macos-14 ] | |
| build_type: [Debug, RelWithDebInfo] | |
| exclude: | |
| - compiler: clang | |
| platform: ubuntu-24.04 | |
| - compiler: gcc | |
| platform: macos-14 | |
| - compiler: gcc | |
| platform: ubuntu-22.04 | |
| name: "${{matrix.platform}} / ${{matrix.compiler}} / ${{matrix.build_type}}" | |
| env: | |
| CACHE_KEY: "${{ matrix.platform }}-${{matrix.compiler}}" | |
| runs-on: ${{ matrix.platform }} | |
| steps: | |
| - name: Install latest CMake 3 and Ninja | |
| uses: lukka/get-cmake@latest | |
| with: | |
| cmakeVersion: "3.31.6" | |
| - name: Install nasm | |
| uses: ilammy/setup-nasm@v1 | |
| - name: Check out repository code | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: ccache | |
| uses: hendrikmuhs/ccache-action@v1.2.9 | |
| with: | |
| key: ccache-${{ env.CACHE_KEY}}-${{matrix.build_type}} | |
| - name: Set CC and CXX | |
| if: ${{ matrix.compiler == 'clang' && matrix.platform != 'macos-14'}} | |
| run: | | |
| echo "CC=clang" >> "$GITHUB_ENV" | |
| echo "CXX=clang++" >> "$GITHUB_ENV" | |
| - name: add VCPKG_ROOT | |
| run: | | |
| echo "VCPKG_ROOT=${VCPKG_INSTALLATION_ROOT}" >> "$GITHUB_ENV" | |
| - name: Make more swap space available | |
| if: ${{ matrix.platform != 'macos-14'}} | |
| run: | | |
| sudo swapoff -a | |
| sudo fallocate -l 10G /mnt/swapfile | |
| sudo chmod 600 /mnt/swapfile | |
| sudo mkswap /mnt/swapfile | |
| sudo swapon /mnt/swapfile | |
| sudo swapon --show | |
| - name: Set macOS cmake options | |
| if: ${{ matrix.platform == 'macos-14' }} | |
| run: | | |
| # Use a custom triplet to target macOS 10.15. | |
| mkdir -p vcpkg/triplets | |
| echo " | |
| set(VCPKG_CMAKE_SYSTEM_NAME Darwin) | |
| set(VCPKG_CRT_LINKAGE dynamic) | |
| set(VCPKG_LIBRARY_LINKAGE static) | |
| set(VCPKG_OSX_DEPLOYMENT_TARGET 10.15) | |
| set(VCPKG_TARGET_ARCHITECTURE x64) | |
| set(VCPKG_OSX_ARCHITECTURES x86_64) | |
| " > vcpkg/triplets/x64-macos-10-15.cmake | |
| # Specify the overlay triplet, and also tell cesium-native to build with the same settings. | |
| echo "EXTRA_CMAKE_OPTIONS=-DVCPKG_OVERLAY_TRIPLETS=$PWD/vcpkg/triplets -DVCPKG_TRIPLET=x64-macos-10-15 -DCMAKE_OSX_DEPLOYMENT_TARGET=10.15 -DCMAKE_OSX_ARCHITECTURES=x86_64 -DCMAKE_SYSTEM_NAME=Darwin -DCMAKE_SYSTEM_PROCESSOR=x86_64 -DVCPKG_TARGET_TRIPLET=x64-macos-10-15" >> "$GITHUB_ENV" | |
| - name: Compile ${{matrix.build_type}} Configuration | |
| run: | | |
| cp doc/cmake-presets/CMakeUserPresets.json . | |
| cmake --preset=vcpkg -DCMAKE_BUILD_TYPE:STRING=${{matrix.build_type}} $EXTRA_CMAKE_OPTIONS | |
| cmake --build build --parallel | |
| - name: Test ${{matrix.build_type}} Configuration | |
| run: | | |
| cd build | |
| ctest -V | |
| EmscriptenBuild: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| version: [ "3.1.39", "4.0.13" ] | |
| memory: [ "32", "64" ] | |
| exclude: | |
| - version: "3.1.39" | |
| memory: "64" | |
| name: Emscripten v${{matrix.version}} ${{matrix.memory}}bit memory | |
| env: | |
| CACHE_KEY: "emscripten-${{matrix.version}}-${{matrix.memory}}" | |
| runs-on: windows-2022 | |
| steps: | |
| - name: Check out repository code | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Use NodeJS 24 for WebAssembly 64-bit memory support | |
| if: ${{ matrix.memory == '64' }} | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: '>=24' | |
| - name: Checkout vcpkg 2025.02.14 packages for use with Emscripten 3.1.39 | |
| if: ${{ matrix.version == '3.1.39' }} | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: microsoft/vcpkg | |
| clean: false | |
| ref: 2025.02.14 | |
| path: extern/vcpkg/temp | |
| sparse-checkout-cone-mode: false | |
| sparse-checkout: | | |
| ports/ada-url | |
| - name: Move overlay ports to the correct location | |
| if: ${{ matrix.version == '3.1.39' }} | |
| run: | | |
| mv extern/vcpkg/temp/ports/* extern/vcpkg/ports/ | |
| - name: Add OpenSSL "no-dso" option on older Emscripten versions | |
| if: ${{ matrix.version == '3.1.39' }} | |
| run: | | |
| echo " | |
| if(PORT MATCHES "openssl") | |
| set(VCPKG_CONFIGURE_MAKE_OPTIONS "no-dso") | |
| endif() | |
| " >> extern/vcpkg/triplets/wasm32-emscripten-cesium.cmake | |
| - name: Install latest CMake 3 and Ninja | |
| uses: lukka/get-cmake@latest | |
| with: | |
| cmakeVersion: "3.31.6" | |
| - name: Install nasm | |
| uses: ilammy/setup-nasm@v1 | |
| - name: Setup emsdk | |
| uses: mymindstorm/setup-emsdk@v14 | |
| with: | |
| version: ${{matrix.version}} | |
| - name: Verify | |
| run: emcc -v | |
| - name: Compile Debug Configuration | |
| run: | | |
| $env:VCPKG_ROOT="$env:VCPKG_INSTALLATION_ROOT" | |
| $MEMORYPROPERTY="${{matrix.memory}}" -eq "64" ? "-DCESIUM_WASM64=ON" : "" | |
| emcmake cmake -B build -S . -DCMAKE_BUILD_TYPE=Debug $MEMORYPROPERTY | |
| cmake --build build --config Debug --parallel | |
| - name: Test Debug Configuration | |
| run: | | |
| node build/CesiumNativeTests/cesium-native-tests.js |