Adding windows testing for CI (#226)

* Adds a job to run tests on windows in addition to linux.
* Fixes linting for windows builds
* Fixes the LocalClient that tries to set files as read-only, which,
during tests, will break on windows due to file deletion behaving
differently than on Linux.
* Identified an issue with the disk cache deleting items if there are
simultaneous `put`s to the cache for the same key, range. This is fine
on unix, but on windows, causes errors (again, due to file deletion
behavior differences). This change mitigates the issue, allowing
huggingface_hub tests to pass on windows, but opens up another issue of
us needing to vet our filesystem deletes (e.g. cache eviction) for
correctness on windows.
This commit is contained in:
Joseph Godlewski
2025-04-04 21:50:06 +02:00
committed by GitHub
parent 744ae76b90
commit b10690d8c1
9 changed files with 154 additions and 20 deletions

View File

@@ -40,3 +40,18 @@ jobs:
- name: Build and Test
run: |
cargo test --verbose --no-fail-fast --features "strict"
build_and_test-win:
runs-on: windows-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Rust 1.86
uses: dtolnay/rust-toolchain@1.86.0
with:
components: clippy
- name: Lint
run: |
cargo clippy -r --verbose -- -D warnings # elevates warnings to errors
- name: Build and Test
run: |
cargo test --verbose --no-fail-fast --features "strict"