Files
unison/utils/tests/gitlab-ci-code-linting.yml
2022-12-03 15:48:33 +00:00

61 lines
1.5 KiB
YAML

# ns-3 CI/CD script with the code-linting stage
#
# Contains jobs to check the ns-3 coding style and perform lint checking.
check-style-clang-format:
stage: code-linting
image: ubuntu:latest
before_script:
- apt update
- DEBIAN_FRONTEND=noninteractive apt install -y
python3
clang-format-14
script:
- python3 utils/check-style-clang-format.py .
timeout: 3h
clang-tidy:
stage: code-linting
image: ubuntu:latest
before_script:
- apt update
- DEBIAN_FRONTEND=noninteractive apt install -y
clang cmake
clang-tidy-14
python3 python3-pip
libboost-all-dev
libgtk-3-dev
gsl-bin libgsl-dev libgsl27
libopenmpi-dev
libsqlite3-dev
ssh
- pip3 install cppyy
script:
- ./ns3 configure -d debug
--enable-clang-tidy
--enable-examples --enable-tests
--enable-asserts
--enable-mpi
--enable-python-bindings
- run-clang-tidy-14 -p cmake-cache/ -quiet
1> clang-tidy-errors.log
2> /dev/null
- (! egrep -A 3 "error:|warning:|note:" clang-tidy-errors.log)
- echo "No clang-tidy errors found"
variables:
MPI_CI: 1
artifacts:
paths:
- clang-tidy-errors.log
when: on_failure
timeout: 3h
emacs-line:
stage: code-linting
image: ubuntu:latest
script:
- (! grep -rn --include="*.h" --include="*.cc" "c-file-style:\"gnu\"" ) ||
(echo "Found Emacs lines on the above C++ files" && exit 1)
- echo "No Emacs lines found on C++ files"
timeout: 1h