toolchain.yml 1.6 KB

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