Skip to content

Commit bba3b91

Browse files
authored
Pinned the NUCLEO Renode download and cached every toolchain fetch (#55)
Two problems in the pipeline, one of them mine. The NUCLEO Renode job fetched renode-latest.linux-portable.tar.gz with no version pin and no checksum, while the PolarFire job three jobs above it already pinned Renode 1.16.1 and verified its SHA256. That pin landed in #49, so it was present in this file when #51 added the NUCLEO job; the new job was modelled on an older copy of the PolarFire step rather than the current one. The result was a suite whose emulator could change under it on any Renode release, with nothing verifying what was downloaded. The NUCLEO job now uses the same pinned, checksum-verified step as PolarFire. The checksum was recomputed from the published artefact rather than copied on trust. Separately, every run re-downloaded roughly a gigabyte: the xPack RISC-V toolchain at ~414 MB and Renode at ~52 MB in each of two jobs. All three are now restored by actions/cache, keyed on the pinned version so a future bump invalidates the cache instead of silently serving the old one. This completes what #53 started for the Arm toolchain. Caching only makes sense because these are now pinned. Caching an unpinned "latest" artefact would have frozen CI on whichever build happened to be fetched first, turning a reproducibility gap into an invisible one. All four jobs now follow the same shape: cache, install only on a cache miss, then put the tool on PATH as a separate step so it runs on hit and miss alike. The PolarFire job also gains a version-reporting step, matching the Arm job, so the log records which compiler produced the ELF. Verified both constructed download URLs resolve, and that the Renode 1.16.1 checksum matches the published artefact. Assisted-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
1 parent a166e86 commit bba3b91

1 file changed

Lines changed: 59 additions & 15 deletions

File tree

.github/workflows/ci.yml

Lines changed: 59 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,12 @@ jobs:
2121
name: Build PolarFire SoC Icicle Kit (64-Bit RISC-V)
2222
runs-on: ubuntu-24.04
2323
timeout-minutes: 20
24+
25+
env:
26+
XPACK_VERSION: 14.3.0-1
27+
XPACK_TARBALL: xpack-riscv-none-elf-gcc-14.3.0-1-linux-x64.tar.gz
28+
XPACK_SHA256: be1768ef22789f4d9c41384e0261996f51724b84c2efa940d975dd7d9938c726
29+
2430
steps:
2531
- name: Checkout Repository
2632
uses: actions/checkout@v4
@@ -32,18 +38,28 @@ jobs:
3238
sudo apt-get update
3339
sudo apt-get install -y cmake ninja-build
3440
35-
- name: Install Pinned xPack RISC-V GCC 14.3.0
36-
env:
37-
XPACK_TARBALL: xpack-riscv-none-elf-gcc-14.3.0-1-linux-x64.tar.gz
38-
XPACK_SHA256: be1768ef22789f4d9c41384e0261996f51724b84c2efa940d975dd7d9938c726
41+
- name: Cache the xPack RISC-V toolchain
42+
id: cache-xpack
43+
uses: actions/cache@v4
44+
with:
45+
path: ~/riscv-gcc
46+
key: xpack-riscv-none-elf-gcc-${{ env.XPACK_VERSION }}-linux-x64
47+
48+
- name: Install Pinned xPack RISC-V GCC
49+
if: steps.cache-xpack.outputs.cache-hit != 'true'
3950
run: |
4051
set -euo pipefail
41-
wget -q "https://github.com/xpack-dev-tools/riscv-none-elf-gcc-xpack/releases/download/v14.3.0-1/${XPACK_TARBALL}"
52+
wget -q "https://github.com/xpack-dev-tools/riscv-none-elf-gcc-xpack/releases/download/v${XPACK_VERSION}/${XPACK_TARBALL}"
4253
echo "${XPACK_SHA256} ${XPACK_TARBALL}" | sha256sum --check --strict
4354
mkdir -p $HOME/riscv-gcc
4455
tar -xzf "${XPACK_TARBALL}" -C $HOME/riscv-gcc --strip-components=1
4556
rm "${XPACK_TARBALL}"
46-
echo "$HOME/riscv-gcc/bin" >> $GITHUB_PATH
57+
58+
- name: Put the RISC-V toolchain on PATH
59+
run: echo "$HOME/riscv-gcc/bin" >> $GITHUB_PATH
60+
61+
- name: Report the toolchain version
62+
run: riscv-none-elf-gcc --version
4763

4864
- name: Build SampleX PolarFire Condition-Monitoring Demo
4965
run: |
@@ -67,6 +83,10 @@ jobs:
6783
runs-on: ubuntu-24.04
6884
# Backstop in case Renode itself wedges before the in-script deadline fires.
6985
timeout-minutes: 15
86+
env:
87+
RENODE_VERSION: 1.16.1
88+
RENODE_SHA256: 1a532d4b5b82de0dd154970c401e0c7b0e498d17304b2cecc007e306c8f9617c
89+
7090
steps:
7191
- name: Checkout Repository
7292
uses: actions/checkout@v4
@@ -84,10 +104,15 @@ jobs:
84104
name: polarfire-demo-elf
85105
path: targets/Microchip/POLARFIRE_ICICLE_RENODE/build/app
86106

107+
- name: Cache the portable Renode environment
108+
id: cache-renode
109+
uses: actions/cache@v4
110+
with:
111+
path: ~/renode
112+
key: renode-${{ env.RENODE_VERSION }}-linux-portable
113+
87114
- name: Install Pinned Portable Renode Emulation Environment
88-
env:
89-
RENODE_VERSION: 1.16.1
90-
RENODE_SHA256: 1a532d4b5b82de0dd154970c401e0c7b0e498d17304b2cecc007e306c8f9617c
115+
if: steps.cache-renode.outputs.cache-hit != 'true'
91116
run: |
92117
set -euo pipefail
93118
TARBALL="renode-${RENODE_VERSION}.linux-portable.tar.gz"
@@ -96,7 +121,9 @@ jobs:
96121
mkdir -p $HOME/renode
97122
tar -xzf "${TARBALL}" -C $HOME/renode --strip-components=1
98123
rm "${TARBALL}"
99-
echo "$HOME/renode" >> $GITHUB_PATH
124+
125+
- name: Put Renode on PATH
126+
run: echo "$HOME/renode" >> $GITHUB_PATH
100127

101128
- name: Run Deterministic Headless Renode Test
102129
run: |
@@ -174,6 +201,10 @@ jobs:
174201
name: Headless Renode Emulation & Assertion Test (NUCLEO-F401RE)
175202
needs: build-arm-nucleo
176203
runs-on: ubuntu-24.04
204+
env:
205+
RENODE_VERSION: 1.16.1
206+
RENODE_SHA256: 1a532d4b5b82de0dd154970c401e0c7b0e498d17304b2cecc007e306c8f9617c
207+
177208
steps:
178209
- name: Checkout Repository
179210
uses: actions/checkout@v4
@@ -191,13 +222,26 @@ jobs:
191222
name: nucleo-f401re-demo-elf
192223
path: targets/STMicroelectronics/NUCLEO_F401RE/build/app
193224

194-
- name: Install Portable Renode Emulation Environment
225+
- name: Cache the portable Renode environment
226+
id: cache-renode
227+
uses: actions/cache@v4
228+
with:
229+
path: ~/renode
230+
key: renode-${{ env.RENODE_VERSION }}-linux-portable
231+
232+
- name: Install Pinned Portable Renode Emulation Environment
233+
if: steps.cache-renode.outputs.cache-hit != 'true'
195234
run: |
196-
wget -q https://builds.renode.io/renode-latest.linux-portable.tar.gz
235+
set -euo pipefail
236+
TARBALL="renode-${RENODE_VERSION}.linux-portable.tar.gz"
237+
wget -q "https://github.com/renode/renode/releases/download/v${RENODE_VERSION}/${TARBALL}"
238+
echo "${RENODE_SHA256} ${TARBALL}" | sha256sum --check --strict
197239
mkdir -p $HOME/renode
198-
tar -xzf renode-latest.linux-portable.tar.gz -C $HOME/renode --strip-components=1
199-
rm renode-latest.linux-portable.tar.gz
200-
echo "$HOME/renode" >> $GITHUB_PATH
240+
tar -xzf "${TARBALL}" -C $HOME/renode --strip-components=1
241+
rm "${TARBALL}"
242+
243+
- name: Put Renode on PATH
244+
run: echo "$HOME/renode" >> $GITHUB_PATH
201245

202246
- name: Run Deterministic Headless Renode Test
203247
run: |

0 commit comments

Comments
 (0)