Skip to content

Commit

Permalink
chore(hakari): add dev scripts for check and update
Browse files Browse the repository at this point in the history
  • Loading branch information
snormore committed Jul 4, 2024
1 parent 6aa9592 commit a98e946
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 3 deletions.
1 change: 0 additions & 1 deletion dev/build
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#!/bin/bash
set -eou pipefail
script_dir="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"

set -x
cargo build "$@"
1 change: 1 addition & 0 deletions dev/checks
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
set -eou pipefail

dev/fmt-check
dev/hakari-check
dev/clippy
dev/build
dev/test
22 changes: 22 additions & 0 deletions dev/hakari-check
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/bash
set -eou pipefail

# Install cargo-binstall if necessary
if ! cargo --list | grep -q binstall; then
# The workspace toolchain is using rust 1.77.0, so we need to install a version of
# cargo-binstall that is compatible with that.
cargo install cargo-binstall --version "<1.7.0"
fi

# Install cargo-hakari using cargo binstall if necessary
if ! cargo --list | grep -q hakari; then
cargo binstall cargo-hakari --no-confirm --force
fi

set -x

# Check that workspace-hack Cargo.toml is up-to-date
cargo hakari generate --diff

# Check that all workspace crates depend on workspace-hack
cargo hakari manage-deps --dry-run
18 changes: 18 additions & 0 deletions dev/hakari-update
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/bash
set -eou pipefail

# Install cargo-binstall if necessary
if ! cargo --list | grep -q binstall; then
# The workspace toolchain is using rust 1.77.0, so we need to install a version of
# cargo-binstall that is compatible with that.
cargo install cargo-binstall --version "<1.7.0"
fi

# Install cargo-hakari using cargo binstall if necessary
if ! cargo --list | grep -q hakari; then
cargo binstall cargo-hakari --no-confirm --force
fi

set -x
cargo hakari generate
cargo hakari manage-deps
3 changes: 1 addition & 2 deletions dev/test
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#!/bin/bash
set -eou pipefail
script_dir="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"

# Install cargo-binstall if necessary
if ! cargo --list | grep -q binstall; then
Expand All @@ -11,7 +10,7 @@ fi

# Install cargo-nextest using cargo binstall if necessary
if ! cargo --list | grep -q nextest; then
cargo binstall cargo-nextest --no-confirm
cargo binstall cargo-nextest --no-confirm --force
fi

# Run workspace tests
Expand Down

0 comments on commit a98e946

Please sign in to comment.