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.

124 lines
3.3 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. include:
  12. - arch: arc_archs
  13. target: archs38-generic
  14. runtime_test: false
  15. - arch: arm_cortex-a9_vfpv3-d16
  16. target: mvebu-cortexa9
  17. runtime_test: false
  18. - arch: mips_24kc
  19. target: ath79-generic
  20. runtime_test: false
  21. - arch: powerpc_464fp
  22. target: apm821xx-nand
  23. runtime_test: false
  24. - arch: powerpc_8540
  25. target: mpc85xx-p1010
  26. runtime_test: false
  27. - arch: aarch64_cortex-a53
  28. target: mvebu-cortexa53
  29. runtime_test: true
  30. - arch: arm_cortex-a15_neon-vfpv4
  31. target: armvirt-32
  32. runtime_test: true
  33. - arch: i386_pentium-mmx
  34. target: x86-geode
  35. runtime_test: true
  36. - arch: x86_64
  37. target: x86-64
  38. runtime_test: true
  39. steps:
  40. - uses: actions/checkout@v2
  41. with:
  42. fetch-depth: 0
  43. - name: Determine branch name
  44. run: |
  45. BRANCH="${GITHUB_BASE_REF#refs/heads/}"
  46. echo "Building for $BRANCH"
  47. echo "BRANCH=$BRANCH" >> $GITHUB_ENV
  48. - name: Determine changed packages
  49. run: |
  50. # only detect packages with changes
  51. PKG_ROOTS=$(find . -name Makefile | \
  52. grep -v ".*/src/Makefile" | \
  53. sed -e 's@./\(.*\)/Makefile@\1/@')
  54. CHANGES=$(git diff --diff-filter=d --name-only origin/$BRANCH)
  55. for ROOT in $PKG_ROOTS; do
  56. for CHANGE in $CHANGES; do
  57. if [[ "$CHANGE" == "$ROOT"* ]]; then
  58. PACKAGES+=$(echo "$ROOT" | sed -e 's@.*/\(.*\)/@\1 @')
  59. break
  60. fi
  61. done
  62. done
  63. # fallback to test packages if nothing explicitly changes this is
  64. # should run if other mechanics in packages.git changed
  65. PACKAGES="${PACKAGES:-vim attendedsysupgrade-common bmon}"
  66. echo "Building $PACKAGES"
  67. echo "PACKAGES=$PACKAGES" >> $GITHUB_ENV
  68. - name: Build
  69. uses: openwrt/gh-action-sdk@v1
  70. env:
  71. ARCH: ${{ matrix.arch }}-${{ env.BRANCH }}
  72. FEEDNAME: packages_ci
  73. - name: Move created packages to project dir
  74. run: cp bin/packages/${{ matrix.arch }}/packages_ci/*.ipk . || true
  75. - name: Store packages
  76. uses: actions/upload-artifact@v2
  77. with:
  78. name: ${{ matrix.arch}}-packages
  79. path: "*.ipk"
  80. - name: Store logs
  81. uses: actions/upload-artifact@v2
  82. with:
  83. name: ${{ matrix.arch}}-logs
  84. path: logs/
  85. - name: Remove logs
  86. run: sudo rm -rf logs/ || true
  87. - name: Register QEMU
  88. if: ${{ matrix.runtime_test }}
  89. run: |
  90. sudo docker run --rm --privileged aptman/qus -s -- -p
  91. - name: Build Docker container
  92. if: ${{ matrix.runtime_test }}
  93. run: |
  94. docker build -t test-container --build-arg ARCH .github/workflows/
  95. env:
  96. ARCH: ${{ matrix.arch }}
  97. - name: Test via Docker container
  98. if: ${{ matrix.runtime_test }}
  99. run: |
  100. docker run --rm -v $GITHUB_WORKSPACE:/ci test-container