diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index cc8954a1..c4127b62 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -3,10 +3,10 @@ name: Rust CI on: pull_request: paths-ignore: - - '**.md' + - "**.md" push: paths-ignore: - - '**.md' + - "**.md" env: RUST_LOG: info @@ -14,7 +14,7 @@ env: jobs: rust: - name: Rust ${{ matrix.rust }} on ${{ matrix.os }} + name: Rust on ${{ matrix.os }} with CUDA ${{ matrix.cuda }} runs-on: ${{ matrix.os }} env: LLVM_LINK_STATIC: 1 @@ -24,22 +24,39 @@ jobs: include: - os: ubuntu-20.04 target: x86_64-unknown-linux-gnu + cuda: "11.2.2" + linux-local-args: ["--toolkit"] + - os: ubuntu-24.04 + target: x86_64-unknown-linux-gnu + cuda: "12.8.1" + linux-local-args: ["--toolkit"] + - os: windows-latest + target: x86_64-pc-windows-msvc + cuda: "11.2.2" + linux-local-args: [] - os: windows-latest target: x86_64-pc-windows-msvc + cuda: "12.8.1" + linux-local-args: [] + steps: - name: Checkout repository uses: actions/checkout@v2 - - name: Install CUDA - uses: Jimver/cuda-toolkit@v0.2.21 + - name: Install CUDA + uses: Jimver/cuda-toolkit@v0.2.22 id: cuda-toolkit with: - cuda: '11.2.2' + cuda: ${{ matrix.cuda }} + linux-local-args: ${{ toJson(matrix.linux-local-args) }} + + - name: Verify CUDA installation + run: nvcc --version - name: List CUDA_PATH files (Linux) if: runner.os == 'Linux' run: find "$CUDA_PATH" -type f - + - name: List CUDA_PATH files (Windows) if: runner.os == 'Windows' shell: pwsh @@ -48,18 +65,36 @@ jobs: # random command that forces rustup to install stuff in rust-toolchain - name: Install rust-toolchain run: cargo version - + - name: Add rustup components run: rustup component add rustfmt clippy + - name: Install dependencies for LLVM 7 + if: matrix.os == 'ubuntu-24.04' + run: | + wget -O libffi7.deb http://security.ubuntu.com/ubuntu/pool/universe/libf/libffi7/libffi7_3.3-5ubuntu1_amd64.deb + sudo apt-get update + sudo apt-get install -y ./*.deb + sudo apt-get install -y liblzma-dev + sudo apt-get install -y libssl-dev + sudo apt-get install -y libcurl4-openssl-dev + - name: Install LLVM 7 if: contains(matrix.os, 'ubuntu') - run: | - sudo apt-get install llvm-7 - sudo ln -s /usr/bin/llvm-config-7 /usr/local/bin/llvm-config + run: | + mkdir -p ~/llvm7 && cd ~/llvm7 + wget http://mirrors.kernel.org/ubuntu/pool/universe/l/llvm-toolchain-7/llvm-7_7.0.1-12_amd64.deb \ + http://mirrors.kernel.org/ubuntu/pool/universe/l/llvm-toolchain-7/llvm-7-dev_7.0.1-12_amd64.deb \ + http://mirrors.kernel.org/ubuntu/pool/universe/l/llvm-toolchain-7/libllvm7_7.0.1-12_amd64.deb \ + http://mirrors.kernel.org/ubuntu/pool/universe/l/llvm-toolchain-7/llvm-7-runtime_7.0.1-12_amd64.deb + sudo apt-get update + sudo apt-get install -y ./*.deb + sudo ln -s /usr/bin/llvm-config-7 /usr/local/bin/llvm-config - name: Load Rust Cache - uses: Swatinem/rust-cache@v1 + uses: Swatinem/rust-cache@v2.7.7 + with: + key: ${{ matrix.os }}-${{ matrix.target }}-${{ matrix.cuda }} - name: Rustfmt if: contains(matrix.os, 'ubuntu')