aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rw-r--r--scripts/README.md3
-rwxr-xr-xscripts/check-minimal-versions.sh61
-rwxr-xr-xscripts/ci.sh37
3 files changed, 0 insertions, 101 deletions
diff --git a/scripts/README.md b/scripts/README.md
deleted file mode 100644
index 671a9b1..0000000
--- a/scripts/README.md
+++ /dev/null
@@ -1,3 +0,0 @@
-This directory contains scripts used by the developers of this project.
-
-Some scripts in this directory are also used in CI, but scripts intended to be used only in CI and scripts not intended to be used directly by the developers are basically in the `ci` directory.
diff --git a/scripts/check-minimal-versions.sh b/scripts/check-minimal-versions.sh
deleted file mode 100755
index 56fadee..0000000
--- a/scripts/check-minimal-versions.sh
+++ /dev/null
@@ -1,61 +0,0 @@
-#!/bin/bash
-
-# Check all public crates with minimal version dependencies.
-#
-# Usage:
-# bash scripts/check-minimal-versions.sh [+toolchain] [check|test]
-#
-# Note:
-# - This script modifies Cargo.toml and Cargo.lock while running
-# - This script exits with 1 if there are any unstaged changes
-# - This script requires nightly Rust and cargo-hack
-#
-# Refs: https://github.com/rust-lang/cargo/issues/5657
-
-set -euo pipefail
-IFS=$'\n\t'
-
-cd "$(cd "$(dirname "${0}")" && pwd)"/..
-
-# Decide Rust toolchain.
-# Nightly is used by default if the `CI` environment variable is unset.
-if [[ "${1:-}" == "+"* ]]; then
- toolchain="${1}"
- shift
-elif [[ -z "${CI:-}" ]]; then
- toolchain="+nightly"
-fi
-# Make sure toolchain is installed.
-cargo ${toolchain:-} -V >/dev/null
-# This script requires nightly Rust and cargo-hack
-if [[ "${toolchain:-+nightly}" != "+nightly"* ]] || ! cargo hack -V &>/dev/null; then
- echo "error: check-minimal-versions.sh requires nightly Rust and cargo-hack"
- exit 1
-fi
-
-# Parse subcommand.
-subcmd="${1:-check}"
-if [[ ! "${subcmd}" =~ ^(check|test)$ ]]; then
- echo "error: invalid argument: ${1}"
- exit 1
-elif [[ -n "${2:-}" ]]; then
- echo "error: invalid argument: ${2}"
- exit 1
-fi
-
-# This script modifies Cargo.toml and Cargo.lock, so make sure there are no
-# unstaged changes.
-git diff --exit-code
-# Restore original Cargo.toml and Cargo.lock on exit.
-trap 'git checkout .' EXIT
-
-if [[ "${subcmd}" == "check" ]]; then
- # Remove dev-dependencies from Cargo.toml to prevent the next `cargo update`
- # from determining minimal versions based on dev-dependencies.
- cargo hack --remove-dev-deps --workspace
-fi
-
-# Update Cargo.lock to minimal version dependencies.
-cargo ${toolchain:-} update -Z minimal-versions
-# Run check for all public members of the workspace.
-cargo ${toolchain:-} hack "${subcmd}" --workspace --all-features --ignore-private -Z features=all
diff --git a/scripts/ci.sh b/scripts/ci.sh
deleted file mode 100755
index b6a1a74..0000000
--- a/scripts/ci.sh
+++ /dev/null
@@ -1,37 +0,0 @@
-#!/bin/bash
-
-# A script to run a simplified version of the checks done by CI.
-#
-# Usage:
-# bash scripts/ci.sh
-#
-# Note: This script requires nightly Rust, rustfmt, clippy, and cargo-expand
-
-set -euo pipefail
-IFS=$'\n\t'
-
-# Decide Rust toolchain. Nightly is used by default.
-toolchain="+nightly"
-if [[ "${1:-}" == "+"* ]]; then
- toolchain="${1}"
- shift
-fi
-# Make sure toolchain is installed.
-cargo "${toolchain}" -V >/dev/null
-
-if [[ "${toolchain:-+nightly}" != "+nightly"* ]] || ! rustfmt -V &>/dev/null || ! cargo clippy -V &>/dev/null || ! cargo expand -V &>/dev/null; then
- echo "error: ci.sh requires nightly Rust, rustfmt, clippy, and cargo-expand"
- exit 1
-fi
-
-echo "Running 'cargo ${toolchain} fmt --all'"
-cargo "${toolchain}" fmt --all
-
-echo "Running 'cargo ${toolchain} clippy --all --all-targets'"
-cargo "${toolchain}" clippy --all --all-features --all-targets -Z unstable-options
-
-echo "Running 'cargo ${toolchain} test --all'"
-cargo "${toolchain}" test --all --all-features
-
-echo "Running 'cargo ${toolchain} doc --no-deps --all'"
-cargo "${toolchain}" doc --no-deps --all --all-features