velocypack-test #150
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: velocypack-test | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: [ main ] | |
| pull_request: | |
| branches: [ main ] | |
| env: | |
| CMAKE_BUILD_PARALLEL_LEVEL: 4 | |
| CXX_STANDARD: 20 | |
| jobs: | |
| build: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| include: | |
| # GCC builds | |
| - {os: ubuntu-latest, compiler: gcc, version: '13', | |
| build_type: Release, hash_type: fasthash } | |
| - {os: ubuntu-latest, compiler: gcc, version: '14', | |
| build_type: Release, hash_type: xxhash } | |
| - {os: ubuntu-latest, compiler: gcc, version: '15', | |
| build_type: Release, hash_type: fasthash } | |
| - {os: ubuntu-latest, compiler: gcc, version: '13', | |
| build_type: Debug, hash_type: xxhash, | |
| flags: '-O0 -fno-inline --coverage', coverage: true} | |
| - {os: ubuntu-latest, compiler: gcc, version: '13', | |
| build_type: Debug, hash_type: xxhash, sanitizer: true, | |
| flags: '-fsanitize=address -fsanitize=leak -fsanitize=undefined -fsanitize-address-use-after-scope -fno-omit-frame-pointer', | |
| ld_flags: '-fsanitize=address -fsanitize=leak -fsanitize=undefined -fsanitize-address-use-after-scope -fno-omit-frame-pointer'} | |
| # Clang builds | |
| - {os: ubuntu-latest, compiler: clang, version: '16', | |
| build_type: Release, hash_type: xxhash } | |
| - {os: ubuntu-latest, compiler: clang, version: '17', | |
| build_type: Release, hash_type: fasthash } | |
| - {os: ubuntu-latest, compiler: clang, version: '18', | |
| build_type: Release, hash_type: xxhash } | |
| - {os: ubuntu-latest, compiler: clang, version: '19', | |
| build_type: Release, hash_type: fasthash } | |
| # Windows builds (removed windows-2019 as it's deprecated) | |
| - {os: windows-latest, compiler: msvc, | |
| build_type: Release, hash_type: xxhash } | |
| # macOS builds | |
| - {os: macos-latest, compiler: clang, | |
| build_type: Release, hash_type: xxhash } | |
| fail-fast: false | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup environment | |
| run: | | |
| echo "SANITIZER=${{ matrix.sanitizer }}" >> ${GITHUB_ENV} | |
| - name: Install gcc | |
| if: startsWith(matrix.os, 'ubuntu-') && matrix.compiler == 'gcc' | |
| run: | | |
| sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y | |
| sudo apt-get update | |
| sudo apt-get install g++-${{ matrix.version }} -y | |
| echo "CXX=g++-${{ matrix.version }}" >> ${GITHUB_ENV} | |
| echo "CC=gcc-${{ matrix.version }}" >> ${GITHUB_ENV} | |
| - name: Install clang | |
| if: startsWith(matrix.os, 'ubuntu-') && matrix.compiler == 'clang' | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install libunwind-dev -y | |
| sudo wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add - | |
| version=${{ matrix.version }} | |
| if [[ $version -ge 14 ]]; then | |
| sudo add-apt-repository "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-$version main" -y | |
| fi | |
| sudo apt-get update | |
| sudo apt-get install clang-$version lld libc++-$version-dev libc++abi-$version-dev -y | |
| echo "CC=clang-$version" >> ${GITHUB_ENV} | |
| echo "CXX=clang++-$version" >> ${GITHUB_ENV} | |
| echo "LDFLAGS=-fuse-ld=lld" >> ${GITHUB_ENV} | |
| - name: Initialize MSVC | |
| if: startsWith(matrix.os, 'windows-') | |
| uses: ilammy/msvc-dev-cmd@v1 | |
| - name: Configure CMake | |
| # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make. | |
| # See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type | |
| run: cmake -B${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DHashType=${{ matrix.hash_type }} -DBuildTests=ON -DBuildLargeTests=OFF -DBuildVelocyPackExamples=ON -DBuildTools=ON -DEnableSSE=OFF -DCMAKE_CXX_STANDARD=${{env.CXX_STANDARD}} -DCMAKE_CXX_FLAGS="${{ matrix.flags }}" -DCMAKE_C_FLAGS="${{ matrix.flags }}" -DCMAKE_LINKER_FLAGS="${{ matrix.ld_flags }}" | |
| - name: Build | |
| # Build your program with the given configuration | |
| run: cmake --build ${{github.workspace}}/build --config ${{ matrix.build_type }} | |
| - name: Test | |
| working-directory: ${{github.workspace}} | |
| run: scripts/execute-test.sh | |
| - name: Coverage | |
| if: matrix.coverage == true | |
| run: | | |
| sudo apt-get install lcov -y | |
| CXX=g++-${{ matrix.version }} scripts/collect-coverage.sh | |
| - name: Coveralls Upload | |
| if: matrix.coverage == true | |
| uses: coverallsapp/github-action@master | |
| with: | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| path-to-lcov: ${{ github.workspace }}/coverage.info |