Skip to content

Pinned the NUCLEO Renode download and cached every toolchain fetch (#55) #19

Pinned the NUCLEO Renode download and cached every toolchain fetch (#55)

Pinned the NUCLEO Renode download and cached every toolchain fetch (#55) #19

Workflow file for this run

#
# Copyright (c) 2026 Eclipse ThreadX contributors
#
# This program and the accompanying materials are made available
# under the terms of the MIT license which is available at
# https://opensource.org/licenses/MIT.
#
# SPDX-License-Identifier: MIT
#
name: SampleX CI Verification Pipeline
on:
push:
branches: [ main, master, dev, 'feat/**' ]
pull_request:
branches: [ main, master, dev ]
jobs:
build-riscv-polarfire:
name: Build PolarFire SoC Icicle Kit (64-Bit RISC-V)
runs-on: ubuntu-24.04
timeout-minutes: 20
env:
XPACK_VERSION: 14.3.0-1
XPACK_TARBALL: xpack-riscv-none-elf-gcc-14.3.0-1-linux-x64.tar.gz
XPACK_SHA256: be1768ef22789f4d9c41384e0261996f51724b84c2efa940d975dd7d9938c726
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
submodules: recursive
- name: Install CMake and Ninja
run: |
sudo apt-get update
sudo apt-get install -y cmake ninja-build
- name: Cache the xPack RISC-V toolchain
id: cache-xpack
uses: actions/cache@v4
with:
path: ~/riscv-gcc
key: xpack-riscv-none-elf-gcc-${{ env.XPACK_VERSION }}-linux-x64
- name: Install Pinned xPack RISC-V GCC
if: steps.cache-xpack.outputs.cache-hit != 'true'
run: |
set -euo pipefail
wget -q "https://github.com/xpack-dev-tools/riscv-none-elf-gcc-xpack/releases/download/v${XPACK_VERSION}/${XPACK_TARBALL}"
echo "${XPACK_SHA256} ${XPACK_TARBALL}" | sha256sum --check --strict
mkdir -p $HOME/riscv-gcc
tar -xzf "${XPACK_TARBALL}" -C $HOME/riscv-gcc --strip-components=1
rm "${XPACK_TARBALL}"
- name: Put the RISC-V toolchain on PATH
run: echo "$HOME/riscv-gcc/bin" >> $GITHUB_PATH
- name: Report the toolchain version
run: riscv-none-elf-gcc --version
- name: Build SampleX PolarFire Condition-Monitoring Demo
run: |
bash targets/Microchip/POLARFIRE_ICICLE_RENODE/scripts/build.sh --rebuild
- name: Verify SampleX Demo ELF
run: |
test -f targets/Microchip/POLARFIRE_ICICLE_RENODE/build/app/polarfire_icicle_demo.elf
echo "[OK] PolarFire SampleX demo ELF verified."
- name: Archive Built PolarFire ELF
uses: actions/upload-artifact@v4
with:
name: polarfire-demo-elf
path: targets/Microchip/POLARFIRE_ICICLE_RENODE/build/app/polarfire_icicle_demo.elf
retention-days: 1
test-polarfire-renode:
name: Headless Renode Emulation & Assertion Test
needs: build-riscv-polarfire
runs-on: ubuntu-24.04
# Backstop in case Renode itself wedges before the in-script deadline fires.
timeout-minutes: 15
env:
RENODE_VERSION: 1.16.1
RENODE_SHA256: 1a532d4b5b82de0dd154970c401e0c7b0e498d17304b2cecc007e306c8f9617c
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
submodules: recursive
- name: Set Up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Download Built PolarFire ELF
uses: actions/download-artifact@v4
with:
name: polarfire-demo-elf
path: targets/Microchip/POLARFIRE_ICICLE_RENODE/build/app
- name: Cache the portable Renode environment
id: cache-renode
uses: actions/cache@v4
with:
path: ~/renode
key: renode-${{ env.RENODE_VERSION }}-linux-portable
- name: Install Pinned Portable Renode Emulation Environment
if: steps.cache-renode.outputs.cache-hit != 'true'
run: |
set -euo pipefail
TARBALL="renode-${RENODE_VERSION}.linux-portable.tar.gz"
wget -q "https://github.com/renode/renode/releases/download/v${RENODE_VERSION}/${TARBALL}"
echo "${RENODE_SHA256} ${TARBALL}" | sha256sum --check --strict
mkdir -p $HOME/renode
tar -xzf "${TARBALL}" -C $HOME/renode --strip-components=1
rm "${TARBALL}"
- name: Put Renode on PATH
run: echo "$HOME/renode" >> $GITHUB_PATH
- name: Run Deterministic Headless Renode Test
run: |
python3 targets/Microchip/POLARFIRE_ICICLE_RENODE/scripts/test_renode.py
build-arm-nucleo:
name: Build ST Nucleo-F401RE (ARM Cortex-M4)
runs-on: ubuntu-24.04
env:
# Pinned deliberately, as the runner image is: a toolchain upgrade should
# be a reviewable commit rather than something that changes underneath the
# targets. Kept in step with eclipse-threadx/threadx ci_cortex_m.yml, which
# pins the same release for the Cortex-M ports.
# Releases: https://developer.arm.com/downloads/-/arm-gnu-toolchain-downloads
GCC_VERSION: 14.3.rel1
GCC_TARGET: arm-none-eabi
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
submodules: recursive
- name: Install CMake and Ninja
run: |
sudo apt-get update
sudo apt-get install -y cmake ninja-build
- name: Cache the Arm GNU toolchain
id: cache-arm-gcc
uses: actions/cache@v4
with:
path: toolchain
key: arm-gnu-toolchain-${{ env.GCC_VERSION }}-x86_64-${{ env.GCC_TARGET }}
- name: Install the Arm GNU toolchain
if: steps.cache-arm-gcc.outputs.cache-hit != 'true'
run: |
set -eu
base="https://developer.arm.com/-/media/Files/downloads/gnu/${GCC_VERSION}/binrel"
archive="arm-gnu-toolchain-${GCC_VERSION}-x86_64-${GCC_TARGET}.tar.xz"
mkdir -p toolchain && cd toolchain
curl -fsSLO "$base/$archive"
curl -fsSLO "$base/$archive.sha256asc"
sha256sum -c "$archive.sha256asc"
tar xf "$archive"
rm -f "$archive"
- name: Put the toolchain on PATH
run: |
set -eu
echo "$GITHUB_WORKSPACE/toolchain/arm-gnu-toolchain-${GCC_VERSION}-x86_64-${GCC_TARGET}/bin" >> "$GITHUB_PATH"
- name: Report the toolchain version
run: ${{ env.GCC_TARGET }}-gcc --version
- name: Build NUCLEO-F401RE Demo
run: |
bash targets/STMicroelectronics/NUCLEO_F401RE/scripts/build.sh --rebuild
- name: Verify NUCLEO-F401RE Demo ELF
run: |
test -f targets/STMicroelectronics/NUCLEO_F401RE/build/app/nucleo_f401re.elf
echo "[OK] NUCLEO-F401RE demo ELF verified."
- name: Archive Built NUCLEO-F401RE ELF
uses: actions/upload-artifact@v4
with:
name: nucleo-f401re-demo-elf
path: targets/STMicroelectronics/NUCLEO_F401RE/build/app/nucleo_f401re.elf
retention-days: 1
test-nucleo-renode:
name: Headless Renode Emulation & Assertion Test (NUCLEO-F401RE)
needs: build-arm-nucleo
runs-on: ubuntu-24.04
env:
RENODE_VERSION: 1.16.1
RENODE_SHA256: 1a532d4b5b82de0dd154970c401e0c7b0e498d17304b2cecc007e306c8f9617c
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
submodules: recursive
- name: Set Up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Download Built NUCLEO-F401RE ELF
uses: actions/download-artifact@v4
with:
name: nucleo-f401re-demo-elf
path: targets/STMicroelectronics/NUCLEO_F401RE/build/app
- name: Cache the portable Renode environment
id: cache-renode
uses: actions/cache@v4
with:
path: ~/renode
key: renode-${{ env.RENODE_VERSION }}-linux-portable
- name: Install Pinned Portable Renode Emulation Environment
if: steps.cache-renode.outputs.cache-hit != 'true'
run: |
set -euo pipefail
TARBALL="renode-${RENODE_VERSION}.linux-portable.tar.gz"
wget -q "https://github.com/renode/renode/releases/download/v${RENODE_VERSION}/${TARBALL}"
echo "${RENODE_SHA256} ${TARBALL}" | sha256sum --check --strict
mkdir -p $HOME/renode
tar -xzf "${TARBALL}" -C $HOME/renode --strip-components=1
rm "${TARBALL}"
- name: Put Renode on PATH
run: echo "$HOME/renode" >> $GITHUB_PATH
- name: Run Deterministic Headless Renode Test
run: |
python3 targets/STMicroelectronics/NUCLEO_F401RE/scripts/test_renode.py