toolchain.yml 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. name: Build Toolchains
  2. on:
  3. pull_request:
  4. paths:
  5. - '.github/workflows/build.yml'
  6. - '.github/workflows/toolchain.yml'
  7. - 'toolchain/**'
  8. push:
  9. paths:
  10. - '.github/workflows/build.yml'
  11. - '.github/workflows/toolchain.yml'
  12. - 'toolchain/**'
  13. branches-ignore:
  14. - master
  15. permissions:
  16. contents: read
  17. concurrency:
  18. group: ${{ github.workflow }}-${{ github.ref }}
  19. cancel-in-progress: ${{ github.event_name == 'pull_request' }}
  20. jobs:
  21. determine_targets:
  22. name: Set targets
  23. runs-on: ubuntu-latest
  24. outputs:
  25. target: ${{ steps.find_targets.outputs.target }}
  26. steps:
  27. - name: Checkout
  28. uses: actions/checkout@v3
  29. - name: Set targets
  30. id: find_targets
  31. run: |
  32. export TARGETS="$(perl ./scripts/dump-target-info.pl targets 2>/dev/null \
  33. | sort -u -t '/' -k1,1 \
  34. | awk '{ print $1 }')"
  35. JSON='['
  36. FIRST=1
  37. for TARGET in $TARGETS; do
  38. TUPLE='{"target":"'"$(echo $TARGET | cut -d "/" -f 1)"'","subtarget":"'"$(echo $TARGET | cut -d "/" -f 2)"'"}'
  39. [[ $FIRST -ne 1 ]] && JSON="$JSON"','
  40. JSON="$JSON""$TUPLE"
  41. FIRST=0
  42. done
  43. JSON="$JSON"']'
  44. echo -e "\n---- targets ----\n"
  45. echo "$JSON"
  46. echo -e "\n---- targets ----\n"
  47. echo "target=$JSON" >> $GITHUB_OUTPUT
  48. build:
  49. name: Build Target Toolchain
  50. needs: determine_targets
  51. permissions:
  52. contents: read
  53. packages: read
  54. strategy:
  55. fail-fast: False
  56. matrix:
  57. include: ${{fromJson(needs.determine_targets.outputs.target)}}
  58. uses: ./.github/workflows/build.yml
  59. with:
  60. target: ${{ matrix.target }}
  61. subtarget: ${{ matrix.subtarget }}
  62. build_toolchain: true