From 47f8f4b012cdce467ebb6dee020de5e09cd89086 Mon Sep 17 00:00:00 2001 From: Max SCHMELLER Date: Tue, 3 Dec 2024 15:34:57 +0900 Subject: [PATCH 01/19] ci: introduce Facebook Infer job Signed-off-by: Max SCHMELLER --- .../build-and-test-differential.yaml | 40 +++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/.github/workflows/build-and-test-differential.yaml b/.github/workflows/build-and-test-differential.yaml index 625b62bdb..5313be68b 100644 --- a/.github/workflows/build-and-test-differential.yaml +++ b/.github/workflows/build-and-test-differential.yaml @@ -37,6 +37,14 @@ jobs: target-packages: ${{ steps.get-modified-packages.outputs.modified-packages }} build-depends-repos: ${{ matrix.build-depends-repos }} + - name: Upload compilation database + id: upload-compile-db + uses: actions/upload-artifact@v4 + with: + name: compilation-database-diff-${{ github.head_ref }} + path: build/compile_commands.json + if-no-files-found: error + - name: Test id: test if: ${{ steps.get-modified-packages.outputs.modified-packages != '' }} @@ -55,3 +63,35 @@ jobs: fail_ci_if_error: false verbose: true flags: differential + + fb-infer-differential: + runs-on: ubuntu-latest + needs: [build-and-test-differential] + steps: + - name: Install FB Infer + id: fb-infer-install + env: + VERSION: 1.2.0 + run: | + curl -sSL "https://github.com/facebook/infer/releases/download/v$VERSION/infer-linux-x86_64-v$VERSION.tar.xz" \ + sudo ln -s "infer-linux-x86_64-v$VERSION/bin/infer" ./infer + + - name: Download compilation database + id: download-compile-db + uses: actions/download-artifact@v4 + with: + name: compilation-database-diff-${{ github.head_ref }} + + - name: Run FB Infer + id: fb-infer-run + run: | + git diff --name-only ${{ github.head_ref }}..${{ github.base_ref }} > changed-files.txt + infer run --changed-files-index changed-files.txt --compilation-database ./compile_commands.json + + - name: Upload FB Infer Report + id: fb-infer-upload + uses: actions/upload-artifact@v4 + with: + name: infer-report-diff-${{ github.head_ref }} + path: infer-out/report.* + if-no-files-found: error From 8c1c514ab61cc7d460888d4de412ad7000d6373d Mon Sep 17 00:00:00 2001 From: Max SCHMELLER Date: Tue, 3 Dec 2024 16:35:20 +0900 Subject: [PATCH 02/19] run infer only when compile commands were produced Signed-off-by: Max SCHMELLER --- .../build-and-test-differential.yaml | 20 ++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build-and-test-differential.yaml b/.github/workflows/build-and-test-differential.yaml index 5313be68b..3371a1b26 100644 --- a/.github/workflows/build-and-test-differential.yaml +++ b/.github/workflows/build-and-test-differential.yaml @@ -30,6 +30,7 @@ jobs: uses: autowarefoundation/autoware-github-actions/get-modified-packages@v1 - name: Build + id: build if: ${{ steps.get-modified-packages.outputs.modified-packages != '' }} uses: autowarefoundation/autoware-github-actions/colcon-build@v1 with: @@ -38,6 +39,7 @@ jobs: build-depends-repos: ${{ matrix.build-depends-repos }} - name: Upload compilation database + if: ${{ steps.build.outcome == 'success' }} id: upload-compile-db uses: actions/upload-artifact@v4 with: @@ -47,7 +49,7 @@ jobs: - name: Test id: test - if: ${{ steps.get-modified-packages.outputs.modified-packages != '' }} + if: ${{ steps.build.outcome == 'success' }} uses: autowarefoundation/autoware-github-actions/colcon-test@v1 with: rosdistro: ${{ matrix.rosdistro }} @@ -67,29 +69,33 @@ jobs: fb-infer-differential: runs-on: ubuntu-latest needs: [build-and-test-differential] + if: ${{ needs.build-and-test-differential.result }} steps: + - name: Download compilation database + id: download-compile-db + uses: actions/download-artifact@v4 + with: + name: compilation-database-diff-${{ github.head_ref }} + - name: Install FB Infer id: fb-infer-install + if: ${{ steps.download-compile-db.outcome == 'success' }} env: VERSION: 1.2.0 run: | curl -sSL "https://github.com/facebook/infer/releases/download/v$VERSION/infer-linux-x86_64-v$VERSION.tar.xz" \ sudo ln -s "infer-linux-x86_64-v$VERSION/bin/infer" ./infer - - name: Download compilation database - id: download-compile-db - uses: actions/download-artifact@v4 - with: - name: compilation-database-diff-${{ github.head_ref }} - - name: Run FB Infer id: fb-infer-run + if: ${{ steps.fb-infer-install.outcome == 'success' }} run: | git diff --name-only ${{ github.head_ref }}..${{ github.base_ref }} > changed-files.txt infer run --changed-files-index changed-files.txt --compilation-database ./compile_commands.json - name: Upload FB Infer Report id: fb-infer-upload + if: ${{ steps.fb-infer-run.outcome == 'success' }} uses: actions/upload-artifact@v4 with: name: infer-report-diff-${{ github.head_ref }} From 992ef5f6e4451e2383087622395baefdc7ac79d8 Mon Sep 17 00:00:00 2001 From: Max SCHMELLER Date: Tue, 3 Dec 2024 16:39:10 +0900 Subject: [PATCH 03/19] change to commit SHAs for CI artifact postfix Signed-off-by: Max SCHMELLER --- .github/workflows/build-and-test-differential.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-and-test-differential.yaml b/.github/workflows/build-and-test-differential.yaml index 3371a1b26..7a61af696 100644 --- a/.github/workflows/build-and-test-differential.yaml +++ b/.github/workflows/build-and-test-differential.yaml @@ -43,7 +43,7 @@ jobs: id: upload-compile-db uses: actions/upload-artifact@v4 with: - name: compilation-database-diff-${{ github.head_ref }} + name: compilation-database-diff-${{ github.sha }} path: build/compile_commands.json if-no-files-found: error @@ -75,7 +75,7 @@ jobs: id: download-compile-db uses: actions/download-artifact@v4 with: - name: compilation-database-diff-${{ github.head_ref }} + name: compilation-database-diff-${{ github.sha }} - name: Install FB Infer id: fb-infer-install From 425d56e8c87e8d4ae685425538babdf3638b9762 Mon Sep 17 00:00:00 2001 From: Max SCHMELLER Date: Wed, 4 Dec 2024 15:22:32 +0900 Subject: [PATCH 04/19] fix: skip job gracefully if artifact does not exist Signed-off-by: Max SCHMELLER --- .github/workflows/build-and-test-differential.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build-and-test-differential.yaml b/.github/workflows/build-and-test-differential.yaml index 7a61af696..22555f1c9 100644 --- a/.github/workflows/build-and-test-differential.yaml +++ b/.github/workflows/build-and-test-differential.yaml @@ -76,6 +76,7 @@ jobs: uses: actions/download-artifact@v4 with: name: compilation-database-diff-${{ github.sha }} + continue-on-error: true - name: Install FB Infer id: fb-infer-install From e55686f444c7da101aeecbf60e9200e136766621 Mon Sep 17 00:00:00 2001 From: Max SCHMELLER Date: Wed, 4 Dec 2024 15:29:09 +0900 Subject: [PATCH 05/19] TEMPORARY Signed-off-by: Max SCHMELLER --- nebula_ros/src/hesai/hesai_ros_wrapper.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/nebula_ros/src/hesai/hesai_ros_wrapper.cpp b/nebula_ros/src/hesai/hesai_ros_wrapper.cpp index 387d6c4c7..893403d32 100644 --- a/nebula_ros/src/hesai/hesai_ros_wrapper.cpp +++ b/nebula_ros/src/hesai/hesai_ros_wrapper.cpp @@ -7,6 +7,7 @@ #include #include #include +#include #include #include @@ -268,6 +269,7 @@ Status HesaiRosWrapper::validate_and_set_config( decoder_wrapper_->on_config_change(new_config); } + RCLCPP_DEBUG(get_logger(), "hi"); sensor_cfg_ptr_ = new_config; return Status::OK; } From 029932eb2808d5eed875070948bad8209817b2bf Mon Sep 17 00:00:00 2001 From: Max SCHMELLER Date: Wed, 4 Dec 2024 15:52:28 +0900 Subject: [PATCH 06/19] fix infer installation Signed-off-by: Max SCHMELLER --- .github/workflows/build-and-test-differential.yaml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-and-test-differential.yaml b/.github/workflows/build-and-test-differential.yaml index 22555f1c9..8d17910ae 100644 --- a/.github/workflows/build-and-test-differential.yaml +++ b/.github/workflows/build-and-test-differential.yaml @@ -84,8 +84,10 @@ jobs: env: VERSION: 1.2.0 run: | - curl -sSL "https://github.com/facebook/infer/releases/download/v$VERSION/infer-linux-x86_64-v$VERSION.tar.xz" \ - sudo ln -s "infer-linux-x86_64-v$VERSION/bin/infer" ./infer + wget https://github.com/facebook/infer/releases/download/v${VERSION}/infer-linux-x86_64-v${VERSION}.tar.xz + tar -xvf infer-linux-x86_64-v${VERSION}.tar.xz + sudo mv infer-linux-x86_64-v${VERSION} /usr/local/infer + echo "PATH=/usr/local/infer/bin:$PATH" >> $GITHUB_ENV - name: Run FB Infer id: fb-infer-run From 390de6925a0ede39ca024b835d54efea198ee246 Mon Sep 17 00:00:00 2001 From: Max SCHMELLER Date: Wed, 4 Dec 2024 16:46:18 +0900 Subject: [PATCH 07/19] upload all needed file for infer, disable diff analysis for now Signed-off-by: Max SCHMELLER --- .../build-and-test-differential.yaml | 28 ++++++++++++------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build-and-test-differential.yaml b/.github/workflows/build-and-test-differential.yaml index 8d17910ae..2785839ae 100644 --- a/.github/workflows/build-and-test-differential.yaml +++ b/.github/workflows/build-and-test-differential.yaml @@ -19,8 +19,6 @@ jobs: steps: - name: Check out repository uses: actions/checkout@v3 - with: - fetch-depth: 0 - name: Remove exec_depend uses: autowarefoundation/autoware-github-actions/remove-exec-depend@v1 @@ -38,13 +36,20 @@ jobs: target-packages: ${{ steps.get-modified-packages.outputs.modified-packages }} build-depends-repos: ${{ matrix.build-depends-repos }} - - name: Upload compilation database + - name: Upload build artifacts for static analysis if: ${{ steps.build.outcome == 'success' }} - id: upload-compile-db uses: actions/upload-artifact@v4 with: - name: compilation-database-diff-${{ github.sha }} - path: build/compile_commands.json + name: static-analysis-resources-${{ github.sha }} + path: | + build/compile_commands.json + build/**/*.c + build/**/*.cc + build/**/*.cpp + build/**/*.h + build/**/*.hh + build/**/*.hpp + dependency_ws/ if-no-files-found: error - name: Test @@ -71,13 +76,17 @@ jobs: needs: [build-and-test-differential] if: ${{ needs.build-and-test-differential.result }} steps: - - name: Download compilation database + - name: Download static analysis resources id: download-compile-db uses: actions/download-artifact@v4 with: - name: compilation-database-diff-${{ github.sha }} + name: static-analysis-resources-${{ github.sha }} continue-on-error: true + - name: Check out repository + if: ${{ steps.download-compile-db.outcome == 'success' }} + uses: actions/checkout@v3 + - name: Install FB Infer id: fb-infer-install if: ${{ steps.download-compile-db.outcome == 'success' }} @@ -93,8 +102,7 @@ jobs: id: fb-infer-run if: ${{ steps.fb-infer-install.outcome == 'success' }} run: | - git diff --name-only ${{ github.head_ref }}..${{ github.base_ref }} > changed-files.txt - infer run --changed-files-index changed-files.txt --compilation-database ./compile_commands.json + infer run --compilation-database build/compile_commands.json - name: Upload FB Infer Report id: fb-infer-upload From e48ad760da211f988eb687ed3a9ef00e19b19a87 Mon Sep 17 00:00:00 2001 From: Max SCHMELLER Date: Wed, 4 Dec 2024 16:51:24 +0900 Subject: [PATCH 08/19] fix modified packages error Signed-off-by: Max SCHMELLER --- .github/workflows/build-and-test-differential.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/build-and-test-differential.yaml b/.github/workflows/build-and-test-differential.yaml index 2785839ae..665176298 100644 --- a/.github/workflows/build-and-test-differential.yaml +++ b/.github/workflows/build-and-test-differential.yaml @@ -19,6 +19,8 @@ jobs: steps: - name: Check out repository uses: actions/checkout@v3 + with: + fetch-depth: 0 - name: Remove exec_depend uses: autowarefoundation/autoware-github-actions/remove-exec-depend@v1 @@ -86,6 +88,8 @@ jobs: - name: Check out repository if: ${{ steps.download-compile-db.outcome == 'success' }} uses: actions/checkout@v3 + with: + fetch-depth: 0 - name: Install FB Infer id: fb-infer-install From cd82c4dd5400749a7d9cc3deaf7dd07762f9e23c Mon Sep 17 00:00:00 2001 From: Max SCHMELLER Date: Wed, 4 Dec 2024 18:34:17 +0900 Subject: [PATCH 09/19] temp Signed-off-by: Max SCHMELLER --- .github/workflows/build-and-test-differential.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/build-and-test-differential.yaml b/.github/workflows/build-and-test-differential.yaml index 665176298..4180ed706 100644 --- a/.github/workflows/build-and-test-differential.yaml +++ b/.github/workflows/build-and-test-differential.yaml @@ -102,6 +102,11 @@ jobs: sudo mv infer-linux-x86_64-v${VERSION} /usr/local/infer echo "PATH=/usr/local/infer/bin:$PATH" >> $GITHUB_ENV + - name: Debug log + run: | + pwd + ls -R + - name: Run FB Infer id: fb-infer-run if: ${{ steps.fb-infer-install.outcome == 'success' }} From 8bf4c5a7c72c50e1732da6d15e1f4a8406bc5e88 Mon Sep 17 00:00:00 2001 From: Max SCHMELLER Date: Wed, 4 Dec 2024 18:39:57 +0900 Subject: [PATCH 10/19] prevent deletion of downloaded artifact by checkout action Signed-off-by: Max SCHMELLER --- .github/workflows/build-and-test-differential.yaml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build-and-test-differential.yaml b/.github/workflows/build-and-test-differential.yaml index 4180ed706..a69d3a954 100644 --- a/.github/workflows/build-and-test-differential.yaml +++ b/.github/workflows/build-and-test-differential.yaml @@ -78,6 +78,11 @@ jobs: needs: [build-and-test-differential] if: ${{ needs.build-and-test-differential.result }} steps: + - name: Check out repository + uses: actions/checkout@v3 + with: + fetch-depth: 0 + - name: Download static analysis resources id: download-compile-db uses: actions/download-artifact@v4 @@ -85,12 +90,6 @@ jobs: name: static-analysis-resources-${{ github.sha }} continue-on-error: true - - name: Check out repository - if: ${{ steps.download-compile-db.outcome == 'success' }} - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Install FB Infer id: fb-infer-install if: ${{ steps.download-compile-db.outcome == 'success' }} From c5fc38361671e58287bac277621859f9be80efc1 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 4 Dec 2024 09:42:35 +0000 Subject: [PATCH 11/19] ci(pre-commit): autofix --- .github/workflows/build-and-test-differential.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-and-test-differential.yaml b/.github/workflows/build-and-test-differential.yaml index a69d3a954..69191cb75 100644 --- a/.github/workflows/build-and-test-differential.yaml +++ b/.github/workflows/build-and-test-differential.yaml @@ -82,7 +82,7 @@ jobs: uses: actions/checkout@v3 with: fetch-depth: 0 - + - name: Download static analysis resources id: download-compile-db uses: actions/download-artifact@v4 From a057a93e811b17cba2a06b8d301bc1ce623b8b22 Mon Sep 17 00:00:00 2001 From: Max SCHMELLER Date: Wed, 4 Dec 2024 19:01:00 +0900 Subject: [PATCH 12/19] run in ros container Signed-off-by: Max SCHMELLER --- .github/workflows/build-and-test-differential.yaml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.github/workflows/build-and-test-differential.yaml b/.github/workflows/build-and-test-differential.yaml index a69d3a954..0a690d562 100644 --- a/.github/workflows/build-and-test-differential.yaml +++ b/.github/workflows/build-and-test-differential.yaml @@ -77,6 +77,16 @@ jobs: runs-on: ubuntu-latest needs: [build-and-test-differential] if: ${{ needs.build-and-test-differential.result }} + container: ${{ matrix.container }} + strategy: + fail-fast: false + matrix: + rosdistro: + - humble + include: + - rosdistro: humble + container: ros:humble + build-depends-repos: build_depends.repos steps: - name: Check out repository uses: actions/checkout@v3 From 8d20c292513af1b3572ea84bf387d52f79c42903 Mon Sep 17 00:00:00 2001 From: Max SCHMELLER Date: Wed, 4 Dec 2024 19:18:29 +0900 Subject: [PATCH 13/19] use curl Signed-off-by: Max SCHMELLER --- .github/workflows/build-and-test-differential.yaml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-and-test-differential.yaml b/.github/workflows/build-and-test-differential.yaml index f5db28d49..93a7d6fd0 100644 --- a/.github/workflows/build-and-test-differential.yaml +++ b/.github/workflows/build-and-test-differential.yaml @@ -106,9 +106,12 @@ jobs: env: VERSION: 1.2.0 run: | - wget https://github.com/facebook/infer/releases/download/v${VERSION}/infer-linux-x86_64-v${VERSION}.tar.xz - tar -xvf infer-linux-x86_64-v${VERSION}.tar.xz - sudo mv infer-linux-x86_64-v${VERSION} /usr/local/infer + export BASENAME="infer-linux-x86_64-v${VERSION}" + export FILENAME="${BASENAME}.tar.xz" + curl -sSLO "https://github.com/facebook/infer/releases/download/v${VERSION}/${FILENAME}" + tar -xf "$FILENAME" + rm "$FILENAME" + sudo mv "$BASENAME" /usr/local/infer echo "PATH=/usr/local/infer/bin:$PATH" >> $GITHUB_ENV - name: Debug log From a437b4ffc4190158f3f59789acbef554cce24732 Mon Sep 17 00:00:00 2001 From: Max SCHMELLER Date: Wed, 4 Dec 2024 19:37:17 +0900 Subject: [PATCH 14/19] curl Signed-off-by: Max SCHMELLER --- .github/workflows/build-and-test-differential.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build-and-test-differential.yaml b/.github/workflows/build-and-test-differential.yaml index 93a7d6fd0..0284c306a 100644 --- a/.github/workflows/build-and-test-differential.yaml +++ b/.github/workflows/build-and-test-differential.yaml @@ -108,6 +108,7 @@ jobs: run: | export BASENAME="infer-linux-x86_64-v${VERSION}" export FILENAME="${BASENAME}.tar.xz" + sudo apt install curl curl -sSLO "https://github.com/facebook/infer/releases/download/v${VERSION}/${FILENAME}" tar -xf "$FILENAME" rm "$FILENAME" From aa4a8ba789f63a908ebe911278e5aaa5498c3550 Mon Sep 17 00:00:00 2001 From: Max SCHMELLER Date: Wed, 4 Dec 2024 19:49:41 +0900 Subject: [PATCH 15/19] apt-install Signed-off-by: Max SCHMELLER --- .github/workflows/build-and-test-differential.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-and-test-differential.yaml b/.github/workflows/build-and-test-differential.yaml index 0284c306a..6c1ca58ae 100644 --- a/.github/workflows/build-and-test-differential.yaml +++ b/.github/workflows/build-and-test-differential.yaml @@ -108,7 +108,7 @@ jobs: run: | export BASENAME="infer-linux-x86_64-v${VERSION}" export FILENAME="${BASENAME}.tar.xz" - sudo apt install curl + sudo apt-get update && sudo apt-get install curl tar curl -sSLO "https://github.com/facebook/infer/releases/download/v${VERSION}/${FILENAME}" tar -xf "$FILENAME" rm "$FILENAME" From 0f03551ec80217c642e51f24c33544b87e73b55d Mon Sep 17 00:00:00 2001 From: Max SCHMELLER Date: Wed, 4 Dec 2024 20:44:33 +0900 Subject: [PATCH 16/19] use clang and compile from scratch for infer Signed-off-by: Max SCHMELLER --- .../build-and-test-differential.yaml | 55 ++++++++++--------- 1 file changed, 29 insertions(+), 26 deletions(-) diff --git a/.github/workflows/build-and-test-differential.yaml b/.github/workflows/build-and-test-differential.yaml index 6c1ca58ae..497cb9e0d 100644 --- a/.github/workflows/build-and-test-differential.yaml +++ b/.github/workflows/build-and-test-differential.yaml @@ -38,22 +38,6 @@ jobs: target-packages: ${{ steps.get-modified-packages.outputs.modified-packages }} build-depends-repos: ${{ matrix.build-depends-repos }} - - name: Upload build artifacts for static analysis - if: ${{ steps.build.outcome == 'success' }} - uses: actions/upload-artifact@v4 - with: - name: static-analysis-resources-${{ github.sha }} - path: | - build/compile_commands.json - build/**/*.c - build/**/*.cc - build/**/*.cpp - build/**/*.h - build/**/*.hh - build/**/*.hpp - dependency_ws/ - if-no-files-found: error - - name: Test id: test if: ${{ steps.build.outcome == 'success' }} @@ -76,7 +60,6 @@ jobs: fb-infer-differential: runs-on: ubuntu-latest needs: [build-and-test-differential] - if: ${{ needs.build-and-test-differential.result }} container: ${{ matrix.container }} strategy: fail-fast: false @@ -93,28 +76,48 @@ jobs: with: fetch-depth: 0 - - name: Download static analysis resources - id: download-compile-db - uses: actions/download-artifact@v4 - with: - name: static-analysis-resources-${{ github.sha }} - continue-on-error: true + - name: Remove exec_depend + uses: autowarefoundation/autoware-github-actions/remove-exec-depend@v1 + + - name: Get modified packages + id: get-modified-packages + uses: autowarefoundation/autoware-github-actions/get-modified-packages@v1 + + - name: Install Clang-15 + run: | + sudo apt-get update + sudo apt-get install --install-recommends clang-15 clang-tidy-15 clangd-15 + sudo apt-get install clang-15-doc wasi-libc llvm-15-doc + sudo apt-get install libomp-15-dev libomp-15-doc # For OpenMP support in Clang + sudo apt install libstdc++-12-dev + echo "CC=/usr/bin/clang-15" >> $GITHUB_ENV + echo "CXX=/usr/bin/clang++-15" >> $GITHUB_ENV + - name: Install FB Infer id: fb-infer-install - if: ${{ steps.download-compile-db.outcome == 'success' }} + if: ${{ steps.get-modified-packages.outputs.modified-packages != '' }} env: VERSION: 1.2.0 run: | export BASENAME="infer-linux-x86_64-v${VERSION}" export FILENAME="${BASENAME}.tar.xz" - sudo apt-get update && sudo apt-get install curl tar + sudo apt-get install curl tar curl -sSLO "https://github.com/facebook/infer/releases/download/v${VERSION}/${FILENAME}" tar -xf "$FILENAME" rm "$FILENAME" sudo mv "$BASENAME" /usr/local/infer echo "PATH=/usr/local/infer/bin:$PATH" >> $GITHUB_ENV + - name: Build + id: build + if: ${{ steps.get-modified-packages.outputs.modified-packages != '' }} + uses: autowarefoundation/autoware-github-actions/colcon-build@v1 + with: + rosdistro: ${{ matrix.rosdistro }} + target-packages: ${{ steps.get-modified-packages.outputs.modified-packages }} + build-depends-repos: ${{ matrix.build-depends-repos }} + - name: Debug log run: | pwd @@ -122,7 +125,7 @@ jobs: - name: Run FB Infer id: fb-infer-run - if: ${{ steps.fb-infer-install.outcome == 'success' }} + if: ${{ steps.build.outcome == 'success' }} run: | infer run --compilation-database build/compile_commands.json From 38246e4a45cf6f2199d8b8dc1d4eb8c1779cc8da Mon Sep 17 00:00:00 2001 From: Max SCHMELLER Date: Wed, 4 Dec 2024 20:46:33 +0900 Subject: [PATCH 17/19] make jobs run in parallel Signed-off-by: Max SCHMELLER --- .github/workflows/build-and-test-differential.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/build-and-test-differential.yaml b/.github/workflows/build-and-test-differential.yaml index 497cb9e0d..c776a3165 100644 --- a/.github/workflows/build-and-test-differential.yaml +++ b/.github/workflows/build-and-test-differential.yaml @@ -59,7 +59,6 @@ jobs: fb-infer-differential: runs-on: ubuntu-latest - needs: [build-and-test-differential] container: ${{ matrix.container }} strategy: fail-fast: false From 515b0407af67c9ffbc416055b4cf0ce297ec0349 Mon Sep 17 00:00:00 2001 From: Max SCHMELLER Date: Wed, 4 Dec 2024 20:58:57 +0900 Subject: [PATCH 18/19] quiet accept for apt-get Signed-off-by: Max SCHMELLER --- .github/workflows/build-and-test-differential.yaml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build-and-test-differential.yaml b/.github/workflows/build-and-test-differential.yaml index c776a3165..1ccc6c8e8 100644 --- a/.github/workflows/build-and-test-differential.yaml +++ b/.github/workflows/build-and-test-differential.yaml @@ -84,11 +84,11 @@ jobs: - name: Install Clang-15 run: | - sudo apt-get update - sudo apt-get install --install-recommends clang-15 clang-tidy-15 clangd-15 - sudo apt-get install clang-15-doc wasi-libc llvm-15-doc - sudo apt-get install libomp-15-dev libomp-15-doc # For OpenMP support in Clang - sudo apt install libstdc++-12-dev + sudo apt-get -y -q update + sudo apt-get -y -q install --install-recommends clang-15 clang-tidy-15 clangd-15 + sudo apt-get -y -q install clang-15-doc wasi-libc llvm-15-doc + sudo apt-get -y -q install libomp-15-dev libomp-15-doc # For OpenMP support in Clang + sudo apt-get -y -q install libstdc++-12-dev echo "CC=/usr/bin/clang-15" >> $GITHUB_ENV echo "CXX=/usr/bin/clang++-15" >> $GITHUB_ENV @@ -101,7 +101,7 @@ jobs: run: | export BASENAME="infer-linux-x86_64-v${VERSION}" export FILENAME="${BASENAME}.tar.xz" - sudo apt-get install curl tar + sudo apt-get -y -q install curl tar curl -sSLO "https://github.com/facebook/infer/releases/download/v${VERSION}/${FILENAME}" tar -xf "$FILENAME" rm "$FILENAME" From 7c43d77f3c1b771ab4b13f3cdeeb16e41a5a9729 Mon Sep 17 00:00:00 2001 From: Max SCHMELLER Date: Wed, 4 Dec 2024 21:20:53 +0900 Subject: [PATCH 19/19] fix uploaded artifact name Signed-off-by: Max SCHMELLER --- .github/workflows/build-and-test-differential.yaml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build-and-test-differential.yaml b/.github/workflows/build-and-test-differential.yaml index 1ccc6c8e8..d2c9d92f9 100644 --- a/.github/workflows/build-and-test-differential.yaml +++ b/.github/workflows/build-and-test-differential.yaml @@ -84,11 +84,11 @@ jobs: - name: Install Clang-15 run: | - sudo apt-get -y -q update - sudo apt-get -y -q install --install-recommends clang-15 clang-tidy-15 clangd-15 - sudo apt-get -y -q install clang-15-doc wasi-libc llvm-15-doc - sudo apt-get -y -q install libomp-15-dev libomp-15-doc # For OpenMP support in Clang - sudo apt-get -y -q install libstdc++-12-dev + sudo apt-get -yqq update + sudo apt-get -yqq install --install-recommends clang-15 clang-tidy-15 clangd-15 + sudo apt-get -yqq install clang-15-doc wasi-libc llvm-15-doc + sudo apt-get -yqq install libomp-15-dev libomp-15-doc # For OpenMP support in Clang + sudo apt-get -yqq install libstdc++-12-dev echo "CC=/usr/bin/clang-15" >> $GITHUB_ENV echo "CXX=/usr/bin/clang++-15" >> $GITHUB_ENV @@ -101,7 +101,7 @@ jobs: run: | export BASENAME="infer-linux-x86_64-v${VERSION}" export FILENAME="${BASENAME}.tar.xz" - sudo apt-get -y -q install curl tar + sudo apt-get -yqq install curl tar curl -sSLO "https://github.com/facebook/infer/releases/download/v${VERSION}/${FILENAME}" tar -xf "$FILENAME" rm "$FILENAME" @@ -133,6 +133,6 @@ jobs: if: ${{ steps.fb-infer-run.outcome == 'success' }} uses: actions/upload-artifact@v4 with: - name: infer-report-diff-${{ github.head_ref }} + name: infer-report-diff-${{ github.sha }} path: infer-out/report.* if-no-files-found: error