mirror of
https://github.com/eledio-devices/thirdparty-littlefs.git
synced 2025-11-01 00:38:29 +01:00
108 lines
3.4 KiB
YAML
108 lines
3.4 KiB
YAML
env:
|
|
- CFLAGS=-Werror
|
|
|
|
script:
|
|
# make sure example can at least compile
|
|
- sed -n '/``` c/,/```/{/```/d; p;}' README.md > test.c &&
|
|
make all size CFLAGS+="
|
|
-Duser_provided_block_device_read=NULL
|
|
-Duser_provided_block_device_prog=NULL
|
|
-Duser_provided_block_device_erase=NULL
|
|
-Duser_provided_block_device_sync=NULL
|
|
-include stdio.h"
|
|
|
|
# run tests
|
|
- make test QUIET=1
|
|
|
|
# run tests with a few different configurations
|
|
- make test QUIET=1 CFLAGS+="-DLFS_READ_SIZE=1 -DLFS_PROG_SIZE=1"
|
|
- make test QUIET=1 CFLAGS+="-DLFS_READ_SIZE=512 -DLFS_PROG_SIZE=512"
|
|
- make test QUIET=1 CFLAGS+="-DLFS_BLOCK_COUNT=1023 -DLFS_LOOKAHEAD=2048"
|
|
|
|
# self-host with littlefs-fuse for fuzz test
|
|
- make -C littlefs-fuse
|
|
|
|
- littlefs-fuse/lfs --format /dev/loop0
|
|
- littlefs-fuse/lfs /dev/loop0 mount
|
|
|
|
- ls mount
|
|
- mkdir mount/littlefs
|
|
- cp -r $(git ls-tree --name-only HEAD) mount/littlefs
|
|
- cd mount/littlefs
|
|
- ls
|
|
- make -B test_dirs test_files QUIET=1
|
|
|
|
before_install:
|
|
- fusermount -V
|
|
- gcc --version
|
|
|
|
install:
|
|
- sudo apt-get install libfuse-dev
|
|
- git clone --depth 1 https://github.com/geky/littlefs-fuse
|
|
|
|
before_script:
|
|
- rm -rf littlefs-fuse/littlefs/*
|
|
- cp -r $(git ls-tree --name-only HEAD) littlefs-fuse/littlefs
|
|
|
|
- mkdir mount
|
|
- sudo chmod a+rw /dev/loop0
|
|
- dd if=/dev/zero bs=512 count=2048 of=disk
|
|
- losetup /dev/loop0 disk
|
|
|
|
deploy:
|
|
# Let before_deploy take over
|
|
provider: script
|
|
script: 'true'
|
|
on:
|
|
branch: master
|
|
|
|
before_deploy:
|
|
- cd $TRAVIS_BUILD_DIR
|
|
# Update tag for version defined in lfs.h
|
|
- LFS_VERSION=$(grep -ox '#define LFS_VERSION .*' lfs.h | cut -d ' ' -f3)
|
|
- LFS_VERSION_MAJOR=$((0xffff & ($LFS_VERSION >> 16)))
|
|
- LFS_VERSION_MINOR=$((0xffff & ($LFS_VERSION >> 0)))
|
|
- LFS_VERSION="v$LFS_VERSION_MAJOR.$LFS_VERSION_MINOR"
|
|
- echo "littlefs version $LFS_VERSION"
|
|
- |
|
|
curl -u $GEKY_BOT -X POST \
|
|
https://api.github.com/repos/$TRAVIS_REPO_SLUG/git/refs \
|
|
-d "{
|
|
\"ref\": \"refs/tags/$LFS_VERSION\",
|
|
\"sha\": \"$TRAVIS_COMMIT\"
|
|
}"
|
|
- |
|
|
curl -f -u $GEKY_BOT -X PATCH \
|
|
https://api.github.com/repos/$TRAVIS_REPO_SLUG/git/refs/tags/$LFS_VERSION \
|
|
-d "{
|
|
\"sha\": \"$TRAVIS_COMMIT\"
|
|
}"
|
|
# Create release notes from commits
|
|
- LFS_PREV_VERSION="v$LFS_VERSION_MAJOR.$(($LFS_VERSION_MINOR-1))"
|
|
- |
|
|
if [ $(git tag -l "$LFS_PREV_VERSION") ]
|
|
then
|
|
curl -u $GEKY_BOT -X POST \
|
|
https://api.github.com/repos/$TRAVIS_REPO_SLUG/releases \
|
|
-d "{
|
|
\"tag_name\": \"$LFS_VERSION\",
|
|
\"name\": \"$LFS_VERSION\"
|
|
}"
|
|
RELEASE=$(
|
|
curl -f https://api.github.com/repos/$TRAVIS_REPO_SLUG/releases/tags/$LFS_VERSION
|
|
)
|
|
CHANGES=$(
|
|
git log --oneline $LFS_PREV_VERSION.. --grep='^Merge' --invert-grep
|
|
)
|
|
curl -f -u $GEKY_BOT -X PATCH \
|
|
https://api.github.com/repos/$TRAVIS_REPO_SLUG/releases/$(
|
|
jq -r '.id' <<< "$RELEASE"
|
|
) \
|
|
-d "$(
|
|
jq -s '{
|
|
"body": ((.[0] // "" | sub("(?<=\n)#+ Changes.*"; ""; "mi"))
|
|
+ "### Changes\n\n" + .[1])
|
|
}' <(jq '.body' <<< "$RELEASE") <(jq -sR '.' <<< "$CHANGES")
|
|
)"
|
|
fi
|