mirror of
https://github.com/eledio-devices/thirdparty-littlefs.git
synced 2025-11-01 00:38:29 +01:00
Fixed multiple deploy steps in Travis
This commit is contained in:
121
.travis.yml
121
.travis.yml
@@ -24,7 +24,7 @@ script:
|
|||||||
|
|
||||||
- make clean test QUIET=1 CFLAGS+="-DLFS_NO_INTRINSICS"
|
- make clean test QUIET=1 CFLAGS+="-DLFS_NO_INTRINSICS"
|
||||||
|
|
||||||
# compile and find the code size with the smalles configuration
|
# compile and find the code size with the smallest configuration
|
||||||
- make clean size
|
- make clean size
|
||||||
OBJ="$(ls lfs*.o | tr '\n' ' ')"
|
OBJ="$(ls lfs*.o | tr '\n' ' ')"
|
||||||
CFLAGS+="-DLFS_NO{ASSERT,DEBUG,WARN,ERROR}"
|
CFLAGS+="-DLFS_NO{ASSERT,DEBUG,WARN,ERROR}"
|
||||||
@@ -35,12 +35,13 @@ script:
|
|||||||
if [ "$TRAVIS_TEST_RESULT" -eq 0 ]
|
if [ "$TRAVIS_TEST_RESULT" -eq 0 ]
|
||||||
then
|
then
|
||||||
CURR=$(tail -n1 sizes | awk '{print $1}')
|
CURR=$(tail -n1 sizes | awk '{print $1}')
|
||||||
STATUS="Passed, code size is ${CURR}B"
|
|
||||||
|
|
||||||
PREV=$(curl https://api.github.com/repos/$TRAVIS_REPO_SLUG/status/master \
|
PREV=$(curl https://api.github.com/repos/$TRAVIS_REPO_SLUG/status/master \
|
||||||
| jq -r ".statuses[] | select(.context == \"ci/$NAME\").description" \
|
| jq -re "select(.sha != \"$TRAVIS_COMMIT\")
|
||||||
| sed 's/.*code size is \([0-9]*\).*/\1/' \
|
| .statuses[] | select(.context == \"$STAGE/$NAME\").description
|
||||||
|
| capture(\"code size is (?<size>[0-9]+)\").size" \
|
||||||
|| echo 0)
|
|| echo 0)
|
||||||
|
|
||||||
|
STATUS="Passed, code size is ${CURR}B"
|
||||||
if [ "$PREV" -ne 0 ]
|
if [ "$PREV" -ne 0 ]
|
||||||
then
|
then
|
||||||
STATUS="$STATUS ($(python -c "print '%+.2f' % (100*($CURR-$PREV)/$PREV.0)")%)"
|
STATUS="$STATUS ($(python -c "print '%+.2f' % (100*($CURR-$PREV)/$PREV.0)")%)"
|
||||||
@@ -48,14 +49,18 @@ script:
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# CI matrix
|
# CI matrix
|
||||||
matrix:
|
jobs:
|
||||||
include:
|
include:
|
||||||
# native testing
|
# native testing
|
||||||
- env:
|
- stage: test
|
||||||
|
env:
|
||||||
|
- STAGE=test
|
||||||
- NAME=littlefs-x86
|
- NAME=littlefs-x86
|
||||||
|
|
||||||
# cross-compile with ARM (thumb mode)
|
# cross-compile with ARM (thumb mode)
|
||||||
- env:
|
- stage: test
|
||||||
|
env:
|
||||||
|
- STAGE=test
|
||||||
- NAME=littlefs-arm
|
- NAME=littlefs-arm
|
||||||
- CC="arm-linux-gnueabi-gcc --static -mthumb"
|
- CC="arm-linux-gnueabi-gcc --static -mthumb"
|
||||||
- EXEC="qemu-arm"
|
- EXEC="qemu-arm"
|
||||||
@@ -65,7 +70,9 @@ matrix:
|
|||||||
- qemu-arm -version
|
- qemu-arm -version
|
||||||
|
|
||||||
# cross-compile with PowerPC
|
# cross-compile with PowerPC
|
||||||
- env:
|
- stage: test
|
||||||
|
env:
|
||||||
|
- STAGE=test
|
||||||
- NAME=littlefs-powerpc
|
- NAME=littlefs-powerpc
|
||||||
- CC="powerpc-linux-gnu-gcc --static"
|
- CC="powerpc-linux-gnu-gcc --static"
|
||||||
- EXEC="qemu-ppc"
|
- EXEC="qemu-ppc"
|
||||||
@@ -75,7 +82,9 @@ matrix:
|
|||||||
- qemu-ppc -version
|
- qemu-ppc -version
|
||||||
|
|
||||||
# cross-compile with MIPS
|
# cross-compile with MIPS
|
||||||
- env:
|
- stage: test
|
||||||
|
env:
|
||||||
|
- STAGE=test
|
||||||
- NAME=littlefs-mips
|
- NAME=littlefs-mips
|
||||||
- CC="mips-linux-gnu-gcc --static"
|
- CC="mips-linux-gnu-gcc --static"
|
||||||
- EXEC="qemu-mips"
|
- EXEC="qemu-mips"
|
||||||
@@ -87,7 +96,9 @@ matrix:
|
|||||||
- qemu-mips -version
|
- qemu-mips -version
|
||||||
|
|
||||||
# self-host with littlefs-fuse for fuzz test
|
# self-host with littlefs-fuse for fuzz test
|
||||||
- env:
|
- stage: test
|
||||||
|
env:
|
||||||
|
- STAGE=test
|
||||||
- NAME=littlefs-fuse
|
- NAME=littlefs-fuse
|
||||||
install:
|
install:
|
||||||
- sudo apt-get install libfuse-dev
|
- sudo apt-get install libfuse-dev
|
||||||
@@ -117,50 +128,12 @@ matrix:
|
|||||||
- ls
|
- ls
|
||||||
- make -B test_dirs test_files QUIET=1
|
- make -B test_dirs test_files QUIET=1
|
||||||
|
|
||||||
# Manage statuses
|
|
||||||
before_install:
|
|
||||||
- |
|
|
||||||
curl -u $GEKY_BOT_STATUSES -X POST \
|
|
||||||
https://api.github.com/repos/$TRAVIS_REPO_SLUG/statuses/${TRAVIS_PULL_REQUEST_SHA:-$TRAVIS_COMMIT} \
|
|
||||||
-d "{
|
|
||||||
\"context\": \"ci/$NAME\",
|
|
||||||
\"state\": \"pending\",
|
|
||||||
\"description\": \"${STATUS:-In progress}\",
|
|
||||||
\"target_url\": \"https://travis-ci.org/$TRAVIS_REPO_SLUG/jobs/$TRAVIS_JOB_ID\"
|
|
||||||
}"
|
|
||||||
|
|
||||||
after_failure:
|
|
||||||
- |
|
|
||||||
curl -u $GEKY_BOT_STATUSES -X POST \
|
|
||||||
https://api.github.com/repos/$TRAVIS_REPO_SLUG/statuses/${TRAVIS_PULL_REQUEST_SHA:-$TRAVIS_COMMIT} \
|
|
||||||
-d "{
|
|
||||||
\"context\": \"ci/$NAME\",
|
|
||||||
\"state\": \"failure\",
|
|
||||||
\"description\": \"${STATUS:-Failed}\",
|
|
||||||
\"target_url\": \"https://travis-ci.org/$TRAVIS_REPO_SLUG/jobs/$TRAVIS_JOB_ID\"
|
|
||||||
}"
|
|
||||||
|
|
||||||
after_success:
|
|
||||||
- |
|
|
||||||
curl -u $GEKY_BOT_STATUSES -X POST \
|
|
||||||
https://api.github.com/repos/$TRAVIS_REPO_SLUG/statuses/${TRAVIS_PULL_REQUEST_SHA:-$TRAVIS_COMMIT} \
|
|
||||||
-d "{
|
|
||||||
\"context\": \"ci/$NAME\",
|
|
||||||
\"state\": \"success\",
|
|
||||||
\"description\": \"${STATUS:-Passed}\",
|
|
||||||
\"target_url\": \"https://travis-ci.org/$TRAVIS_REPO_SLUG/jobs/$TRAVIS_JOB_ID\"
|
|
||||||
}"
|
|
||||||
|
|
||||||
# Automatically update releases
|
# Automatically update releases
|
||||||
deploy:
|
- stage: deploy
|
||||||
# Let before_deploy take over
|
env:
|
||||||
provider: script
|
- STAGE=deploy
|
||||||
script: 'true'
|
- NAME=deploy
|
||||||
on:
|
script:
|
||||||
branch: master
|
|
||||||
|
|
||||||
before_deploy:
|
|
||||||
- cd $TRAVIS_BUILD_DIR
|
|
||||||
# Update tag for version defined in lfs.h
|
# Update tag for version defined in lfs.h
|
||||||
- LFS_VERSION=$(grep -ox '#define LFS_VERSION .*' lfs.h | cut -d ' ' -f3)
|
- LFS_VERSION=$(grep -ox '#define LFS_VERSION .*' lfs.h | cut -d ' ' -f3)
|
||||||
- LFS_VERSION_MAJOR=$((0xffff & ($LFS_VERSION >> 16)))
|
- LFS_VERSION_MAJOR=$((0xffff & ($LFS_VERSION >> 16)))
|
||||||
@@ -208,3 +181,43 @@ before_deploy:
|
|||||||
}' <(jq '.body' <<< "$RELEASE") <(jq -sR '.' <<< "$CHANGES")
|
}' <(jq '.body' <<< "$RELEASE") <(jq -sR '.' <<< "$CHANGES")
|
||||||
)"
|
)"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Manage statuses
|
||||||
|
before_install:
|
||||||
|
- |
|
||||||
|
curl -u $GEKY_BOT_STATUSES -X POST \
|
||||||
|
https://api.github.com/repos/$TRAVIS_REPO_SLUG/statuses/${TRAVIS_PULL_REQUEST_SHA:-$TRAVIS_COMMIT} \
|
||||||
|
-d "{
|
||||||
|
\"context\": \"$STAGE/$NAME\",
|
||||||
|
\"state\": \"pending\",
|
||||||
|
\"description\": \"${STATUS:-In progress}\",
|
||||||
|
\"target_url\": \"https://travis-ci.org/$TRAVIS_REPO_SLUG/jobs/$TRAVIS_JOB_ID\"
|
||||||
|
}"
|
||||||
|
|
||||||
|
after_failure:
|
||||||
|
- |
|
||||||
|
curl -u $GEKY_BOT_STATUSES -X POST \
|
||||||
|
https://api.github.com/repos/$TRAVIS_REPO_SLUG/statuses/${TRAVIS_PULL_REQUEST_SHA:-$TRAVIS_COMMIT} \
|
||||||
|
-d "{
|
||||||
|
\"context\": \"$STAGE/$NAME\",
|
||||||
|
\"state\": \"failure\",
|
||||||
|
\"description\": \"${STATUS:-Failed}\",
|
||||||
|
\"target_url\": \"https://travis-ci.org/$TRAVIS_REPO_SLUG/jobs/$TRAVIS_JOB_ID\"
|
||||||
|
}"
|
||||||
|
|
||||||
|
after_success:
|
||||||
|
- |
|
||||||
|
curl -u $GEKY_BOT_STATUSES -X POST \
|
||||||
|
https://api.github.com/repos/$TRAVIS_REPO_SLUG/statuses/${TRAVIS_PULL_REQUEST_SHA:-$TRAVIS_COMMIT} \
|
||||||
|
-d "{
|
||||||
|
\"context\": \"$STAGE/$NAME\",
|
||||||
|
\"state\": \"success\",
|
||||||
|
\"description\": \"${STATUS:-Passed}\",
|
||||||
|
\"target_url\": \"https://travis-ci.org/$TRAVIS_REPO_SLUG/jobs/$TRAVIS_JOB_ID\"
|
||||||
|
}"
|
||||||
|
|
||||||
|
# Job control
|
||||||
|
stages:
|
||||||
|
- name: test
|
||||||
|
- name: deploy
|
||||||
|
if: branch = master
|
||||||
|
|||||||
Reference in New Issue
Block a user