add ci steps to check cargo.lock is up to date (#377)

We keep having out of date hf_xet/Cargo.lock, likely people are not
building hf_xet 100% of the time they are pushing to the repo. This PR
enforces that hf_xet/Cargo.lock and the root Cargo.lock must be up to
date, a CI job will fail if this is not true.
This commit is contained in:
Assaf Vayner
2025-06-11 10:25:28 -07:00
committed by GitHub
parent c42173ecfc
commit 80c0a7ffc9
2 changed files with 10 additions and 2 deletions

View File

@@ -40,6 +40,10 @@ jobs:
- name: Build and Test
run: |
cargo test --verbose --no-fail-fast --features "strict"
- name: Check Cargo.lock has no uncommitted changes
run: |
# the build and test steps would update Cargo.lock if it is out of date
test -z "$(git status --porcelain Cargo.lock)" || (echo "Cargo.lock has uncommitted changes!" && exit 1)
build_and_test-win:
runs-on: windows-latest
steps:

View File

@@ -17,7 +17,7 @@ jobs:
runs-on: ubuntu-latest
steps:
# checkout out xet-core
- uses: actions/checkout@v4
- uses: actions/checkout@v4
# checkout out huggingface_hub
- uses: actions/checkout@v4
with:
@@ -41,4 +41,8 @@ jobs:
- name: Run huggingface_hub xet tests
run: |
source .venv/bin/activate
pytest huggingface_hub/tests/test_xet_*.py
pytest huggingface_hub/tests/test_xet_*.py
- name: Check Cargo.lock has no uncommitted changes
run: |
# the Build wheel step would update hf_xet/Cargo.lock if it is out of date
test -z "$(git status --porcelain hf_xet/Cargo.lock)" || (echo "hf_xet/Cargo.lock has uncommitted changes!" && exit 1)