From be3aeca6b27c1163389167be29f4555425b0bf66 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Wed, 5 Jun 2024 23:36:32 +1000 Subject: [PATCH] Add e2e-test/private-github-repo Signed-off-by: Jiahao XU --- .../private-github-repo-test-Cargo.toml | 13 ++++++++++++ e2e-tests/private-github-repo.sh | 21 +++++++++++++++++++ justfile | 3 ++- 3 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 e2e-tests/manifests/private-github-repo-test-Cargo.toml create mode 100755 e2e-tests/private-github-repo.sh diff --git a/e2e-tests/manifests/private-github-repo-test-Cargo.toml b/e2e-tests/manifests/private-github-repo-test-Cargo.toml new file mode 100644 index 00000000..cf5cf9e6 --- /dev/null +++ b/e2e-tests/manifests/private-github-repo-test-Cargo.toml @@ -0,0 +1,13 @@ +[package] +name = "cargo-binstall" +description = "Rust binary package installer for CI integration" +repository = "https://github.com/cargo-bins/private-repo-for-testing" +version = "0.12.0" +rust-version = "1.61.0" +authors = ["ryan "] +edition = "2021" +license = "GPL-3.0" + +[[bin]] +name = "cargo-binstall" +path = "src/main.rs" diff --git a/e2e-tests/private-github-repo.sh b/e2e-tests/private-github-repo.sh new file mode 100755 index 00000000..e0050101 --- /dev/null +++ b/e2e-tests/private-github-repo.sh @@ -0,0 +1,21 @@ +#!/bin/bash + +set -euxo pipefail + +unset CARGO_INSTALL_ROOT + +CARGO_HOME=$(mktemp -d 2>/dev/null || mktemp -d -t 'cargo-home') +export CARGO_HOME +export PATH="$CARGO_HOME/bin:$PATH" + +# Install binaries using `--manifest-path` +# Also test default github template +"./$1" binstall --force --manifest-path "manifests/private-github-repo-test-Cargo.toml" --no-confirm cargo-binstall --strategies crate-meta-data + +# Test that the installed binaries can be run +cargo binstall --help >/dev/null + +cargo_binstall_version="$(cargo binstall -V)" +echo "$cargo_binstall_version" + +[ "$cargo_binstall_version" = "cargo-binstall 0.12.0" ] diff --git a/justfile b/justfile index b68488b8..d80759d0 100644 --- a/justfile +++ b/justfile @@ -248,6 +248,7 @@ e2e-test-git: (e2e-test "git") e2e-test-registries: (e2e-test "registries") e2e-test-signing: (e2e-test "signing") e2e-test-continue-on-failure: (e2e-test "continue-on-failure") +e2e-test-private-github-repo: (e2e-test "private-github-repo") # WinTLS (Windows in CI) does not have TLS 1.3 support [windows] @@ -256,7 +257,7 @@ e2e-test-tls: (e2e-test "tls" "1.2") [macos] e2e-test-tls: (e2e-test "tls" "1.2") (e2e-test "tls" "1.3") -e2e-tests: e2e-test-live e2e-test-manifest-path e2e-test-git e2e-test-other-repos e2e-test-strategies e2e-test-version-syntax e2e-test-upgrade e2e-test-tls e2e-test-self-upgrade-no-symlink e2e-test-uninstall e2e-test-subcrate e2e-test-no-track e2e-test-registries e2e-test-signing e2e-test-continue-on-failure +e2e-tests: e2e-test-live e2e-test-manifest-path e2e-test-git e2e-test-other-repos e2e-test-strategies e2e-test-version-syntax e2e-test-upgrade e2e-test-tls e2e-test-self-upgrade-no-symlink e2e-test-uninstall e2e-test-subcrate e2e-test-no-track e2e-test-registries e2e-test-signing e2e-test-continue-on-failure e2e-test-private-github-repo unit-tests: print-env {{cargo-bin}} test {{cargo-build-args}}