.travis.yml 2.3 KB

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