2023-08-09 23:48:02 +00:00
|
|
|
#!/usr/bin/env bash
|
2020-11-10 23:36:07 +00:00
|
|
|
|
2022-07-22 01:30:53 +00:00
|
|
|
set -ex
|
2022-03-16 23:57:30 +00:00
|
|
|
|
2023-08-09 23:16:23 +00:00
|
|
|
REPO_DIR=$(git rev-parse --show-toplevel)
|
2023-07-20 01:00:34 +00:00
|
|
|
DEPS="recent minimal"
|
2020-11-10 23:36:07 +00:00
|
|
|
|
2023-07-21 01:39:08 +00:00
|
|
|
# Webassembly stuff
|
|
|
|
#
|
|
|
|
# The wasm-pack command does not correctly pass args to cargo so we cannot use --locked and test
|
|
|
|
# with per-commited lockfiles (recent/minimal). Just run the WASM tests from here instead.
|
|
|
|
if [ "$DO_WASM" = true ]; then
|
|
|
|
clang --version
|
|
|
|
CARGO_TARGET_DIR=wasm cargo install --force wasm-pack
|
|
|
|
printf '\n[lib]\ncrate-type = ["cdylib", "rlib"]\n' >> Cargo.toml
|
|
|
|
CC=clang wasm-pack build
|
|
|
|
CC=clang wasm-pack test --node
|
|
|
|
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
2023-07-20 01:00:34 +00:00
|
|
|
for dep in $DEPS
|
|
|
|
do
|
|
|
|
cp "Cargo-$dep.lock" Cargo.lock
|
|
|
|
$REPO_DIR/contrib/_test.sh
|
|
|
|
|
|
|
|
if [ "$dep" = recent ];
|
|
|
|
then
|
|
|
|
# We always test committed dependencies but we want to warn if they could've been updated
|
|
|
|
cargo update
|
|
|
|
if diff Cargo-recent.lock Cargo.lock;
|
|
|
|
then
|
|
|
|
echo "Dependencies are up to date"
|
|
|
|
else
|
|
|
|
echo "::warning file=Cargo-recent.lock::Dependencies could be updated"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
|
|
|
exit 0
|