From 6dc17a26ce561e570d060afbe6c1810c6a401a7f Mon Sep 17 00:00:00 2001 From: Weihang Lo Date: Tue, 18 Apr 2023 17:20:37 +0100 Subject: [PATCH 1/2] ci: check if Cargo.lock is up-to-date --- .github/workflows/main.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 3146e7c4e9a..94cfb044f1b 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -37,6 +37,14 @@ jobs: # TODO: check every members - run: cargo clippy -p cargo --lib --no-deps -- -D warnings + # Ensure Cargo.lock is up-to-date + lockfile: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - run: rustup update stable && rustup default stable + - run: cargo update -p cargo --locked + test: runs-on: ${{ matrix.os }} env: From 7715010c0848db4e57735fea4b0cb1d131227972 Mon Sep 17 00:00:00 2001 From: Sebastian Thiel Date: Tue, 18 Apr 2023 12:36:09 +0200 Subject: [PATCH 2/2] Prevent false positives when checking for changes in src/doc. When changing cargo versions from stable to nightly, it's possible that the Cargo.lock format changes ever so slightly. This leaves the `Cargo.lock` file changed which is picked up by `git status`. This patch adjusts the `git status` invocation to limit itself to the CWD. --- ci/validate-man.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ci/validate-man.sh b/ci/validate-man.sh index 92df4978143..f636b46059c 100755 --- a/ci/validate-man.sh +++ b/ci/validate-man.sh @@ -5,7 +5,7 @@ set -e cd src/doc -changes=$(git status --porcelain) +changes=$(git status --porcelain -- .) if [ -n "$changes" ] then echo "git directory must be clean before running this script." @@ -14,10 +14,10 @@ fi ./build-man.sh -changes=$(git status --porcelain) +changes=$(git status --porcelain -- .) if [ -n "$changes" ] then - echo "Detected changes in man pages:" + echo "Detected changes of man pages in src/doc:" echo "$changes" echo echo "Please run './build-man.sh' in the src/doc directory to rebuild the"