Support XetSession in async context #2665
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: xet-core CI | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| fmt: | |
| name: Rustfmt | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: dtolnay/rust-toolchain@stable | |
| with: | |
| toolchain: nightly | |
| components: rustfmt | |
| - name: Format | |
| run: | | |
| cargo fmt --manifest-path ./Cargo.toml --all -- --check | |
| cargo fmt --manifest-path ./hf_xet/Cargo.toml --all -- --check | |
| detect-unused-dependencies: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Machete | |
| uses: bnjbvr/cargo-machete@main | |
| build_and_test-linux: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v6 | |
| - name: Install Rust 1.89 | |
| uses: dtolnay/rust-toolchain@1.89.0 | |
| with: | |
| components: clippy | |
| - uses: ./.github/actions/cache-rust-build | |
| - name: Lint | |
| run: | | |
| cargo clippy -r --verbose -- -D warnings # elevates warnings to errors | |
| cargo clippy -r --verbose --manifest-path hf_xet/Cargo.toml -- -D warnings # elevates warnings to errors | |
| - name: Set up Git LFS | |
| run: | | |
| curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | sudo bash | |
| sudo apt-get install git-lfs | |
| git lfs install | |
| - name: Build and Test | |
| run: | | |
| cargo test --verbose --no-fail-fast --features "strict git-xet-for-integration-test" | |
| - name: Build and Test hf_xet | |
| run: | | |
| cd hf_xet && cargo test --verbose --no-fail-fast | |
| - 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: | |
| - name: Checkout repository | |
| uses: actions/checkout@v6 | |
| - name: Install Rust 1.89 | |
| uses: dtolnay/rust-toolchain@1.89.0 | |
| with: | |
| components: clippy | |
| - uses: ./.github/actions/cache-rust-build | |
| - name: Build and Test | |
| run: | | |
| cargo test --verbose --no-fail-fast --features "strict git-xet-for-integration-test" | |
| - name: Build and Test hf_xet | |
| run: | | |
| cd hf_xet && cargo test --verbose --no-fail-fast | |
| build_and_test-macos: | |
| runs-on: macos-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v6 | |
| - name: Install Rust 1.89 | |
| uses: dtolnay/rust-toolchain@1.89.0 | |
| with: | |
| components: clippy | |
| - name: Set up Git LFS | |
| run: | | |
| brew install git-lfs | |
| git lfs install | |
| - uses: ./.github/actions/cache-rust-build | |
| - name: Build and Test | |
| run: | | |
| cargo test --verbose --no-fail-fast --features "strict git-xet-for-integration-test" | |
| - name: Build and Test hf_xet | |
| run: | | |
| cd hf_xet && cargo test --verbose --no-fail-fast | |
| build_and_test-wasm: | |
| name: Build WASM | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v6 | |
| - name: Install Rust nightly | |
| uses: dtolnay/rust-toolchain@nightly | |
| with: | |
| targets: wasm32-unknown-unknown | |
| components: rust-src | |
| - uses: ./.github/actions/cache-rust-build | |
| - name: Install wasm-bindgen-cli and wasm-pack | |
| run: | | |
| cargo install --version 0.2.100 wasm-bindgen-cli | |
| cargo install --version 0.13.1 wasm-pack | |
| - name: Build hf_xet_thin_wasm | |
| working-directory: wasm/hf_xet_thin_wasm | |
| run: | | |
| ./build_wasm.sh | |
| - name: Build hf_xet_wasm | |
| working-directory: wasm/hf_xet_wasm | |
| run: | | |
| ./build_wasm.sh |