|
| 1 | +name: CI |
| 2 | + |
| 3 | +on: [pull_request, push] |
| 4 | + |
| 5 | +# Cancel a job if there's a new on on the same branch started. |
| 6 | +# Based on https://stackoverflow.com/questions/58895283/stop-already-running-workflow-job-in-github-actions/67223051#67223051 |
| 7 | +concurrency: |
| 8 | + group: ${{ github.ref }} |
| 9 | + cancel-in-progress: true |
| 10 | + |
| 11 | +env: |
| 12 | + CARGO_INCREMENTAL: 0 |
| 13 | + RUST_BACKTRACE: 1 |
| 14 | + # Faster crates.io index checkout. |
| 15 | + CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse |
| 16 | + RUST_LOG: debug |
| 17 | + # Build the kernel only for the single architecture . This should reduce |
| 18 | + # the overall compile-time significantly. |
| 19 | + EC_GPU_CUDA_NVCC_ARGS: --fatbin --gpu-architecture=sm_75 --generate-code=arch=compute_75,code=sm_75 |
| 20 | + BELLMAN_CUDA_NVCC_ARGS: --fatbin --gpu-architecture=sm_75 --generate-code=arch=compute_75,code=sm_75 |
| 21 | + NEPTUNE_CUDA_NVCC_ARGS: --fatbin --gpu-architecture=sm_75 --generate-code=arch=compute_75,code=sm_75 |
| 22 | + |
| 23 | +jobs: |
| 24 | + check_clippy: |
| 25 | + runs-on: ubuntu-24.04 |
| 26 | + name: Clippy |
| 27 | + steps: |
| 28 | + - uses: actions/checkout@v4 |
| 29 | + - name: Install required packages |
| 30 | + run: sudo apt install --no-install-recommends --yes libhwloc-dev nvidia-cuda-toolkit ocl-icd-opencl-dev |
| 31 | + - name: Run cargo clippy |
| 32 | + run: cargo clippy --all-targets --workspace -- -D warnings |
| 33 | + |
| 34 | + check_fmt: |
| 35 | + runs-on: ubuntu-24.04 |
| 36 | + name: Checking fmt |
| 37 | + steps: |
| 38 | + - uses: actions/checkout@v4 |
| 39 | + - name: Run cargo fmt |
| 40 | + run: cargo fmt --all -- --check |
| 41 | + |
| 42 | + test: |
| 43 | + runs-on: ubuntu-24.04 |
| 44 | + name: Test |
| 45 | + steps: |
| 46 | + - uses: actions/checkout@v4 |
| 47 | + - name: Install required packages |
| 48 | + run: sudo apt install --no-install-recommends --yes libhwloc-dev nvidia-cuda-toolkit ocl-icd-opencl-dev |
| 49 | + # In case no GPUs are available, it's using the CPU fallback. |
| 50 | + - name: Test |
| 51 | + run: cargo test --verbose |
| 52 | + |
| 53 | + test_macos: |
| 54 | + runs-on: macos-latest |
| 55 | + name: Test in release mode on MacOS |
| 56 | + steps: |
| 57 | + - uses: actions/checkout@v4 |
| 58 | + - name: Install required packages |
| 59 | + run: HOMEBREW_NO_AUTO_UPDATE=1 brew install hwloc |
| 60 | + |
| 61 | + - name: Run usual tests in release profile |
| 62 | + # CUDA isn't support on MacOS, hence only enable OpenCL. |
| 63 | + run: cargo test --verbose --release --no-default-features -- --nocapture |
0 commit comments