diff --git a/.github/scripts/github-test-Cargo.toml b/.github/scripts/github-test-Cargo.toml new file mode 100644 index 00000000..c472a060 --- /dev/null +++ b/.github/scripts/github-test-Cargo.toml @@ -0,0 +1,15 @@ +[package] +name = "cargo-binstall" +description = "Rust binary package installer for CI integration" +repository = "https://github.com/cargo-bins/cargo-binstall" +version = "0.12.0" +rust-version = "1.61.0" +authors = ["ryan "] +edition = "2021" +license = "GPL-3.0" + +[package.metadata.binstall] +bin-dir = "{ bin }{ binary-ext }" + +[[bin]] +name = "cargo-binstall" diff --git a/.github/scripts/tests.sh b/.github/scripts/tests.sh index 98dbf9b9..40ee853c 100755 --- a/.github/scripts/tests.sh +++ b/.github/scripts/tests.sh @@ -2,28 +2,28 @@ set -euxo pipefail -bins="cargo-llvm-cov cargo-binstall" -test_bins="cargo-llvm-cov" - unset CARGO_INSTALL_ROOT unset CARGO_HOME # Install binaries using cargo-binstall # shellcheck disable=SC2086 -"./$1" binstall --log-level debug --no-confirm $bins +"./$1" binstall --log-level debug --no-confirm b3sum cargo-binstall # Test that the installed binaries can be run -for bin in $test_bins; do - "$HOME/.cargo/bin/$bin" --version -done +b3sum --version +cargo-binstall --help >/dev/null cargo binstall --help >/dev/null +test_resources=".github/scripts" + # Install binaries using `--manifest-path` -"./$1" binstall --force --log-level debug --manifest-path crates/bin/Cargo.toml --no-confirm cargo-binstall -"./$1" binstall --force --log-level debug --manifest-path crates/bin --no-confirm cargo-binstall +"./$1" binstall --force --log-level debug --manifest-path "$test_resources/gitlab-test-Cargo.toml" --no-confirm cargo-binstall # Test that the installed binaries can be run cargo binstall --help >/dev/null +# FIXME: test this some other way that is not dependent on the version being published! +# "./$1" binstall --force --log-level debug --manifest-path crates/bin --no-confirm cargo-binstall + min_tls=1.3 [[ "${2:-}" == "Windows" ]] && min_tls=1.2 # WinTLS on GHA doesn't support 1.3 yet @@ -57,8 +57,8 @@ cargo binstall --help >/dev/null "./$1" binstall --no-confirm cargo-binstall@0.12.0 | grep -q 'cargo-binstall v0.12.0 is already installed' "./$1" binstall --no-confirm cargo-binstall@^0.12.0 | grep -q -v 'cargo-binstall v0.12.0 is already installed' -# Test default GitLab pkg-url templates -test_resources=".github/scripts" +# to force failure if falling back to source +# FIXME: remove/replace once #136 lands PATH="$test_resources/fake-cargo:$PATH" "./$1" binstall \ diff --git a/Cargo.lock b/Cargo.lock index dbd172a7..03408042 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -188,7 +188,7 @@ dependencies = [ [[package]] name = "cargo-binstall" -version = "0.12.0" +version = "0.13.0" dependencies = [ "binstalk", "clap", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index c8884340..52299fc3 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -3,7 +3,7 @@ name = "cargo-binstall" description = "Rust binary package installer for CI integration" repository = "https://github.com/ryankurte/cargo-binstall" documentation = "https://docs.rs/cargo-binstall" -version = "0.12.0" +version = "0.13.0" rust-version = "1.61.0" authors = ["ryan "] edition = "2021" diff --git a/crates/bin/windows.manifest b/crates/bin/windows.manifest index b7f74dd9..098c42d7 100644 --- a/crates/bin/windows.manifest +++ b/crates/bin/windows.manifest @@ -3,7 +3,7 @@