Fix truncation in horizonstrength calculation
[betaflight.git] / .travis.sh
blob3c2537079680d5614e03283dde99194c50833759
1 #!/bin/bash
2 REVISION=$(git rev-parse --short HEAD)
3 BRANCH=$(git rev-parse --abbrev-ref HEAD)
4 REVISION=$(git rev-parse --short HEAD)
5 LAST_COMMIT_DATE=$(git log -1 --date=short --format="%cd")
6 TARGET_FILE=obj/cleanflight_${TARGET}
8 # A hacky way of running the unit tests at the same time as the normal builds.
9 if [ $RUNTESTS ] ; then
10 cd ./src/test && make test
12 # A hacky way of running the unit tests at the same time as the normal builds.
13 elif [ $PUBLISHDOCS ] ; then
14 if [ $PUBLISH_URL ] ; then
16 sudo apt-get install zlib1g-dev libssl-dev wkhtmltopdf libxml2-dev libxslt-dev #ruby-rvm
17 rvmsudo gem install gimli
19 ./build_docs.sh
21 curl -k \
22 --form "manual=@docs/Manual.pdf" \
23 --form "revision=${REVISION}" \
24 --form "branch=${BRANCH}" \
25 --form "last_commit_date=${LAST_COMMIT_DATE}" \
26 --form "travis_build_number=${TRAVIS_BUILD_NUMBER}" \
27 ${PUBLISH_URL}
30 elif [ $PUBLISHMETA ] ; then
31 if [ $PUBLISH_URL ] ; then
32 RECENT_COMMITS=$(git shortlog -n25)
33 curl -k \
34 --form "recent_commits=${RECENT_COMMITS}" \
35 --form "revision=${REVISION}" \
36 --form "branch=${BRANCH}" \
37 --form "last_commit_date=${LAST_COMMIT_DATE}" \
38 --form "travis_build_number=${TRAVIS_BUILD_NUMBER}" \
39 ${PUBLISH_URL}
42 else
43 if [ $PUBLISH_URL ] ; then
44 make -j2
45 if [ -f ${TARGET_FILE}.bin ] ; then
46 TARGET_FILE=${TARGET_FILE}.bin
47 elif [ -f ${TARGET_FILE}.hex ] ; then
48 TARGET_FILE=${TARGET_FILE}.hex
49 else
50 echo "build artifact (hex or bin) for ${TARGET_FILE} not found, aborting";
51 exit 1
54 curl -k \
55 --form "file=@${TARGET_FILE}" \
56 --form "revision=${REVISION}" \
57 --form "branch=${BRANCH}" \
58 --form "last_commit_date=${LAST_COMMIT_DATE}" \
59 --form "travis_build_number=${TRAVIS_BUILD_NUMBER}" \
60 ${PUBLISH_URL}
61 else
62 make -j2