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.

91 lines
2.5 KiB

  1. name: Test Build
  2. on:
  3. pull_request:
  4. branches:
  5. - master
  6. jobs:
  7. build:
  8. name: Test ${{ matrix.arch }}
  9. runs-on: ubuntu-latest
  10. strategy:
  11. fail-fast: false
  12. matrix:
  13. arch:
  14. - arc_arc700
  15. - arm_cortex-a9_neon
  16. - arm_cortex-a9_vfpv3-d16
  17. - mips_24kc
  18. - powerpc_464fp
  19. - powerpc_8540
  20. runtime_test: [false]
  21. include:
  22. - arch: aarch64_generic
  23. runtime_test: true
  24. - arch: arm_cortex-a15_neon-vfpv4
  25. runtime_test: true
  26. - arch: i386_pentium4
  27. runtime_test: true
  28. - arch: x86_64
  29. runtime_test: true
  30. steps:
  31. - uses: actions/checkout@v2
  32. with:
  33. fetch-depth: 0
  34. - name: Determine changed packages
  35. run: |
  36. # only detect packages with changed Makefiles
  37. PACKAGES="$(git diff --diff-filter=d --name-only origin/master \
  38. | grep -E 'Makefile$|test.sh$' | grep -Ev '/files/|/src/' \
  39. | awk -F/ '{ print $(NF-1) }' | tr '\n' ' ')"
  40. # fallback to test packages if nothing explicitly changes this is
  41. # should run if other mechanics in packages.git changed
  42. PACKAGES="${PACKAGES:-vim tmux bmon}"
  43. echo "Building $PACKAGES"
  44. echo "::set-env name=PACKAGES::$PACKAGES"
  45. - name: Build
  46. uses: openwrt/gh-action-sdk@v1
  47. env:
  48. ARCH: ${{ matrix.arch }}
  49. FEEDNAME: packages_ci
  50. - name: Move created packages to project dir
  51. run: cp bin/packages/${{ matrix.arch }}/packages_ci/*.ipk . || true
  52. - name: Store packages
  53. uses: actions/upload-artifact@v2
  54. with:
  55. name: ${{ matrix.arch}}-packages
  56. path: "*.ipk"
  57. - name: Store logs
  58. uses: actions/upload-artifact@v2
  59. with:
  60. name: ${{ matrix.arch}}-logs
  61. path: logs/
  62. - name: Remove logs
  63. run: sudo rm -rf logs/ || true
  64. - name: Register QEMU
  65. if: ${{ matrix.runtime_test }}
  66. run: |
  67. sudo docker run --rm --privileged aptman/qus -s -- -p
  68. - name: Build Docker container
  69. if: ${{ matrix.runtime_test }}
  70. run: |
  71. docker build -t test-container --build-arg ARCH .github/workflows/
  72. env:
  73. ARCH: ${{ matrix.arch }}
  74. - name: Test via Docker container
  75. if: ${{ matrix.runtime_test }}
  76. run: |
  77. docker run --rm -v $GITHUB_WORKSPACE:/ci test-container