toolchain.yml 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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. permissions:
  14. contents: read
  15. jobs:
  16. determine_targets:
  17. name: Set targets
  18. runs-on: ubuntu-latest
  19. outputs:
  20. target: ${{ steps.find_targets.outputs.target }}
  21. steps:
  22. - name: Checkout
  23. uses: actions/checkout@v3
  24. - name: Set targets
  25. id: find_targets
  26. run: |
  27. export TARGETS="$(perl ./scripts/dump-target-info.pl targets 2>/dev/null \
  28. | sort -u -t '/' -k1,1 \
  29. | awk '{ print $1 }')"
  30. JSON='['
  31. FIRST=1
  32. for TARGET in $TARGETS; do
  33. [[ $FIRST -ne 1 ]] && JSON="$JSON"','
  34. JSON="$JSON"'"'"${TARGET}"'"'
  35. FIRST=0
  36. done
  37. JSON="$JSON"']'
  38. echo -e "\n---- targets ----\n"
  39. echo "$JSON"
  40. echo -e "\n---- targets ----\n"
  41. echo "target=$JSON" >> $GITHUB_OUTPUT
  42. build:
  43. name: Build Target Toolchain
  44. needs: determine_targets
  45. permissions:
  46. contents: read
  47. packages: read
  48. strategy:
  49. fail-fast: False
  50. matrix:
  51. target: ${{fromJson(needs.determine_targets.outputs.target)}}
  52. uses: ./.github/workflows/build.yml
  53. with:
  54. target: ${{ matrix.target }}
  55. build_toolchain: true