jeset 1.0.4

Opinionated, ready to use color-eyre and tracing-journald setup for applications
Documentation
#!/usr/bin/env bash

set -euo pipefail

export CI="true" # https://insta.rs/docs/quickstart/#continuous-integration

sysinfo() {
    echo "System information:"
    uname -a
    rustc --version
    cargo --version
    echo "CARGO_HOME=${CARGO_HOME}"
    echo "---"
    echo "Environment variables:"
    printenv | sort
}

install_test_deps() {
    echo "Initialising test dependencies"
    apt-get update -yq
    apt-get install -yq --no-install-recommends wireguard-tools
}

lint() {
    echo "Linting"
    rustup component add clippy
    cargo clippy --all-features -- --deny warnings
}

tests() {
    echo "Testing"
    install_test_deps
    cargo test
    cargo test -- --ignored # slow tests
}

build() {
    cargo build
}

main() {
    sysinfo
    build
    lint
    tests
}

main "$@"