|
| 1 | +name: Wolfboot Reusable Build Workflow for MCUXpresso SDK |
| 2 | + |
| 3 | +on: |
| 4 | + |
| 5 | + workflow_call: |
| 6 | + inputs: |
| 7 | + arch: |
| 8 | + required: true |
| 9 | + type: string |
| 10 | + config-file: |
| 11 | + required: true |
| 12 | + type: string |
| 13 | + board-name: |
| 14 | + required: true |
| 15 | + type: string |
| 16 | + make-args: |
| 17 | + required: false |
| 18 | + type: string |
| 19 | + |
| 20 | +jobs: |
| 21 | + |
| 22 | + build: |
| 23 | + runs-on: ubuntu-latest |
| 24 | + timeout-minutes: 30 |
| 25 | + |
| 26 | + steps: |
| 27 | + - uses: actions/checkout@v4 |
| 28 | + with: |
| 29 | + submodules: true |
| 30 | + |
| 31 | + - uses: actions/checkout@main |
| 32 | + with: |
| 33 | + repository: nxp-mcuxpresso/CMSIS_5 |
| 34 | + path: CMSIS_5 |
| 35 | + |
| 36 | + - name: Workaround for sources.list |
| 37 | + run: | |
| 38 | + # Replace sources |
| 39 | +
|
| 40 | + set -euxo pipefail |
| 41 | +
|
| 42 | + # Peek (what repos are active now) |
| 43 | + apt-cache policy |
| 44 | + grep -RInE '^(deb|Types|URIs)' /etc/apt || true |
| 45 | +
|
| 46 | + # Enable nullglob so *.list/*.sources that don't exist don't break sed |
| 47 | + shopt -s nullglob |
| 48 | +
|
| 49 | + echo "Replace sources.list (legacy)" |
| 50 | + sudo sed -i \ |
| 51 | + -e "s|https\?://azure\.archive\.ubuntu\.com/ubuntu/?|http://mirror.arizona.edu/ubuntu/|g" \ |
| 52 | + /etc/apt/sources.list || true |
| 53 | +
|
| 54 | + echo "Replace sources.list.d/*.list (legacy)" |
| 55 | + for f in /etc/apt/sources.list.d/*.list; do |
| 56 | + sudo sed -i \ |
| 57 | + -e "s|https\?://azure\.archive\.ubuntu\.com/ubuntu/?|http://mirror.arizona.edu/ubuntu/|g" \ |
| 58 | + "$f" |
| 59 | + done |
| 60 | +
|
| 61 | + echo "Replace sources.list.d/*.sources (deb822)" |
| 62 | + for f in /etc/apt/sources.list.d/*.sources; do |
| 63 | + sudo sed -i \ |
| 64 | + -e "s|https\?://azure\.archive\.ubuntu\.com/ubuntu/?|http://mirror.arizona.edu/ubuntu/|g" \ |
| 65 | + -e "s|https\?://azure\.archive\.ubuntu\.com|http://mirror.arizona.edu|g" \ |
| 66 | + "$f" |
| 67 | + done |
| 68 | +
|
| 69 | + echo "Fix /etc/apt/apt-mirrors.txt (used by URIs: mirror+file:...)" |
| 70 | + if grep -qE '^[[:space:]]*https?://azure\.archive\.ubuntu\.com/ubuntu/?' /etc/apt/apt-mirrors.txt; then |
| 71 | + # Replace azure with our mirror (idempotent) |
| 72 | + sudo sed -i 's|https\?://azure\.archive\.ubuntu\.com/ubuntu/|http://mirror.arizona.edu/ubuntu/|g' /etc/apt/apt-mirrors.txt |
| 73 | + fi |
| 74 | +
|
| 75 | + # Peek (verify changes) |
| 76 | + grep -RIn "azure.archive.ubuntu.com" /etc/apt || true |
| 77 | + grep -RInE '^(deb|Types|URIs)' /etc/apt || true |
| 78 | + echo "--- apt-mirrors.txt ---" |
| 79 | + cat /etc/apt/apt-mirrors.txt || true |
| 80 | +
|
| 81 | + - name: Update repository |
| 82 | + run: sudo apt-get update |
| 83 | + |
| 84 | + - name: Install software |
| 85 | + run: | |
| 86 | + sudo apt-get install -y gcc-arm-none-eabi west |
| 87 | +
|
| 88 | + - name: Setup MCUXpresso SDK |
| 89 | + run: | |
| 90 | + west init -m https://github.com/nxp-mcuxpresso/mcuxsdk-manifests.git mcuxpresso-sdk |
| 91 | + cd mcuxpresso-sdk |
| 92 | + west update_board --set board ${{inputs.board-name}} |
| 93 | +
|
| 94 | + - name: make distclean |
| 95 | + run: | |
| 96 | + make distclean |
| 97 | +
|
| 98 | + - name: Select config |
| 99 | + run: | |
| 100 | + cp ${{inputs.config-file}} .config && make include/target.h |
| 101 | +
|
| 102 | + - name: Build tools |
| 103 | + run: | |
| 104 | + make -C tools/keytools && make -C tools/bin-assemble |
| 105 | +
|
| 106 | + - name: Build wolfboot |
| 107 | + run: | |
| 108 | + make MCUXSDK=1 MCUXPRESSO="$GITHUB_WORKSPACE/mcuxpresso-sdk/mcuxsdk" MCUXPRESSO_CMSIS="$GITHUB_WORKSPACE/CMSIS_5/CMSIS" ${{inputs.make-args}} V=1 |
0 commit comments