chore(deps): update rust crate tokio to v1.53.1 #2898
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: core | |
| on: | |
| push: | |
| branches: [ main ] | |
| pull_request: | |
| branches: [ main ] | |
| # cancel any prior runs for this workflow and this PR (or branch) | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
| cancel-in-progress: true | |
| permissions: | |
| contents: read | |
| env: | |
| CARGO_TERM_COLOR: always | |
| CARGO_INCREMENTAL: 0 # https://corrode.dev/blog/tips-for-faster-ci-builds/#environment-flags-to-disable-incremental-compilation | |
| CARGO_PROFILE_TEST_DEBUG: 0 # https://corrode.dev/blog/tips-for-faster-ci-builds/#disable-debug-info | |
| jobs: | |
| build_and_test: | |
| name: core | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| os: | |
| - ubuntu-latest | |
| # - windows-latest | |
| - macos-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Setup protoc | |
| run: | | |
| if [ $RUNNER_OS = "Linux" ] | |
| then | |
| if [ $RUNNER_ARCH = "X64" ] | |
| then arch=x86_64 | |
| elif [ $RUNNER_ARCH = "ARM64" ] | |
| then arch=aarch_64 | |
| else | |
| echo "Unsupported arch for protoc" | |
| exit 1 | |
| fi | |
| curl -L -o protoc.zip https://github.com/protocolbuffers/protobuf/releases/download/v31.1/protoc-31.1-linux-$arch.zip | |
| elif [ $RUNNER_OS = "macOS" ] | |
| then curl -L -o protoc.zip https://github.com/protocolbuffers/protobuf/releases/download/v31.1/protoc-31.1-osx-universal_binary.zip | |
| fi | |
| unzip protoc.zip -d $HOME/.local | |
| - name: report cargo version | |
| run: cargo --version | |
| - name: report rustc version | |
| run: rustc --version | |
| - name: verify feature consistency | |
| run: .github/scripts/verify-feature-consistency.sh | |
| - name: install ollama | |
| run: | | |
| # Disk space cleanup # https://dev.to/mathio/squeezing-disk-space-from-github-actions-runners-an-engineers-guide-3pjg | |
| ./.github/scripts/free-up-disk-space-fast.sh & | |
| DISK_CLEANUP_PID=$! | |
| if [ "$RUNNER_OS" = "Linux" ]; then | |
| curl -fsSL https://ollama.com/install.sh | bash | |
| # systemd is not always running on GHA runners, so start manually if needed | |
| curl -sf http://localhost:11434/api/tags > /dev/null 2>&1 || ollama serve & | |
| # Wait for the server to actually be ready | |
| for i in $(seq 1 30); do | |
| curl -sf http://localhost:11434/api/tags > /dev/null 2>&1 && break | |
| [ "$i" = "30" ] && { echo "Ollama server failed to start"; exit 1; } | |
| sleep 1 | |
| done | |
| elif [ "$RUNNER_OS" = "macOS" ]; then | |
| brew update | |
| brew install ollama | |
| brew services start ollama | |
| fi | |
| wait "$DISK_CLEANUP_PID" # for disk space cleanup | |
| - name: cargo test | |
| run: | | |
| if [ "$RUNNER_OS" = "macOS" ]; then | |
| # IMPORTANT: Cannot use --all-features because mistralrs (used by local/metal/cuda features) | |
| # unconditionally depends on candle-core, which depends on cudarc (CUDA). | |
| # | |
| # When adding new features to crates/spnl/Cargo.toml, update this list! | |
| # Current features tested (from crates/spnl/Cargo.toml): | |
| # - Included: cli_support, print, lisp, run, ollama, openai, gemini, pull, yaml, metal, rag, rag-deep-debug, spnl-api, vllm, k8s, gce, tok, openssl-vendored | |
| # - Excluded: ffi, pypi, run_py (pyo3/extension-module can't link into test binary; tested via python.yml) | |
| # - Excluded: local (CPU inference - pulls in CUDA deps via mistralrs) | |
| # - Excluded: cuda, cuda-flash-attn, cuda-flash-attn-v3 (CUDA features) | |
| cargo test -p spnl-core --features lisp,yaml,tok -- --nocapture | |
| cargo test -p spnl-run --features cli_support,print,lisp,run,ollama,openai,gemini,pull,yaml,metal,rag,rag-deep-debug,spnl-api,vllm,k8s,gce,tok,openssl-vendored -- --nocapture | |
| cargo test -p spnl --features cli_support,print,lisp,run,ollama,openai,gemini,pull,yaml,metal,rag,rag-deep-debug,spnl-api,vllm,k8s,gce,tok,openssl-vendored -- --nocapture | |
| cargo test --manifest-path crates/spnl-cli/Cargo.toml --features bench,rag,spnl-api,vllm,k8s,gce,local,metal -- --nocapture | |
| else | |
| # Test default features on Linux (no GPU features) | |
| # spnl-cli is excluded from workspace, test separately | |
| cargo test -p spnl-core -p spnl-run -p spnl -- --nocapture | |
| cargo test --manifest-path crates/spnl-cli/Cargo.toml -- --nocapture | |
| fi | |
| - name: cargo clippy | |
| # Only run clippy on macOS to validate all features except local and cuda*. | |
| # Clippy is linting/static analysis (OS-independent), so running once is sufficient. | |
| # | |
| # IMPORTANT: Cannot use --all-features because mistralrs (used by local/metal/cuda features) | |
| # unconditionally depends on candle-core, which depends on cudarc (CUDA). | |
| # When adding new features, update the feature list above in cargo test! | |
| if: runner.os == 'macOS' | |
| run: | | |
| cargo clippy -p spnl-core --features lisp,yaml,tok --tests --no-deps -- -D warnings | |
| cargo clippy -p spnl-run --features cli_support,print,lisp,run,ollama,openai,gemini,pull,yaml,metal,rag,rag-deep-debug,spnl-api,vllm,k8s,gce,tok,openssl-vendored --tests --no-deps -- -D warnings | |
| cargo clippy -p spnl --features cli_support,print,lisp,run,ollama,openai,gemini,pull,yaml,metal,rag,rag-deep-debug,spnl-api,vllm,k8s,gce,tok,openssl-vendored --tests --no-deps -- -D warnings | |
| cargo clippy --manifest-path crates/spnl-cli/Cargo.toml --features bench,rag,spnl-api,vllm,k8s,gce,local,metal --tests --no-deps -- -D warnings | |
| - name: rustfmt | |
| run: | | |
| cargo fmt --all -- --check | |
| cargo fmt --manifest-path crates/spnl-cli/Cargo.toml -- --check |