mirror of
https://github.com/qTox/qTox.git
synced 2024-03-22 14:00:36 +08:00
feat(CI): Run clang-tidy check in CI
This commit is contained in:
parent
73aa1f3f48
commit
c828a16b7b
@ -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
|
||||
|
16
.github/workflows/build-test-deploy.yaml
vendored
16
.github/workflows/build-test-deploy.yaml
vendored
@ -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
|
||||
|
@ -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 \
|
||||
|
Loading…
x
Reference in New Issue
Block a user