|
| 1 | +name: single-unit |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_dispatch: |
| 5 | + push: |
| 6 | + branches: |
| 7 | + - abhijat/dnm/debug-test |
| 8 | + |
| 9 | +concurrency: |
| 10 | + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} |
| 11 | + cancel-in-progress: true |
| 12 | + |
| 13 | +jobs: |
| 14 | + pre-commit: |
| 15 | + runs-on: ubuntu-latest |
| 16 | + steps: |
| 17 | + - uses: actions/checkout@v6 |
| 18 | + with: |
| 19 | + fetch-depth: 2 |
| 20 | + build: |
| 21 | + strategy: |
| 22 | + matrix: |
| 23 | + include: |
| 24 | + - container: "ubuntu-dev:24" |
| 25 | + build-type: Debug |
| 26 | + compiler: { cxx: clang++, c: clang } |
| 27 | + # https://maskray.me/blog/2023-08-25-clang-wunused-command-line-argument (search for compiler-rt) |
| 28 | + cxx_flags: "-Wno-error=unused-command-line-argument" |
| 29 | + sanitizers: "Sanitizers" |
| 30 | + |
| 31 | + runs-on: ubuntu-latest |
| 32 | + container: |
| 33 | + image: ghcr.io/romange/${{ matrix.container }} |
| 34 | + # Seems that docker by default prohibits running iouring syscalls |
| 35 | + options: --security-opt seccomp=unconfined --sysctl "net.ipv6.conf.all.disable_ipv6=0" |
| 36 | + volumes: |
| 37 | + - /:/hostroot |
| 38 | + - /mnt:/mnt |
| 39 | + credentials: |
| 40 | + username: ${{ github.repository_owner }} |
| 41 | + password: ${{ secrets.GITHUB_TOKEN }} |
| 42 | + |
| 43 | + steps: |
| 44 | + - uses: actions/checkout@v6 |
| 45 | + with: |
| 46 | + submodules: true |
| 47 | + |
| 48 | + - name: Prepare Environment |
| 49 | + run: | |
| 50 | + uname -a |
| 51 | + mkdir -p ${GITHUB_WORKSPACE}/build |
| 52 | +
|
| 53 | + echo "===================Before freeing up space ============================================" |
| 54 | + df -h |
| 55 | + rm -rf /hostroot/usr/share/dotnet |
| 56 | + rm -rf /hostroot/usr/local/share/boost |
| 57 | + rm -rf /hostroot/usr/local/lib/android |
| 58 | + rm -rf /hostroot/opt/ghc |
| 59 | + echo "===================After freeing up space ============================================" |
| 60 | + touch /mnt/foo |
| 61 | + ls -la /mnt/foo |
| 62 | +
|
| 63 | + - name: Configure CMake |
| 64 | + # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make. |
| 65 | + # See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type |
| 66 | + run: | |
| 67 | + echo "ulimit is" |
| 68 | + ulimit -s |
| 69 | + echo "-----------------------------" |
| 70 | + echo "disk space is:" |
| 71 | + df -h |
| 72 | + echo "-----------------------------" |
| 73 | +
|
| 74 | + echo "ASAN/USAN" |
| 75 | + export ASAN="ON" |
| 76 | + export USAN="ON" |
| 77 | +
|
| 78 | + cmake -B ${GITHUB_WORKSPACE}/build \ |
| 79 | + -DCMAKE_BUILD_TYPE=${{matrix.build-type}} \ |
| 80 | + -DWITH_AWS=OFF \ |
| 81 | + -DWITH_GCP=OFF \ |
| 82 | + -DWITH_UNWIND=OFF \ |
| 83 | + -DWITH_GPERF=OFF \ |
| 84 | + -GNinja \ |
| 85 | + -DCMAKE_C_COMPILER="${{matrix.compiler.c}}" \ |
| 86 | + -DCMAKE_CXX_COMPILER="${{matrix.compiler.cxx}}" \ |
| 87 | + -DCMAKE_CXX_FLAGS="${{matrix.cxx_flags}}" -DWITH_AWS:BOOL=OFF \ |
| 88 | + -DWITH_ASAN="${ASAN}" \ |
| 89 | + -DWITH_USAN="${USAN}" \ |
| 90 | + -L |
| 91 | +
|
| 92 | + cd ${GITHUB_WORKSPACE}/build && pwd |
| 93 | +
|
| 94 | + - name: Build |
| 95 | + run: | |
| 96 | + cd ${GITHUB_WORKSPACE}/build |
| 97 | + ninja hll_family_test |
| 98 | +
|
| 99 | + - name: C++ Unit Tests - Epoll |
| 100 | + run: | |
| 101 | + cd ${GITHUB_WORKSPACE}/build |
| 102 | + GLOG_alsologtostderr=1 FLAGS_fiber_safety_margin=4096 FLAGS_force_epoll=true GLOG_vmodule=rdb_load=1,rdb_save=1,snapshot=1 \ |
| 103 | + timeout 30m ./hll_family_test --gtest_repeat=100 --gtest_break_on_failure |
| 104 | +
|
| 105 | + - name: C++ Unit Tests - IoUring |
| 106 | + run: | |
| 107 | + cd ${GITHUB_WORKSPACE}/build |
| 108 | + GLOG_alsologtostderr=1 GLOG_vmodule=rdb_load=1,rdb_save=1,snapshot=1,op_manager=1,op_manager_test=1 \ |
| 109 | + FLAGS_fiber_safety_margin=4096 timeout 30m ./hll_family_test --gtest_repeat=100 --gtest_break_on_failure |
| 110 | +
|
| 111 | + - name: Upload unit logs on failure |
| 112 | + if: failure() |
| 113 | + uses: actions/upload-artifact@v6 |
| 114 | + with: |
| 115 | + name: unit_logs |
| 116 | + path: /tmp/*INFO* |
0 commit comments