Install ci-tools and get tokstyle via the script it provides.

This commit is contained in:
iphydf 2020-04-08 15:06:40 +00:00
parent da2c4191b4
commit 2538905e4f
No known key found for this signature in database
GPG Key ID: 3855DBA2D74403C9
2 changed files with 10 additions and 18 deletions

View File

@ -1,4 +1,4 @@
#!/bin/sh #!/bin/bash
ACTION="$1" ACTION="$1"
@ -8,22 +8,11 @@ CACHEDIR="$HOME/cache"
NPROC=`nproc` NPROC=`nproc`
ASTYLE="$CACHEDIR/astyle/build/gcc/bin/astyle" ASTYLE="$CACHEDIR/astyle/build/gcc/bin/astyle"
ASTYLE_VERSION=3.1 ASTYLE_VERSION=3.1
TRAVIS_TOOL="https://raw.githubusercontent.com/TokTok/ci-tools/master/bin/travis-haskell"
install_tool() {
SLUG="$1"
TOOL="$2"
TARGET="$3"
VERSION=$(curl -L -s -H 'Accept: application/json' \
"https://github.com/$SLUG/releases/latest" \
| egrep -o '"v[0-9][^"]+"' \
| egrep -o '[^"]+')
URL="https://github.com/$SLUG/releases/download/$VERSION/$TOOL-x86_64-linux-$VERSION.tar.gz"
curl -L -s "$URL" | tar xzv -C "$TARGET"
}
travis_install() { travis_install() {
install_tool TokTok/hs-tokstyle tokstyle "$HOME/.local" bash <(curl -s "$TRAVIS_TOOL") download
travis-haskell download TokTok/hs-tokstyle tokstyle "$HOME/.local"
which coveralls || { which coveralls || {
# Install cpp-coveralls to upload test coverage results. # Install cpp-coveralls to upload test coverage results.
@ -48,7 +37,7 @@ run_static_analysis() {
pylint -E other/analysis/check_recursion pylint -E other/analysis/check_recursion
export CPPFLAGS="-isystem $CACHEDIR/include" export CPPFLAGS="-isystem $CACHEDIR/include"
export LDFLAGS="-L $CACHEDIR/lib" export LDFLAGS="-L$CACHEDIR/lib"
cat toxav/*.c toxcore/*.c toxencryptsave/*.c \ cat toxav/*.c toxcore/*.c toxencryptsave/*.c \
| clang `pkg-config --cflags libsodium opus vpx` \ | clang `pkg-config --cflags libsodium opus vpx` \
-Itoxav -Itoxcore -Itoxencryptsave -S -emit-llvm -xc - -o- \ -Itoxav -Itoxcore -Itoxencryptsave -S -emit-llvm -xc - -o- \

View File

@ -35,10 +35,10 @@ FROM_JSON='s/\\"/"/g;s/^"(.*)"$/$1/;s/\\\\/\\/g;s/\\n/\n/g'
apidsl_request() { apidsl_request() {
TMPFILE=$(mktemp /tmp/apidsl.XXXXXX) TMPFILE=$(mktemp /tmp/apidsl.XXXXXX)
curl -o "$TMPFILE" -X POST --data @<( curl -s -o "$TMPFILE" -X POST --data @<(
echo '["Request",'; echo '["Request",';
cat $2; cat $2;
echo ']') https://apidsl2.herokuapp.com/$1 echo ']') https://apidsl.herokuapp.com/$1
if grep '\[1,"' "$TMPFILE" > /dev/null; then if grep '\[1,"' "$TMPFILE" > /dev/null; then
echo "Error: $(grep -o '".*"' /tmp/apidsl-$$ | perl -0777 -pe "$FROM_JSON")" >&2 echo "Error: $(grep -o '".*"' /tmp/apidsl-$$ | perl -0777 -pe "$FROM_JSON")" >&2
rm "$TMPFILE" rm "$TMPFILE"
@ -49,12 +49,14 @@ apidsl_request() {
} }
apidsl_curl() { apidsl_curl() {
echo "apidsl_curl $@" >&2
apidsl_request "c" <( apidsl_request "c" <(
apidsl_request "parse" <( apidsl_request "parse" <(
perl -0777 -pe "$TO_JSON" $1)) | perl -0777 -pe "$FROM_JSON" perl -0777 -pe "$TO_JSON" $1)) | perl -0777 -pe "$FROM_JSON"
} }
# Check if apidsl generated sources are up to date. # Check if apidsl generated sources are up to date.
set +x
$APIDSL toxcore/LAN_discovery.api.h > toxcore/LAN_discovery.h & $APIDSL toxcore/LAN_discovery.api.h > toxcore/LAN_discovery.h &
$APIDSL toxcore/crypto_core.api.h > toxcore/crypto_core.h & $APIDSL toxcore/crypto_core.api.h > toxcore/crypto_core.h &
$APIDSL toxcore/ping.api.h > toxcore/ping.h & $APIDSL toxcore/ping.api.h > toxcore/ping.h &
@ -62,6 +64,7 @@ $APIDSL toxcore/ping_array.api.h > toxcore/ping_array.h &
$APIDSL toxcore/tox.api.h > toxcore/tox.h & $APIDSL toxcore/tox.api.h > toxcore/tox.h &
$APIDSL toxav/toxav.api.h > toxav/toxav.h & $APIDSL toxav/toxav.api.h > toxav/toxav.h &
$APIDSL toxencryptsave/toxencryptsave.api.h > toxencryptsave/toxencryptsave.h & $APIDSL toxencryptsave/toxencryptsave.api.h > toxencryptsave/toxencryptsave.h &
set -x
wait; wait; wait; wait; wait; wait; wait wait; wait; wait; wait; wait; wait; wait