mirror of
https://github.com/cargo-bins/cargo-binstall.git
synced 2025-04-22 21:48:42 +00:00
Fix unit test & integration CI and the release CI (#469)
* Fix integration test: Make sure `cargo build cargo-binstall` would not fail due to binary already present * Disable feature `zlib-ng` for release build * Disable build-std for release build on aarch64-unknown-linux-gnu * Fix clippy warning in unit test CI * Fix compile-settings.jq * Fix caching: Rm `restores-keys` Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
This commit is contained in:
parent
5d51541dcf
commit
98b62251ad
4 changed files with 18 additions and 12 deletions
16
.github/scripts/compile-settings.jq
vendored
16
.github/scripts/compile-settings.jq
vendored
|
@ -1,10 +1,18 @@
|
||||||
|
if $matrix.target != "aarch64-unknown-linux-gnu" then {
|
||||||
|
# Use build-std to build a std library optimized for size and abort immediately on abort,
|
||||||
|
# so that format string for `unwrap`/`expect`/`unreachable`/`panic` can be optimized out.
|
||||||
|
#
|
||||||
|
# Disable it on aarch64-unknown-linux-gnu as it caused the build to fail.
|
||||||
|
release_build_std_args: "-Z build-std=std,panic_abort -Z build-std-features=panic_immediate_abort"
|
||||||
|
} else {
|
||||||
|
release_build_std_args: ""
|
||||||
|
} end
|
||||||
|
|
|
||||||
if $for_release then {
|
if $for_release then {
|
||||||
output: "release",
|
output: "release",
|
||||||
profile: "release",
|
profile: "release",
|
||||||
# Use build-std to build a std library optimized for size and abort immediately on abort,
|
args: ($matrix.release_build_args // .release_build_std_args),
|
||||||
# so that format string for `unwrap`/`expect`/`unreachable`/`panic` can be optimized out.
|
features: ($matrix.release_features // ["static", "rustls", "trust-dns", "fancy-no-backtrace", "log_release_max_level_debug"]),
|
||||||
args: ($matrix.release_build_args // "-Z build-std=std,panic_abort -Z build-std-features=panic_immediate_abort"),
|
|
||||||
features: ($matrix.release_features // ["zlib-ng", "static", "rustls", "trust-dns", "fancy-no-backtrace", "log_release_max_level_debug"]),
|
|
||||||
} else {
|
} else {
|
||||||
output: "debug",
|
output: "debug",
|
||||||
profile: "dev",
|
profile: "dev",
|
||||||
|
|
8
.github/scripts/tests.sh
vendored
8
.github/scripts/tests.sh
vendored
|
@ -12,15 +12,17 @@ if [ "$2" = "Windows" ]; then
|
||||||
"./$1" --log-level debug --no-confirm $crates
|
"./$1" --log-level debug --no-confirm $crates
|
||||||
else
|
else
|
||||||
export CARGO_HOME=/tmp/cargo-home-for-test
|
export CARGO_HOME=/tmp/cargo-home-for-test
|
||||||
export PATH="$CARGO_HOME/bin:$PATH"
|
export PATH="$CARGO_HOME/bin:/tmp/t/bin:$PATH"
|
||||||
|
|
||||||
mkdir -p "$CARGO_HOME/bin"
|
mkdir -p "/tmp/t/bin"
|
||||||
# Copy it to bin to test use of env var `CARGO`
|
# Copy it to bin to test use of env var `CARGO`
|
||||||
cp "./$1" "$CARGO_HOME/bin/cargo-binstall"
|
cp "./$1" "/tmp/t/bin/cargo-binstall"
|
||||||
|
|
||||||
# Install binaries using cargo-binstall
|
# Install binaries using cargo-binstall
|
||||||
# shellcheck disable=SC2086
|
# shellcheck disable=SC2086
|
||||||
cargo binstall --log-level debug --no-confirm $crates
|
cargo binstall --log-level debug --no-confirm $crates
|
||||||
|
|
||||||
|
rm -r /tmp/t
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Test that the installed binaries can be run
|
# Test that the installed binaries can be run
|
||||||
|
|
4
.github/workflows/build.yml
vendored
4
.github/workflows/build.yml
vendored
|
@ -95,10 +95,6 @@ jobs:
|
||||||
~/.cargo/git/db/
|
~/.cargo/git/db/
|
||||||
target/
|
target/
|
||||||
key: ${{ runner.os }}-cargo-${{ matrix.target }}-${{ hashFiles('**/Cargo.lock') }}-${{ env.COUTPUT }}
|
key: ${{ runner.os }}-cargo-${{ matrix.target }}-${{ hashFiles('**/Cargo.lock') }}-${{ env.COUTPUT }}
|
||||||
restore-keys: |
|
|
||||||
${{ runner.os }}-cargo-${{ matrix.target }}-${{ hashFiles('**/Cargo.lock') }}
|
|
||||||
${{ runner.os }}-cargo-${{ matrix.target }}-
|
|
||||||
${{ runner.os }}-cargo-
|
|
||||||
|
|
||||||
- name: Install musl-tools
|
- name: Install musl-tools
|
||||||
if: ${{ matrix.target == 'x86_64-unknown-linux-musl' }}
|
if: ${{ matrix.target == 'x86_64-unknown-linux-musl' }}
|
||||||
|
|
|
@ -77,7 +77,7 @@ impl UIThreadInner {
|
||||||
self.confirm_rx
|
self.confirm_rx
|
||||||
.recv()
|
.recv()
|
||||||
.await
|
.await
|
||||||
.unwrap_or(Err(BinstallError::UserAbort))
|
.unwrap_or_else(|| Err(BinstallError::UserAbort))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue