| 1 | #!/bin/sh |
| 2 | |
| 3 | # Script to be run by the `ci.yml` workflow for -BSD jobs based on the target. |
| 4 | |
| 5 | set -eu |
| 6 | |
| 7 | BSD_TARGET="${1:-}" |
| 8 | |
| 9 | if [ -z "$BSD_TARGET" ]; then |
| 10 | echo "Error: BSD target must be specified." |
| 11 | exit 1 |
| 12 | fi |
| 13 | |
| 14 | if [ "$BSD_TARGET" = "x86_64-unknown-freebsd" ]; then |
| 15 | pkg install -y curl bash |
| 16 | curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs --output rustup.sh |
| 17 | sh rustup.sh --default-toolchain stable -y |
| 18 | |
| 19 | . "$HOME/.cargo/env" |
| 20 | cargo test --no-fail-fast --locked --features generate_schema -- --nocapture --quiet |
| 21 | elif [ "$BSD_TARGET" = "x86_64-unknown-netbsd" ]; then |
| 22 | /usr/sbin/pkg_add -u curl bash mozilla-rootcerts-openssl |
| 23 | curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs --output rustup.sh |
| 24 | sh rustup.sh --default-toolchain stable -y |
| 25 | |
| 26 | . "$HOME/.cargo/env" |
| 27 | # TODO: Support default features eventually? |
| 28 | cargo test --no-fail-fast --locked --no-default-features -- --nocapture --quiet --skip test_data_collection |
| 29 | else |
| 30 | echo "Unsupported BSD target type." |
| 31 | exit 1 |
| 32 | fi |