diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4fb4f495e994..572fea4c2e18 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -44,10 +44,19 @@ jobs: build-type: [Debug, Release] compiler: [{ cxx: g++, c: gcc }] cxx_flags: ["-Werror"] + sanitizers: ["NoSanitizers"] include: - container: "alpine-dev:latest" build-type: Debug compiler: { cxx: clang++, c: clang } + cxx_flags: "" + sanitizers: "NoSanitizers" + - container: "ubuntu-dev:24" + build-type: Debug + compiler: { cxx: clang++, c: clang } + # https://maskray.me/blog/2023-08-25-clang-wunused-command-line-argument (search for compiler-rt) + cxx_flags: "-Wno-error=unused-command-line-argument" + sanitizers: "Sanitizers" runs-on: ubuntu-latest env: @@ -71,6 +80,7 @@ jobs: - uses: actions/checkout@v4 with: submodules: true + - name: Prepare Environment run: | uname -a @@ -88,6 +98,7 @@ jobs: df -h touch /mnt/foo ls -la /mnt/foo + - name: Run sccache-cache uses: mozilla-actions/sccache-action@v0.0.7 @@ -98,10 +109,35 @@ jobs: core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || ''); core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '') + - name: Install clang + if: matrix.sanitizers == 'Sanitizers' + run: | + # TODO remove this once the weekly is done + apt -y update + apt -y upgrade + apt install -y clang + which clang + - 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: | + echo "ulimit is" + ulimit -s + echo "-----------------------------" + echo "disk space is:" + df -h + echo "-----------------------------" + + export ASAN="OFF" + export USAN="OFF" + + if [ '${{matrix.sanitizers}}' = 'Sanitizers' ]; then + echo "ASAN/USAN" + export ASAN="ON" + export USAN="ON" + fi + # -no-pie to disable address randomization so we could symbolize stacktraces cmake -B ${GITHUB_WORKSPACE}/build \ -DCMAKE_BUILD_TYPE=${{matrix.build-type}} \ @@ -110,7 +146,10 @@ jobs: -DCMAKE_CXX_COMPILER="${{matrix.compiler.cxx}}" \ -DCMAKE_CXX_COMPILER_LAUNCHER=sccache -DCMAKE_C_COMPILER_LAUNCHER=sccache \ -DCMAKE_CXX_FLAGS="${{matrix.cxx_flags}} -no-pie" -DWITH_AWS:BOOL=OFF \ + -DWITH_ASAN="${ASAN}" \ + -DWITH_USAN="${USAN}" \ -L + cd ${GITHUB_WORKSPACE}/build && pwd du -hcs _deps/ diff --git a/.github/workflows/daily-sanitizers.yml b/.github/workflows/daily-sanitizers.yml deleted file mode 100644 index 2117731714cf..000000000000 --- a/.github/workflows/daily-sanitizers.yml +++ /dev/null @@ -1,107 +0,0 @@ -name: daily-sanitizers - -on: - schedule: - - cron: '0 4 * * *' # run at 4 AM UTC - workflow_dispatch: - -jobs: - build: - runs-on: [ubuntu-24.04] - strategy: - matrix: - container: ["ubuntu-dev:24"] - build-type: [Debug] - compiler: [{ cxx: clang++, c: clang }] - # TODO bring it back when warnings on clang are fixed - # cxx_flags: ["-Werror"] - timeout-minutes: 90 - env: - SCCACHE_GHA_ENABLED: "true" - SCCACHE_CACHE_SIZE: 6G - SCCACHE_ERROR_LOG: /tmp/sccache_log.txt - - container: - image: ghcr.io/romange/${{ matrix.container }} - options: --security-opt seccomp=unconfined - credentials: - username: ${{ github.repository_owner }} - password: ${{ secrets.GITHUB_TOKEN }} - - steps: - - uses: actions/checkout@v4 - with: - submodules: true - - - name: Run sccache-cache - uses: mozilla-actions/sccache-action@v0.0.7 - - - name: Configure Cache Env - uses: actions/github-script@v7 - with: - script: | - core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || ''); - core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '') - - - name: Prepare Environment - run: | - uname -a - cmake --version - mkdir -p ${GITHUB_WORKSPACE}/build - - echo "===================Before freeing up space ============================================" - df -h - rm -rf /hostroot/usr/share/dotnet - rm -rf /hostroot/usr/local/share/boost - rm -rf /hostroot/usr/local/lib/android - rm -rf /hostroot/opt/ghc - echo "===================After freeing up space ============================================" - df -h - - - name: Configure & Build - run: | - apt -y update - apt -y upgrade - apt install -y clang - which clang - echo "ulimit is" - ulimit -s - echo "-----------------------------" - echo "disk space is:" - df -h - echo "-----------------------------" - mkdir -p $GITHUB_WORKSPACE/build - cd $GITHUB_WORKSPACE/build - cmake .. \ - -DCMAKE_BUILD_TYPE=Debug \ - -GNinja \ - -DCMAKE_C_COMPILER="${{matrix.compiler.c}}" \ - -DCMAKE_CXX_COMPILER="${{matrix.compiler.cxx}}" \ - -DCMAKE_C_COMPILER_LAUNCHER=sccache \ - -DCMAKE_CXX_COMPILER_LAUNCHER=sccache \ - -DCMAKE_CXX_FLAGS="${{matrix.cxx_flags}}" \ - -DWITH_ASAN=ON \ - -DWITH_USAN=ON \ - -DCMAKE_C_FLAGS=-Wno-error=unused-command-line-argument \ - -DCMAKE_CXX_FLAGS=-Wno-error=unused-command-line-argument - # https://maskray.me/blog/2023-08-25-clang-wunused-command-line-argument (search for compiler-rt) - - ninja src/all - - - name: Test - run: | - cd $GITHUB_WORKSPACE/build - ctest -V -L DFLY - - - name: Send notifications on failure - if: failure() && github.ref == 'refs/heads/main' - shell: bash - run: | - job_link="${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}" - message="Daily sanitizers failed.\\n Job Link: ${job_link}\\n" - - curl -s \ - -X POST \ - -H 'Content-Type: application/json' \ - '${{ secrets.GSPACES_BOT_DF_BUILD }}' \ - -d '{"text": "'"${message}"'"}'