cargo-binstall/e2e-tests/subcrate.sh
Jiahao XU 9cf7b15df8
CI: Use runner macos-14 which uses M1 machine (#1590)
* CI: Use runner `macos-14` which uses M1 machine

`macos-14` provides 3-core M1, 7G mem and 14G stroage, while `macos-latest`
(`macos-13` as of writing) provides 4-core intel, 14G mem and 14G
storage.

While the memory is cut by half and core count reduce by 1, I believe
that it would still speedup the CI since M1 is much more powerful than
previous Intel CPU used in `macos-13`.

It would also allow us to run tests on aarch64-apple-darwin and on
universal-apple-darwin, if necessary.

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>

* CI: Fix `e2e-test-subcrate`: Bump `cargo-audit` ver to v0.18.3

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>

---------

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2024-01-31 14:26:57 +00:00

22 lines
586 B
Bash
Executable file

#!/bin/bash
set -euxo pipefail
unset CARGO_INSTALL_ROOT
CARGO_HOME=$(mktemp -d 2>/dev/null || mktemp -d -t 'cargo-home')
export CARGO_HOME
othertmpdir=$(mktemp -d 2>/dev/null || mktemp -d -t 'cargo-test')
export PATH="$CARGO_HOME/bin:$othertmpdir/bin:$PATH"
mkdir -p "$othertmpdir/bin"
# Copy it to bin to test use of env var `CARGO`
cp "./$1" "$othertmpdir/bin/"
# cargo-audit
cargo binstall --no-confirm cargo-audit@0.18.3 --strategies crate-meta-data
cargo_audit_version="$(cargo audit --version)"
echo "$cargo_audit_version"
[ "$cargo_audit_version" = "cargo-audit 0.18.3" ]