Build #21
This file contains 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: Build | |
on: | |
workflow_dispatch: | |
permissions: | |
contents: read | |
jobs: | |
build: | |
runs-on: ${{ matrix.platform }} | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- platform: "macos-latest" # ARM | |
options: "" | |
- platform: "macos-latest" # Intel | |
options: "--target x86_64-apple-darwin" | |
- platform: "ubuntu-22.04" # Linux | |
options: "" | |
- platform: "windows-latest" # Windows | |
options: "" | |
- platform: "windows-latest" # Windows Cuda | |
options: '--features "cuda"' | |
cuda-version: "12.5.0" | |
- platform: "ubuntu-22.04" # Linux Cuda | |
options: '--features "cuda"' | |
cuda-version: "12.4.1" | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: "true" | |
- name: Setup cuda for Windows | |
run: scripts/setup_cuda.ps1 | |
env: | |
INPUT_CUDA_VERSION: ${{ matrix.cuda-version }} | |
if: matrix.platform == 'windows-latest' && contains(matrix.options, 'cuda') | |
- name: Setup cuda for Ubuntu | |
uses: Jimver/cuda-toolkit@master | |
with: | |
cuda: "${{ matrix.cuda-version }}" | |
method: "network" | |
if: contains(matrix.platform, 'ubuntu') && contains(matrix.options, 'cuda') | |
- name: Cache Rust | |
uses: Swatinem/rust-cache@v2 | |
- name: Setup Rust | |
uses: dtolnay/rust-toolchain@stable | |
with: | |
# Those targets are only used on macos runners so it's in an `if` to slightly speed up windows and linux builds. | |
targets: ${{ matrix.platform == 'macos-latest' && 'aarch64-apple-darwin,x86_64-apple-darwin' || '' }} | |
# Publish | |
- name: Build | |
run: | | |
cargo build ${{ matrix.options }} | |
continue-on-error: ${{ contains(matrix.options, 'cuda') }} | |
- name: Find Runtime Libraries Windows | |
if: contains(matrix.platform, 'windows') | |
run: | | |
C:\msys64\usr\bin\find -name "*.lib" | |
- name: Find Runtime Libraries Linux | |
if: contains(matrix.platform, 'ubuntu') | |
run: | | |
find -name "*.a" |