#!/bin/sh -eux export AWS_DEFAULT_REGION=us-east-1 aws s3 cp s3://smith-artefacts/cache/smith-rs-cache.tar.gz smith-rs-cache.tar.gz || true tar xfz smith-rs-cache.tar.gz -C $CARGO_HOME || true rm -f smith-rs-cache.tar.gz aws s3 cp s3://smith-artefacts/cache/smith-rs-toolchain-cache.tar.gz smith-rs-toolchain-cache.tar.gz || true tar xfz smith-rs-toolchain-cache.tar.gz -C $RUSTUP_HOME || true rm -f smith-rs-tookchain-cache.tar.gz aws s3 cp s3://smith-artefacts/cache/smith-rs-target-cache.tar.gz smith-rs-target-cache.tar.gz || true tar xfz smith-rs-target-cache.tar.gz || true rm -f smith-rs-target-cache.tar.gz aws s3 cp s3://smith-artefacts/cache/smith-mock-rs-target-cache.tar.gz smith-mock-rs-target-cache.tar.gz || true tar xfz smith-mock-rs-target-cache.tar.gz -C mock-server || true rm -f smith-mock-rs-target-cache.tar.gz (cd mock-server && cargo build) || exit $? cargo build tar cfz smith-rs-cache.tar.gz -C $CARGO_HOME registry aws s3 cp smith-rs-cache.tar.gz s3://smith-artefacts/cache/smith-rs-cache.tar.gz tar cfz smith-rs-toolchain-cache.tar.gz -C $RUSTUP_HOME toolchains aws s3 cp smith-rs-toolchain-cache.tar.gz s3://smith-artefacts/cache/smith-rs-toolchain-cache.tar.gz tar cfz smith-rs-target-cache.tar.gz target aws s3 cp smith-rs-target-cache.tar.gz s3://smith-artefacts/cache/smith-rs-target-cache.tar.gz tar cfz smith-mock-rs-target-cache.tar.gz -C mock-server target aws s3 cp smith-mock-rs-target-cache.tar.gz s3://smith-artefacts/cache/smith-mock-rs-target-cache.tar.gz ./mock-server/target/debug/mock-server & cargo test