Fix CI CUDA environment setup and commit lint fallback #167
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-with-nvcc] | |
| env: | |
| RUSTFLAGS: "-D warnings" | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions-rs/toolchain@v1 | |
| with: | |
| toolchain: stable | |
| override: true | |
| - name: Setup micromamba CUDA (headers and libs) | |
| if: matrix.preset != 'noncuda' | |
| uses: mamba-org/setup-micromamba@v2 | |
| with: | |
| environment-name: m40-llm-ci | |
| cache-downloads: true | |
| condarc: | | |
| channels: | |
| - conda-forge | |
| - nvidia/label/cuda-12.4.1 | |
| create-args: >- | |
| cuda-nvcc=12.4.* | |
| cuda-cudart=12.4.* | |
| cuda-cudart-dev=12.4.* | |
| libcublas=12.4.* | |
| libcublas-dev=12.4.* | |
| - 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, with NVCC) | |
| if: matrix.preset == 'cuda-with-nvcc' | |
| run: | | |
| micromamba run -n m40-llm-ci which nvcc || true | |
| micromamba run -n m40-llm-ci cargo build --features cuda --locked | |
| micromamba run -n m40-llm-ci cargo test --features cuda --locked --all |