ci: Run D-Scanner on the sources

This commit is contained in:
Matthias Klumpp 2018-04-06 03:42:57 +02:00
parent 6c1c6147df
commit 393feb081a
4 changed files with 49 additions and 14 deletions

View File

@ -33,8 +33,17 @@ RUN apt-get install -yq --no-install-recommends \
libfontconfig1-dev \
libpango1.0-dev
# JavaScript stuff
# Misc
RUN apt-get install -yq --no-install-recommends curl gnupg
# Install dscanner
RUN mkdir -p /usr/local/bin/
RUN curl -L https://github.com/dlang-community/D-Scanner/releases/download/v0.5.1/dscanner-v0.5.1-linux-x86_64.tar.gz -o /tmp/dscanner.tar.gz
RUN tar -xzf /tmp/dscanner.tar.gz -C /usr/local/bin/
RUN rm /tmp/dscanner.tar.gz
RUN dscanner --version
# JavaScript stuff
RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -
RUN echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list
RUN apt-get update -qq

View File

@ -24,3 +24,10 @@ ninja test -v
# Test install
DESTDIR=/tmp/install-ninja ninja install
cd ..
#
# Other checks
#
# run D-Scanner
./tests/ci/run-dscanner.sh

32
tests/ci/run-dscanner.sh Executable file
View File

@ -0,0 +1,32 @@
#!/bin/sh
set +e
#
# This script is supposed to be used on the appstream-generator CI, and makes
# assumptions about the build environment.
# If you want to run dscanner locally, you will want to adapt this script.
# (at some point in future, we need DScanner to be run by a Meson module)
#
echo "==========================="
echo "= D-Scanner ="
echo "==========================="
dscanner --styleCheck src/ \
--config tests/dscanner.ini \
-I ./build/girepo \
-I /usr/lib/ldc/x86_64-linux-gnu/include/d/ \
-I ./src/ \
-I /usr/lib/ldc/x86_64-linux-gnu/include/d/ldc/ \
-I ./build/src/ \
-I ./contrib/subprojects/dcontainers/src/ \
-I ./contrib/subprojects/stdx-allocator/source/ \
-I /usr/include/d/mustache-d/
if [ $? -eq 0 ]; then
printf '\e[0;32m:) Success \033[0m\n'
exit 0
else
printf '\e[0;31m:( D-Scanner found issues \033[0m\n'
exit 1
fi

View File

@ -1,13 +0,0 @@
#!/bin/sh
set -e
dscanner --styleCheck src/ \
--config test/dscanner.ini \
-I ./build/girepo \
-I /usr/lib/ldc/x86_64-linux-gnu/include/d/ \
-I ./src/ \
-I /usr/lib/ldc/x86_64-linux-gnu/include/d/ldc/ \
-I ./build/src/ \
-I ./contrib/subprojects/dcontainers/src/ \
-I ./contrib/subprojects/stdx-allocator/source/ \
-I /usr/include/d/mustache-d/