on: [pull_request]

jobs:
  cargo-check:
    name: cargo-check

    strategy:
      fail-fast: false
      matrix:
        os: [ubuntu-latest, windows-latest]
        version:
          - cuda-11040
          - cuda-11050
          - cuda-11060
          - cuda-11070
          - cuda-11080
          - cuda-12000
          - cuda-12010
          - cuda-12020
          - cuda-12030
          - cuda-12040
          - cuda-12050
          - cuda-12060
          - cuda-12080
          - cuda-12090
          - cuda-13000
          - cuda-13010
          - cuda-13020

    runs-on: ${{ matrix.os }}

    steps:
      - uses: actions/checkout@v2
      - uses: actions-rs/toolchain@v1
        with:
          profile: minimal
          toolchain: stable
          override: true
      - uses: actions-rs/cargo@v1
        with:
          command: check
          args: --all-targets -F ${{ matrix.version }},cudnn,nccl,cusolver,cusolvermg,cusparse,cufile,cupti,nvtx,cufft,cutensor
      - uses: actions-rs/cargo@v1
        with:
          command: check
          args: --all-targets --no-default-features -F ${{ matrix.version }},no-std,cudnn,cublas,cublaslt,nvrtc,driver,curand,nccl,cusolver,cusolvermg,cusparse,cufile,cupti,nvtx,cufft,cutensor,dynamic-loading
