Skip to content

Commit

Permalink
configured to work with copy_artifacts plugin
Browse files Browse the repository at this point in the history
Instead of building Ceph, existing `build` would be copied from the job `ceph-pull-requests` (make-check) to save resources on building Ceph.

Signed-off-by: Suyash Dongre <[email protected]>
  • Loading branch information
Suyashd999 committed Aug 24, 2024
1 parent 5e54b91 commit 5b6158d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 26 deletions.
17 changes: 10 additions & 7 deletions ceph-pr-clang-tidy/build/build
Original file line number Diff line number Diff line change
Expand Up @@ -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"
clang-tidy-to-junit.py $WORKSPACE/ceph/src < "$WORKSPACE/ceph/build/$output_file" > "$WORKSPACE/report.xml"
23 changes: 4 additions & 19 deletions ceph-pr-clang-tidy/config/definitions/ceph-pr-clang-tidy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 5b6158d

Please sign in to comment.