From d2dfa5deedee528dbee01c9607dc87899f516f99 Mon Sep 17 00:00:00 2001 From: Ryan Levick Date: Wed, 18 Oct 2023 09:38:35 +0200 Subject: [PATCH] Add make command for updating all lock files Signed-off-by: Ryan Levick --- .github/workflows/build.yml | 2 +- Makefile | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 07f399b4a1..6f57470208 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -38,7 +38,7 @@ jobs: - name: Run lints run: | BUILD_SPIN_EXAMPLES=0 make lint - git diff --name-status --exit-code . || (echo "Git working tree dirtied by lints. Run `make lint` and check in changes" && exit 1) + git diff --name-status --exit-code . || (echo "Git working tree dirtied by lints. Run 'make update-cargo-locks' and check in changes" && exit 1) - name: Cancel everything if linting fails if: failure() diff --git a/Makefile b/Makefile index 108f420bde..2c9a09e508 100644 --- a/Makefile +++ b/Makefile @@ -65,6 +65,16 @@ lint-rust-examples-and-testcases: || exit 1 ; \ done +## Bring all of the checked in `Cargo.lock` files up-to-date +.PHONY: update-cargo-locks +update-cargo-locks: + echo "Updating Cargo.toml" + cargo update -w --offline; \ + for manifest_path in $$(find examples tests/testcases -name Cargo.toml); do \ + echo "Updating $${manifest_path}" && \ + cargo update --manifest-path "$${manifest_path}" -w --offline; \ + done + .PHONY: test-unit test-unit: RUST_LOG=$(LOG_LEVEL) cargo test --all --no-fail-fast -- --skip integration_tests --skip spinup_tests --skip cloud_tests --nocapture