.travis.yml 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. env:
  2. - CFLAGS=-Werror
  3. script:
  4. # make sure example can at least compile
  5. - sed -n '/``` c/,/```/{/```/d; p;}' README.md > test.c &&
  6. make all size CFLAGS+="
  7. -Duser_provided_block_device_read=NULL
  8. -Duser_provided_block_device_prog=NULL
  9. -Duser_provided_block_device_erase=NULL
  10. -Duser_provided_block_device_sync=NULL
  11. -include stdio.h"
  12. # run tests
  13. - make test QUIET=1
  14. # run tests with a few different configurations
  15. - make test QUIET=1 CFLAGS+="-DLFS_READ_SIZE=1 -DLFS_PROG_SIZE=1"
  16. - make test QUIET=1 CFLAGS+="-DLFS_READ_SIZE=512 -DLFS_PROG_SIZE=512"
  17. - make test QUIET=1 CFLAGS+="-DLFS_BLOCK_COUNT=1023 -DLFS_LOOKAHEAD=2048"
  18. # self-host with littlefs-fuse for fuzz test
  19. - make -C littlefs-fuse
  20. - littlefs-fuse/lfs --format /dev/loop0
  21. - littlefs-fuse/lfs /dev/loop0 mount
  22. - ls mount
  23. - mkdir mount/littlefs
  24. - cp -r $(git ls-tree --name-only HEAD) mount/littlefs
  25. - cd mount/littlefs
  26. - ls
  27. - make -B test_dirs test_files QUIET=1
  28. before_install:
  29. - fusermount -V
  30. - gcc --version
  31. install:
  32. - sudo apt-get install libfuse-dev
  33. - git clone --depth 1 https://github.com/geky/littlefs-fuse
  34. before_script:
  35. - rm -rf littlefs-fuse/littlefs/*
  36. - cp -r $(git ls-tree --name-only HEAD) littlefs-fuse/littlefs
  37. - mkdir mount
  38. - sudo chmod a+rw /dev/loop0
  39. - dd if=/dev/zero bs=512 count=2048 of=disk
  40. - losetup /dev/loop0 disk
  41. deploy:
  42. # Let before_deploy take over
  43. provider: script
  44. script: 'true'
  45. on:
  46. branch: master
  47. before_deploy:
  48. - cd $TRAVIS_BUILD_DIR
  49. # Update tag for version defined in lfs.h
  50. - LFS_VERSION=$(grep -ox '#define LFS_VERSION .*' lfs.h | cut -d ' ' -f3)
  51. - LFS_VERSION_MAJOR=$((0xffff & ($LFS_VERSION >> 16)))
  52. - LFS_VERSION_MINOR=$((0xffff & ($LFS_VERSION >> 0)))
  53. - LFS_VERSION="v$LFS_VERSION_MAJOR.$LFS_VERSION_MINOR"
  54. - |
  55. curl -u $GEKY_BOT -X POST \
  56. https://api.github.com/repos/$TRAVIS_REPO_SLUG/git/refs \
  57. -d @- <<< "{
  58. \"ref\": \"refs/tags/$LFS_VERSION\",
  59. \"sha\": \"$TRAVIS_COMMIT\"
  60. }"
  61. - |
  62. curl -f -u $GEKY_BOT -X PATCH \
  63. https://api.github.com/repos/$TRAVIS_REPO_SLUG/git/refs/tags/$LFS_VERSION \
  64. -d @- <<< "{
  65. \"sha\": \"$TRAVIS_COMMIT\"
  66. }"