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.

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