From 3d7cc783f818789df522a07a10939177628c5c13 Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Fri, 26 Aug 2022 13:03:17 -0400 Subject: [PATCH] Update build steps for Build On Linux (#22135) * Update build steps for Build On Linux `Build on Linux (fake, gcc_release, clang, simulated)` periodically times out, like for https://github.com/project-chip/connectedhomeip/runs/7996944701?check_suite_focus=true Fixes #22134 * Move clang tidy validation to use one of the builds in sanitizer builds * Ensure build output is known and cleaned after each sanitizer build and test, fix clang-tidy * Exclude lwip from clang-tidy validation * do NOT upload objdir for linux ... it is way too big * Fix typo * Another typo fix - remove invalid quotes --- .github/workflows/build.yaml | 61 ++++++++++++++++++------------------ 1 file changed, 30 insertions(+), 31 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index ecef4f5a31da24..6bf171d668b920 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -122,7 +122,7 @@ jobs: retention-days: 5 build_linux: name: Build on Linux (fake, gcc_release, clang, simulated) - timeout-minutes: 120 + timeout-minutes: 150 runs-on: ubuntu-latest if: github.actor != 'restyled-io[bot]' @@ -185,31 +185,14 @@ jobs: - name: Setup Build, Run Build and Run Tests timeout-minutes: 90 run: | - for BUILD_TYPE in gcc_release clang; do - case $BUILD_TYPE in - "gcc_release") GN_ARGS='is_debug=false';; - "clang") GN_ARGS='is_clang=true';; - esac - - BUILD_TYPE=$BUILD_TYPE scripts/build/gn_gen.sh --args="$GN_ARGS" --export-compile-commands - scripts/run_in_build_env.sh "ninja -C ./out/$BUILD_TYPE" - BUILD_TYPE=$BUILD_TYPE scripts/tests/gn_tests.sh - done - - name: Clang-tidy validation - timeout-minutes: 45 - run: | - ./scripts/run_in_build_env.sh \ - "./scripts/run-clang-tidy-on-compile-commands.py \ - --no-log-timestamps \ - --compile-database out/clang/compile_commands.json \ - check \ - " + BUILD_TYPE=gcc_release scripts/build/gn_gen.sh --args="is_debug=false" + scripts/run_in_build_env.sh "ninja -C ./out/gcc_release" + BUILD_TYPE=gcc_release scripts/tests/gn_tests.sh - name: Run Tests with sanitizers timeout-minutes: 60 env: LSAN_OPTIONS: detect_leaks=1 run: | - # for BUILD_TYPE in asan msan tsan ubsan; do for BUILD_TYPE in asan tsan ubsan; do case $BUILD_TYPE in "asan") GN_ARGS='is_clang=true is_asan=true';; @@ -218,9 +201,20 @@ jobs: "ubsan") GN_ARGS='is_clang=true is_ubsan=true';; esac - scripts/build/gn_gen.sh --args="$GN_ARGS" - scripts/tests/gn_tests.sh + rm -rf ./out/sanitizers + BUILD_TYPE=sanitizers scripts/build/gn_gen.sh --args="$GN_ARGS" --export-compile-commands + BUILD_TYPE=sanitizers scripts/tests/gn_tests.sh done + - name: Clang-tidy validation + timeout-minutes: 45 + run: | + ./scripts/run_in_build_env.sh \ + "./scripts/run-clang-tidy-on-compile-commands.py \ + --no-log-timestamps \ + --compile-database out/sanitizers/compile_commands.json \ + --file-exclude-regex '/(repo|zzz_generated|lwip/standalone)/' \ + check \ + " - name: Build using build_examples.py timeout-minutes: 60 run: | @@ -245,14 +239,19 @@ jobs: path: /tmp/cores/ # Cores are big; don't hold on to them too long. retention-days: 5 - - name: Uploading objdir for debugging - uses: actions/upload-artifact@v2 - if: ${{ failure() && !env.ACT }} - with: - name: crash-objdir-linux - path: out/ - # objdirs are big; don't hold on to them too long. - retention-days: 5 + # OBJDIR on linux is > 10K files and takes more than 50 minutes to upload, usually + # having the job timeout. + # + # If re-enabling, some subset of this should be picked + # + # - name: Uploading objdir for debugging + # uses: actions/upload-artifact@v2 + # if: ${{ failure() && !env.ACT }} + # with: + # name: crash-objdir-linux + # path: out/ + # # objdirs are big; don't hold on to them too long. + # retention-days: 5 # TODO Log Upload https://github.com/project-chip/connectedhomeip/issues/2227 # TODO https://github.com/project-chip/connectedhomeip/issues/1512