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.

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