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.

94 lines
2.6 KiB

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