diff --git a/ceph-pr-clang-tidy/build/build b/ceph-pr-clang-tidy/build/build index 5542a519f..13c76358e 100644 --- a/ceph-pr-clang-tidy/build/build +++ b/ceph-pr-clang-tidy/build/build @@ -13,23 +13,26 @@ sudo apt-get install -y clang-tidy sudo apt-get install -y parallel -build_debs ${VENV} ${vers} ${debian_version} - output_file="clang-tidy-result" file_list="files_to_check.txt" +# The file `ceph_build.tar.gz` is copied from the job `ceph-pull-request` using copy_artifacts +tar -xzf ceph_build.tar.gz -C "$WORKSPACE" + +rm ceph_build.tar.gz + # Store the list of files from both rgw and osd directories -find "$WORKSPACE/src/rgw" \( -name '*.cpp' -o -name '*.hpp' -o -name '*.cc' \) > "$file_list" -find "$WORKSPACE/src/osd" \( -name '*.cpp' -o -name '*.hpp' -o -name '*.cc' \) >> "$file_list" +find "$WORKSPACE/ceph/src/rgw" \( -name '*.cpp' -o -name '*.hpp' -o -name '*.cc' \) > "$file_list" +find "$WORKSPACE/ceph/src/osd" \( -name '*.cpp' -o -name '*.hpp' -o -name '*.cc' \) >> "$file_list" # Run clang-tidy and save output { echo "Files being checked:" cat "$file_list" echo - parallel -m clang-tidy -checks="-*,bugprone-use-after-move" -p "$WORKSPACE/build" {} < "$file_list" -} | tee "$WORKSPACE/build/$output_file" + parallel -m clang-tidy -checks="-*,bugprone-use-after-move" -p "$WORKSPACE/ceph/build" {} < "$file_list" +} | tee "$WORKSPACE/ceph/build/$output_file" sudo chmod +x clang-tidy-to-junit.py -clang-tidy-to-junit.py $WORKSPACE/src < "$WORKSPACE/build/$output_file" > "$WORKSPACE/report.xml" \ No newline at end of file +clang-tidy-to-junit.py $WORKSPACE/ceph/src < "$WORKSPACE/ceph/build/$output_file" > "$WORKSPACE/report.xml" \ No newline at end of file diff --git a/ceph-pr-clang-tidy/config/definitions/ceph-pr-clang-tidy.yml b/ceph-pr-clang-tidy/config/definitions/ceph-pr-clang-tidy.yml index 448244439..e9458bf2f 100644 --- a/ceph-pr-clang-tidy/config/definitions/ceph-pr-clang-tidy.yml +++ b/ceph-pr-clang-tidy/config/definitions/ceph-pr-clang-tidy.yml @@ -13,44 +13,29 @@ - build-discarder: days-to-keep: 15 artifact-days-to-keep: 15 - - github: - url: https://github.com/ceph/ceph/ - - scm: - - git: - url: https://github.com/ceph/ceph.git - name: origin - branches: - - origin/pr/${ghprbPullId}/merge - refspec: +refs/pull/${ghprbPullId}/*:refs/remotes/origin/pr/${ghprbPullId}/* - skip-tag: true - shallow-clone: true - honor-refspec: true - timeout: 20 triggers: - github-pull-request: allow-whitelist-orgs-as-admins: true org-list: - ceph - trigger-phrase: 'jenkins test clang-tidy' only-trigger-phrase: false - github-hooks: true - permit-all: true - auto-close-on-fail: false status-context: "Clang-tidy lint check" started-status: "checking if bugs exist" success-status: "no bugs found" failure-status: "bugs found" builders: + - copyartifact: + project: ceph-pull-requests + - shell: !include-raw: - ../../../scripts/build_utils.sh - ../../build/build - ../../build/clang-tidy-to-junit.py - publishers: + - junit: results: report.xml allow-empty-results: true