test(benches): silence unused imports when CUDA+nvcc disabled #25
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: CI | |
| on: | |
| push: | |
| branches: [ main ] | |
| pull_request: | |
| concurrency: | |
| group: ci-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| build-and-test: | |
| name: Rust tests (matrix) | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| preset: [noncuda, cuda-no-nvcc, cuda-with-nvcc] | |
| env: | |
| RUSTFLAGS: "-D warnings" | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions-rs/toolchain@v1 | |
| with: | |
| toolchain: stable | |
| override: true | |
| - name: Install system deps (NVCC only) | |
| if: matrix.preset == 'cuda-with-nvcc' | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y nvidia-cuda-toolkit | |
| - name: Setup conda CUDA (headers and libs) | |
| if: matrix.preset != 'noncuda' | |
| uses: conda-incubator/setup-miniconda@v3 | |
| with: | |
| miniforge-variant: Mambaforge | |
| activate-environment: m40-llm-ci | |
| auto-activate-base: false | |
| use-mamba: true | |
| - name: Install CUDA dev packages via conda | |
| if: matrix.preset != 'noncuda' | |
| shell: bash -l {0} | |
| run: | | |
| mamba install -y -c conda-forge -c nvidia cuda-cudart-dev=12.* cuda-toolkit=12.* | |
| - name: Cargo build/tests (non-CUDA) | |
| if: matrix.preset == 'noncuda' | |
| run: | | |
| cargo build --no-default-features --locked | |
| cargo test --no-default-features --locked --all | |
| - name: Cargo build/tests (CUDA feature, without NVCC) | |
| if: matrix.preset == 'cuda-no-nvcc' | |
| shell: bash -l {0} | |
| env: | |
| CONDA_PREFIX: ${{ env.CONDA_PREFIX }} | |
| run: | | |
| cargo build --features cuda --locked | |
| cargo test --features cuda --locked --all | |
| - name: Cargo build/tests (CUDA feature, with NVCC) | |
| if: matrix.preset == 'cuda-with-nvcc' | |
| shell: bash -l {0} | |
| env: | |
| CONDA_PREFIX: ${{ env.CONDA_PREFIX }} | |
| run: | | |
| which nvcc || true | |
| cargo build --features cuda --locked | |
| cargo test --features cuda --locked --all |