9393 uses : dtolnay/rust-toolchain@master
9494 with :
9595 toolchain : ${{ matrix.toolchain || inputs.rust-toolchain }}
96- target : ${{ matrix.target }}
97- components : ${{ matrix.components || 'rustfmt, clippy' }}
96+ targets : ${{ matrix.build-std && 'x86_64-unknown-linux-gnu' || matrix.target }}
97+ components : ${{ matrix.components || matrix.build-std && 'rustfmt,clippy,rust-src' || 'rustfmt, clippy' }}
9898
9999 - name : Cache Docker images for cross
100100 if : matrix.tool == 'cross'
@@ -105,7 +105,9 @@ jobs:
105105 - name : Install cross-compilation tools
106106 if : matrix.tool == 'cross'
107107 run : |
108- rustup target add ${TARGET}
108+ if [ "${{ matrix.build-std }}" != "true" ]; then
109+ rustup target add ${TARGET}
110+ fi
109111 cargo install cross --git https://github.com/cross-rs/cross --force
110112 env :
111113 TARGET : ${{ matrix.target }}
@@ -134,7 +136,7 @@ jobs:
134136 with :
135137 tool : ${{ matrix.tool }}
136138 command : clippy
137- args : --all --target ${{ matrix.target }} ${{ matrix.extra-args }} -- -D warnings
139+ args : --all --target ${{ matrix.target }} ${{ matrix.build-std && '-Z build-std=std,panic_abort' || '' }} ${{ matrix. extra-args }} -- -D warnings
138140 env :
139141 RUSTFLAGS : ${{ matrix.rustflags }} ${{ inputs.rustflags }}
140142
@@ -158,7 +160,7 @@ jobs:
158160 with :
159161 tool : ${{ matrix.tool }}
160162 command : build
161- args : --workspace --release --target ${{ matrix.target }} ${{ matrix.extra-args }}
163+ args : --workspace --release --target ${{ matrix.target }} ${{ matrix.build-std && '-Z build-std=std,panic_abort' || '' }} ${{ matrix. extra-args }}
162164 env :
163165 RUSTFLAGS : ${{ matrix.rustflags }} ${{ inputs.rustflags }}
164166 CROSS_BUILD_ZIG : ${{ matrix.zig }}
0 commit comments