Skip to content

Commit 642629a

Browse files
committed
[ci] Use riscv32imac-unknown-none-elf toolchain for no_std check
1 parent 56b3fbf commit 642629a

2 files changed

Lines changed: 16 additions & 8 deletions

File tree

.github/scripts/check_no_std.sh

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,17 @@ no_std_packages=(
88
commonware-storage
99
)
1010

11-
target="thumbv7em-none-eabihf"
11+
target="riscv32imac-unknown-none-elf"
12+
image="ghcr.io/commonwarexyz/monorepo/rust-riscv32imac-cross@sha256:652f5ff21c943935bc1caf7cf0c65b38127381c66b423f70f86dc7785d93ce85"
1213
base_rustflags="${RUSTFLAGS:-}"
1314

1415
for package in "${no_std_packages[@]}"; do
15-
build_cmd=(cargo build -p "$package" --no-default-features --target "$target" --release)
16+
# TEMP: Before merging, use commonware's image.
17+
build_cmd=(docker run \
18+
--rm \
19+
-v `pwd`:/workdir \
20+
-w="/workdir" \
21+
"$image" cargo +nightly build -p "$package" -Zbuild-std=core,alloc --no-default-features --target "$target" --release)
1622
pretty_cmd="${build_cmd[*]}"
1723
if [ -n "$CI" ]; then
1824
echo "::group::${pretty_cmd}"

.github/workflows/fast.yml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -170,18 +170,20 @@ jobs:
170170

171171
no_std:
172172
runs-on: ubuntu-latest
173+
permissions:
174+
packages: read
173175
timeout-minutes: 30
174176
steps:
175177
- name: Checkout repository
176178
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4
177179
- name: Run setup
178180
uses: ./.github/actions/setup
179-
- name: Add minimal no_std target
180-
run: rustup target add thumbv7em-none-eabihf
181-
- name: Install ARM bare-metal toolchain (required to compile C from x86 worker)
182-
run: |
183-
sudo apt-get update
184-
sudo apt-get install -y gcc-arm-none-eabi
181+
- name: Authenticate with container registry
182+
uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3.6.0
183+
with:
184+
registry: ghcr.io
185+
username: ${{ github.actor }}
186+
password: ${{ secrets.GITHUB_TOKEN }}
185187
- name: Check no_std compatibility
186188
run: ./.github/scripts/check_no_std.sh
187189

0 commit comments

Comments
 (0)