diff --git a/ci/README.md b/ci/README.md index cc6f1f4..9711b0c 100644 --- a/ci/README.md +++ b/ci/README.md @@ -35,7 +35,7 @@ And for each crate there should exist a directory `REPO_DIR/CRATE/contrib/` cont If the repository is not a workspace then per crate files go directly in `REPO_ROOT/contrib/`. -(See [Crates`](#crates) below.) +(See [Crates](#crates) below.) ## Lock file @@ -102,22 +102,22 @@ EXAMPLES="" #### The `EXAMPLES` variable ```bash -EXAPMLES="example:feature" +EXAMPLES="example:feature" ``` ```bash -EXAPMLES="example:feature1,feature2" +EXAMPLES="example:feature1,feature2" ``` ```bash -EXAPMLES="example_a:feature1,feature2 example_b:feature1" +EXAMPLES="example_a:feature1,feature2 example_b:feature1" ``` Tip: if your example does not require any features consider using "default". ```bash -EXAPMLES="example_a:default" +EXAMPLES="example_a:default" ``` ### Additional crate specific tests @@ -212,8 +212,7 @@ jobs: - name: "Checkout maintainer tools" uses: actions/checkout@v4 with: - repository: tcharding/rust-bitcoin-maintainer-tools - ref: 05-02-ci + repository: rust-bitcoin/rust-bitcoin-maintainer-tools path: maintainer-tools - name: "Select toolchain" uses: dtolnay/rust-toolchain@v1 diff --git a/ci/run_task.sh b/ci/run_task.sh index ebe4ea2..c05c157 100755 --- a/ci/run_task.sh +++ b/ci/run_task.sh @@ -5,15 +5,23 @@ # Shellcheck can't search dynamic paths # shellcheck source=/dev/null -set -euox pipefail +set -euo pipefail REPO_DIR=$(git rev-parse --show-toplevel) -# Make all cargo invocations verbose. -export CARGO_TERM_VERBOSE=true - -# Set to false to turn off verbose output. -flag_verbose=true +# Make cargo invocations verbose unless in quiet mode. +# Also control bash debug output based on log level. +case "${MAINTAINER_TOOLS_LOG_LEVEL:-verbose}" in + quiet) + export CARGO_TERM_VERBOSE=false + export CARGO_TERM_QUIET=true + ;; + *) + export CARGO_TERM_VERBOSE=true + export CARGO_TERM_QUIET=false + set -x + ;; +esac # Use the current `Cargo.lock` file without updating it. cargo="cargo --locked" @@ -22,7 +30,7 @@ usage() { cat < /dev/null if [ -e ./contrib/extra_lints.sh ]; then - ./contrib/extra_lints.sh + . ./contrib/extra_lints.sh fi popd > /dev/null done @@ -285,7 +298,7 @@ do_dup_deps() { if [ "$duplicate_dependencies" -ne 0 ]; then cargo tree --target=all --all-features --duplicates - say_err "Dependency tree is broken, contains duplicates" + err "Dependency tree is broken, contains duplicates" fi set -o pipefail @@ -332,14 +345,15 @@ say() { echo "run_task: $1" } -say_err() { - say "$1" >&2 -} - verbose_say() { - if [ "$flag_verbose" = true ]; then - say "$1" - fi + case "${MAINTAINER_TOOLS_LOG_LEVEL:-verbose}" in + quiet) + # Suppress verbose output. + ;; + *) + say "$1" + ;; + esac } err() {