Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion .github/actions/setup-rust/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ description: >-
# job that must keep another toolchain as the default says so (`make-default`).
# Moving a toolchain or an environment variable here moves every key and
# discards every cache.
#
# rustup retries a download within seconds, and a download that failed for longer
# turned a job red with nothing wrong in the code (macos-26 on #1483). So the
# install is tried three times, 20 s and 40 s apart. A toolchain that really
# cannot be installed still fails the job, a minute later.
inputs:
toolchain:
description: A rustup toolchain, such as stable, 1.87, nightly-2026-10-01 or nightly
Expand Down Expand Up @@ -49,7 +54,16 @@ runs:
if [ -n "$TARGET" ]; then
args+=(--target "$TARGET")
fi
rustup toolchain install "$TOOLCHAIN" "${args[@]}"
attempt=1
until rustup toolchain install "$TOOLCHAIN" "${args[@]}"; do
if [ "$attempt" -ge 3 ]; then
echo "::error::rustup could not install $TOOLCHAIN in 3 attempts"
exit 1
fi
echo "::warning::rustup could not install $TOOLCHAIN (attempt $attempt of 3); trying again in $((attempt * 20)) s"
sleep "$((attempt * 20))"
attempt=$((attempt + 1))
done
if [ "$MAKE_DEFAULT" = true ]; then
rustup default "$TOOLCHAIN"
fi
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -762,6 +762,8 @@ jobs:
python-version: "3.12"
- name: Install Rust stable
uses: $/.github/actions/setup-rust
with:
component: rustfmt
- uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2.9.3
with:
save-if: false
Expand All @@ -779,7 +781,6 @@ jobs:
# schema; the committed file must be the generator's output.
- name: The IFC4 property set table is the generator's output
run: |
rustup component add rustfmt
python tools/ci/gen_standard_property_sets.py > /tmp/standard_property_sets_table.rs
rustfmt --edition 2024 /tmp/standard_property_sets_table.rs
diff -u src/ifc/standard_property_sets/table.rs /tmp/standard_property_sets_table.rs
Expand Down
Loading