You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

67 lines
2.3 KiB

  1. version: 2.0
  2. jobs:
  3. build:
  4. docker:
  5. - image: champtar/openwrtpackagesci@sha256:4d8bea09b6fd51e015f417a8f0056b914d0db6aa9829b0049065a077f52a91e9
  6. environment:
  7. - SDK_BASE_URL: "https://downloads.lede-project.org/snapshots/targets/ar71xx/generic"
  8. - SDK_FILE: "openwrt-sdk-ar71xx-generic_gcc-7.3.0_musl.Linux-x86_64.tar.xz"
  9. steps:
  10. - run:
  11. name: Download the SDK
  12. working_directory: ~/sdk
  13. command: |
  14. curl "$SDK_BASE_URL/sha256sums" -sS -o sha256sums
  15. curl "$SDK_BASE_URL/sha256sums.asc" -sS -o sha256sums.asc
  16. gpg --with-fingerprint --verify sha256sums.asc sha256sums
  17. curl "$SDK_BASE_URL/$SDK_FILE" -sS -o "$SDK_FILE"
  18. sha256sum -c --ignore-missing sha256sums
  19. - checkout:
  20. path: ~/openwrt_packages
  21. - run:
  22. name: Prepare build_dir
  23. working_directory: ~/build_dir
  24. command: |
  25. tar Jxf ~/sdk/$SDK_FILE --strip=1
  26. cat > feeds.conf <<EOF
  27. src-git base https://github.com/lede-project/source.git
  28. src-link packages $HOME/openwrt_packages
  29. src-git luci https://github.com/openwrt/luci.git
  30. EOF
  31. cat feeds.conf
  32. # enable BUILD_LOG
  33. sed -i '1s/^/config BUILD_LOG\n\tbool\n\tdefault y\n\n/' Config-build.in
  34. ./scripts/feeds update -a > /dev/null
  35. ./scripts/feeds install -a > /dev/null
  36. make defconfig > /dev/null
  37. - run:
  38. name: Download & check & compile
  39. working_directory: ~/build_dir
  40. command: |
  41. PKGS=$(cd ~/openwrt_packages; git diff --diff-filter=d --name-only "origin/master..." | grep 'Makefile$' | grep -v '/files/' | awk -F/ '{ print $(NF-1) }')
  42. echo "Packages: $PKGS"
  43. for PKG in $PKGS ; do
  44. make "package/$PKG/download" V=s
  45. make "package/$PKG/check" V=s
  46. done
  47. for PKG in $PKGS ; do
  48. make "package/$PKG/compile" -j3 V=s
  49. done
  50. - store_artifacts:
  51. path: ~/build_dir/logs
  52. - store_artifacts:
  53. path: ~/build_dir/bin
  54. workflows:
  55. version: 2
  56. buildpr:
  57. jobs:
  58. - build:
  59. filters:
  60. branches:
  61. ignore: master