From 91cf9b5bb9c23bf011f17764a3af0a99702f5d52 Mon Sep 17 00:00:00 2001 From: Andrea Terzolo Date: Fri, 16 Dec 2022 18:44:23 +0100 Subject: [PATCH 1/2] cleanup(ci): move static analysis from circle CI to GHA Signed-off-by: Andrea Terzolo --- .circleci/config.yml | 30 -------------------------- .github/workflows/staticanalysis.yaml | 31 +++++++++++++++++++++++++++ 2 files changed, 31 insertions(+), 30 deletions(-) create mode 100644 .github/workflows/staticanalysis.yaml diff --git a/.circleci/config.yml b/.circleci/config.yml index c4ab4e6d134..3cafb4c8470 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -195,35 +195,6 @@ jobs: name: Execute driver-loader integration tests command: /tmp/ws/source/falco/test/driver-loader/run_test.sh /tmp/ws/build/release/ - # Code quality - "quality-static-analysis": - machine: - enabled: true - image: ubuntu-2204:2022.10.2 - steps: - - - run: - name: Install deps ⛓️ - command: | - sudo apt update -y - sudo apt install build-essential git cppcheck cmake -y - - - checkout: - path: /tmp/source/falco - - # We can use `USE_BUNDLED_DEPS=On` since the build is very fast - - run: - name: Build and run cppcheck - command: | - mkdir -p /tmp/source/falco/build - cd /tmp/source/falco/build && cmake -DUSE_BUNDLED_DEPS=On -DBUILD_WARNINGS_AS_ERRORS=ON -DCREATE_TEST_TARGETS=Off -DCMAKE_BUILD_TYPE="release" -DBUILD_BPF=Off -DBUILD_DRIVER=Off .. - make -j4 cppcheck - make -j4 cppcheck_htmlreport - - - store_artifacts: - path: /tmp/source/falco/build/static-analysis-reports - destination: /static-analysis-reports - # Sign rpm packages "rpm-sign": docker: @@ -758,7 +729,6 @@ workflows: - "build-musl" - "build-arm64" - "build-centos7" - - "quality-static-analysis" - "tests-integration": requires: - "build-centos7" diff --git a/.github/workflows/staticanalysis.yaml b/.github/workflows/staticanalysis.yaml new file mode 100644 index 00000000000..bb974d18ea1 --- /dev/null +++ b/.github/workflows/staticanalysis.yaml @@ -0,0 +1,31 @@ +name: StaticAnalysis +on: + pull_request: +jobs: + staticanalysis: + runs-on: ubuntu-22.04 + + steps: + - name: Checkout ⤵️ + uses: actions/checkout@v3 + with: + fetch-depth: 0 + ref: ${{ github.event.pull_request.head.sha }} + + - name: Install build dependencies ⛓️ + run: | + sudo apt update -y + sudo apt install build-essential git cppcheck cmake -y + + - name: Build and run cppcheck 🏎️ + run: | + mkdir build + cd build && cmake -DUSE_BUNDLED_DEPS=On -DBUILD_WARNINGS_AS_ERRORS=ON -DCREATE_TEST_TARGETS=Off -DCMAKE_BUILD_TYPE="release" -DBUILD_BPF=Off -DBUILD_DRIVER=Off .. + make -j4 cppcheck + make -j4 cppcheck_htmlreport + + - name: Upload bpf_test ⬆️ + uses: actions/upload-artifact@v3 + with: + name: static-analysis-reports + path: ./build/static-analysis-reports From fbd9551c95969c99458015c21af9a416ac902263 Mon Sep 17 00:00:00 2001 From: Andrea Terzolo Date: Fri, 16 Dec 2022 18:56:43 +0100 Subject: [PATCH 2/2] fix: job step name Signed-off-by: Andrea Terzolo Co-authored-by: Federico Di Pierro --- .github/workflows/staticanalysis.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/staticanalysis.yaml b/.github/workflows/staticanalysis.yaml index bb974d18ea1..46346e40e99 100644 --- a/.github/workflows/staticanalysis.yaml +++ b/.github/workflows/staticanalysis.yaml @@ -24,7 +24,7 @@ jobs: make -j4 cppcheck make -j4 cppcheck_htmlreport - - name: Upload bpf_test ⬆️ + - name: Upload reports ⬆️ uses: actions/upload-artifact@v3 with: name: static-analysis-reports