feat(CI): Run clang-tidy check in CI

reviewable/pr6571/r8
Anthony Bilinski 2022-03-15 06:11:57 -07:00
parent 73aa1f3f48
commit c828a16b7b
No known key found for this signature in database
GPG Key ID: 2AA8E0DA1B31FB3C
3 changed files with 37 additions and 1 deletions

View File

@ -28,6 +28,7 @@ while (( $# > 0 )); do
--minimal) MINIMAL=1 ; shift ;;
--full) MINIMAL=0; shift ;;
--sanitize) SANITIZE=1; shift ;;
--tidy) TIDY=1; shift;;
--build-type) BUILD_TYPE=$2; shift 2 ;;
--help|-h) usage; exit 1 ;;
*) echo "Unexpected argument $1"; usage; exit 1 ;;
@ -51,6 +52,15 @@ if [ ! -z ${SANITIZE+x} ]; then
SANITIZE_ARGS="-DASAN=ON"
fi
if [ ! -z ${TIDY+x} ]; then
export CXX=clang++
export CC=clang
COMPILE_COMMANDS="-DCMAKE_EXPORT_COMPILE_COMMANDS=ON"
else
COMPILE_COMMANDS=""
fi
SRCDIR=/qtox
export CTEST_OUTPUT_ON_FAILURE=1
@ -60,6 +70,7 @@ if [ $MINIMAL -eq 1 ]; then
-DSMILEYS=DISABLED \
-DSTRICT_OPTIONS=ON \
-DSPELL_CHECK=OFF \
${COMPILE_COMMANDS} \
$SANITIZE_ARGS
else
cmake "$SRCDIR" \
@ -68,8 +79,15 @@ else
-DSTRICT_OPTIONS=ON \
-DCODE_COVERAGE=ON \
-DDESKTOP_NOTIFICATIONS=ON \
${COMPILE_COMMANDS} \
$SANITIZE_ARGS
fi
cmake --build . -- -j $(nproc)
ctest -j$(nproc)
if [ ! -z ${TIDY+x} ]; then
run-clang-tidy -header-filter=.* src/ audio/src/ audio/include test/src/ \
test/include util/src/ util/include/
else
ctest -j$(nproc)
fi

View File

@ -124,6 +124,22 @@ jobs:
docker_image_name: fedora
- name: Run build
run: docker-compose run --rm fedora ./.ci-scripts/build-qtox-linux.sh --build-type ${{ matrix.build_type }} --${{ matrix.features }} --sanitize
clang-tidy:
name: Clang-Tidy
runs-on: ubuntu-latest
needs: build-fedora-docker
strategy:
matrix:
features: [full, minimal]
build_type: [Debug, Release]
steps:
- uses: actions/checkout@v2
- uses: ./.github/actions/load-docker-image
name: Load docker image
with:
docker_image_name: fedora
- name: Run build
run: docker-compose run --rm fedora ./.ci-scripts/build-qtox-linux.sh --build-type ${{ matrix.build_type }} --${{ matrix.features }} --tidy
build-opensuse:
name: Opensuse
runs-on: ubuntu-latest

View File

@ -20,6 +20,8 @@ RUN dnf --nodocs -y install dnf-plugins-core && \
dnf --nodocs -y install \
cmake \
make \
clang \
clang-tools-extra \
gcc \
gcc-c++ \
git \