From 8c00a73cc8bed42afda1bddf3b7b0f18f3314fc2 Mon Sep 17 00:00:00 2001 From: Mattia Moffa Date: Thu, 22 Jan 2026 18:53:56 +0100 Subject: [PATCH] Add GitHub workflows --- .../test-build-mcux-sdk-manifests.yml | 108 ++++++++++++++++++ .github/workflows/test-configs.yml | 12 ++ 2 files changed, 120 insertions(+) create mode 100644 .github/workflows/test-build-mcux-sdk-manifests.yml diff --git a/.github/workflows/test-build-mcux-sdk-manifests.yml b/.github/workflows/test-build-mcux-sdk-manifests.yml new file mode 100644 index 00000000..bf57ba28 --- /dev/null +++ b/.github/workflows/test-build-mcux-sdk-manifests.yml @@ -0,0 +1,108 @@ +name: Wolfboot Reusable Build Workflow for MCUXpresso SDK + +on: + + workflow_call: + inputs: + arch: + required: true + type: string + config-file: + required: true + type: string + board-name: + required: true + type: string + make-args: + required: false + type: string + +jobs: + + build: + runs-on: ubuntu-latest + timeout-minutes: 30 + + steps: + - uses: actions/checkout@v4 + with: + submodules: true + + - uses: actions/checkout@main + with: + repository: nxp-mcuxpresso/CMSIS_5 + path: CMSIS_5 + + - name: Workaround for sources.list + run: | + # Replace sources + + set -euxo pipefail + + # Peek (what repos are active now) + apt-cache policy + grep -RInE '^(deb|Types|URIs)' /etc/apt || true + + # Enable nullglob so *.list/*.sources that don't exist don't break sed + shopt -s nullglob + + echo "Replace sources.list (legacy)" + sudo sed -i \ + -e "s|https\?://azure\.archive\.ubuntu\.com/ubuntu/?|http://mirror.arizona.edu/ubuntu/|g" \ + /etc/apt/sources.list || true + + echo "Replace sources.list.d/*.list (legacy)" + for f in /etc/apt/sources.list.d/*.list; do + sudo sed -i \ + -e "s|https\?://azure\.archive\.ubuntu\.com/ubuntu/?|http://mirror.arizona.edu/ubuntu/|g" \ + "$f" + done + + echo "Replace sources.list.d/*.sources (deb822)" + for f in /etc/apt/sources.list.d/*.sources; do + sudo sed -i \ + -e "s|https\?://azure\.archive\.ubuntu\.com/ubuntu/?|http://mirror.arizona.edu/ubuntu/|g" \ + -e "s|https\?://azure\.archive\.ubuntu\.com|http://mirror.arizona.edu|g" \ + "$f" + done + + echo "Fix /etc/apt/apt-mirrors.txt (used by URIs: mirror+file:...)" + if grep -qE '^[[:space:]]*https?://azure\.archive\.ubuntu\.com/ubuntu/?' /etc/apt/apt-mirrors.txt; then + # Replace azure with our mirror (idempotent) + sudo sed -i 's|https\?://azure\.archive\.ubuntu\.com/ubuntu/|http://mirror.arizona.edu/ubuntu/|g' /etc/apt/apt-mirrors.txt + fi + + # Peek (verify changes) + grep -RIn "azure.archive.ubuntu.com" /etc/apt || true + grep -RInE '^(deb|Types|URIs)' /etc/apt || true + echo "--- apt-mirrors.txt ---" + cat /etc/apt/apt-mirrors.txt || true + + - name: Update repository + run: sudo apt-get update + + - name: Install software + run: | + sudo apt-get install -y gcc-arm-none-eabi west + + - name: Setup MCUXpresso SDK + run: | + west init -m https://github.com/nxp-mcuxpresso/mcuxsdk-manifests.git mcuxpresso-sdk + cd mcuxpresso-sdk + west update_board --set board ${{inputs.board-name}} + + - name: make distclean + run: | + make distclean + + - name: Select config + run: | + cp ${{inputs.config-file}} .config && make include/target.h + + - name: Build tools + run: | + make -C tools/keytools && make -C tools/bin-assemble + + - name: Build wolfboot + run: | + make MCUXSDK=1 MCUXPRESSO="$GITHUB_WORKSPACE/mcuxpresso-sdk/mcuxsdk" MCUXPRESSO_CMSIS="$GITHUB_WORKSPACE/CMSIS_5/CMSIS" ${{inputs.make-args}} V=1 diff --git a/.github/workflows/test-configs.yml b/.github/workflows/test-configs.yml index d173cdec..8090d3c4 100644 --- a/.github/workflows/test-configs.yml +++ b/.github/workflows/test-configs.yml @@ -216,6 +216,18 @@ jobs: arch: arm config-file: ./config/examples/mcxw-tz.config + nxp_mcxn_test: + uses: ./.github/workflows/test-build-mcux-sdk-manifests.yml + with: + arch: arm + config-file: ./config/examples/mcxn.config + + nxp_mcxn_tz_test: + uses: ./.github/workflows/test-build-mcux-sdk-manifests.yml + with: + arch: arm + config-file: ./config/examples/mcxn-tz.config + nxp_s32k142_test: uses: ./.github/workflows/test-build.yml with: