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.

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