Add build for ubuntu 24.04 when merging PRs #1085
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: Build & Test | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
env: | |
BUILD_TYPE: Debug | |
jobs: | |
build: | |
name: ${{ matrix.config.name }} | |
runs-on: ${{ matrix.config.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
config: | |
- { | |
name: "Ubuntu 22.04", | |
os: ubuntu-22.04, | |
triplet: x64-linux, | |
cc: "gcc", | |
cxx: "g++" | |
} | |
- { | |
name: "Ubuntu 24.04", | |
os: ubuntu-24.04, | |
triplet: x64-linux, | |
cc: "gcc", | |
cxx: "g++" | |
} | |
steps: | |
- name: Setup cmake | |
uses: lukka/get-cmake@latest | |
- name: Ensure 20 2MB Hugepages free (required for comprehensive testing) | |
shell: bash | |
timeout-minutes: 5 | |
run: while [ $(cat /proc/meminfo | grep HugePages_Free | awk '{ printf $2 }') -lt 20 ]; do echo "Requesting 20 2MB hugepages"; echo 350 | sudo tee /sys/kernel/mm/hugepages/hugepages-2048kB/nr_hugepages; cat /proc/meminfo | grep HugePages_; done; free -m; | |
- name: Checkout | |
uses: actions/checkout@v2 | |
with: | |
submodules: true | |
fetch-depth: 2 | |
- name: Install required dependencies | |
run: sudo apt-get update && sudo apt-get install -y build-essential cmake pkg-config git libnuma1 libnuma-dev libcurl4-openssl-dev libcurl4 libyaml-0-2 libyaml-dev libmbedtls-dev libpcre2-8-0 libpcre2-dev libjson-c-dev valgrind libhiredis-dev liblzf-dev redis-tools gcc-12 g++-12 | |
- name: Create Build Environment | |
run: cmake -E make_directory ${{github.workspace}}/build | |
- name: Configure CMake | |
shell: bash | |
working-directory: ${{github.workspace}}/build | |
run: CC=/usr/bin/gcc-12 CXX=/usr/bin/g++-12 cmake $GITHUB_WORKSPACE -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DUSE_HASH_ALGORITHM_T1HA2=1 -DBUILD_TESTS=1 -DBUILD_INTERNAL_BENCHES=1 | |
- name: Build cachegrand-server and cachegrand-tests | |
working-directory: ${{github.workspace}}/build | |
shell: bash | |
run: cmake --build . --target cachegrand-server cachegrand-tests -- -j $(nproc) | |
- name: Tests - Unit Tests | |
working-directory: ${{github.workspace}}/build | |
shell: bash | |
run: cd tests/unit_tests && sudo ./cachegrand-tests --order lex | |
- name: Code Coverage - Generation | |
uses: danielealbano/lcov-action@v4 | |
with: | |
gcov_path: /usr/bin/gcov-12 | |
remove_patterns: 3rdparty,tests | |
- uses: codecov/codecov-action@v3 | |
with: | |
files: ${{github.workspace}}/coverage.info | |
flags: unittests # optional | |
name: cachegrand-server | |
fail_ci_if_error: false | |
verbose: false | |
# - name: Tests - Integration Tests - Redis Server | |
# working-directory: ${{github.workspace}}/build | |
# shell: bash | |
# run: ctest -R cachegrand-integration-tests-redis-server --verbose || true | |
# - uses: actions/upload-artifact@v2 | |
# with: | |
# name: tests-integration-tests-redis-server-results | |
# path: ${{github.workspace}}/build/tests/integration_tests/redis_server/junit-report.xml |