diff options
author | Dario Lombardo <lomato@gmail.com> | 2021-12-27 22:55:48 +0100 |
---|---|---|
committer | Wireshark GitLab Utility <gerald+gitlab-utility@wireshark.org> | 2021-12-29 22:11:48 +0000 |
commit | 1abc6bd3b19d52f823070bf4b4ed42aa03e8768a (patch) | |
tree | 564f4a5977c69a9791733dd42cfb2429951ba3e4 /.gitlab-ci.yml | |
parent | 5e08fbef548a5ae6727b037c3f4e4c53cc5efc39 (diff) |
ci: run checks on all the commits in the current MR.
Fix: #16813.
Diffstat (limited to '.gitlab-ci.yml')
-rw-r--r-- | .gitlab-ci.yml | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 2d4ac4ec28..f251c87075 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -109,6 +109,8 @@ variables: - export DEB_BUILD_OPTIONS=nocheck,parallel=$(( $(getconf _NPROCESSORS_ONLN) + 2 )) - export DH_QUIET=1 - export MAKEFLAGS=--silent + - NUM_COMMITS=$(curl $CI_API_V4_URL/projects/$CI_PROJECT_ID/merge_requests/$CI_MERGE_REQUEST_IID/commits | jq length) + - echo "$NUM_COMMITS commit(s) in this MR" - mkdir build - cd build after_script: @@ -509,7 +511,7 @@ Commit Check: script: # build-ubuntu puts us in `build`. - cd .. - - bash ./tools/pre-commit 'HEAD^1' + - bash ./tools/pre-commit "HEAD^$NUM_COMMITS" - tools/validate-commit.py Ubuntu .dpkg: @@ -552,11 +554,11 @@ Code Checks + Clang Warnings: - cd .. - python3 tools/checklicenses.py - mkdir cppcheck - - ./tools/cppcheck/cppcheck.sh -l 1 | tee cppcheck/cppcheck_report.txt - - if [[ -s "cppcheck/cppcheck_report.txt" ]]; then ./tools/cppcheck/cppcheck.sh -l 1 -x > cppcheck/cppcheck_report.xml ; fi + - ./tools/cppcheck/cppcheck.sh -l $NUM_COMMITS | tee cppcheck/cppcheck_report.txt + - if [[ -s "cppcheck/cppcheck_report.txt" ]]; then ./tools/cppcheck/cppcheck.sh -l $NUM_COMMITS -x > cppcheck/cppcheck_report.xml ; fi - if [[ -s "cppcheck/cppcheck_report.txt" ]]; then cppcheck-htmlreport --file cppcheck/cppcheck_report.xml --report-dir cppcheck ; fi - - ./tools/check_typed_item_calls.py --commits 1 | tee item_calls_check.txt - - ./tools/check_tfs.py --commits 1 | tee tfs_check.txt + - ./tools/check_typed_item_calls.py --commits $NUM_COMMITS | tee item_calls_check.txt + - ./tools/check_tfs.py --commits $NUM_COMMITS | tee tfs_check.txt - cd build - printf "\e[0Ksection_start:%s:cmake_section[collapsed=true]\r\e[0KRunning CMake" "$( date +%s)" - cmake -DENABLE_EXTRA_COMPILER_WARNINGS=on -DENABLE_CHECKHF_CONFLICT=on -DCMAKE_EXPORT_COMPILE_COMMANDS=on -DENABLE_CCACHE=ON -G Ninja .. |