Updated workflow file #6
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
# This starter workflow is for a CMake project running on multiple platforms. There is a different starter workflow if you just want a single platform. | |
# See: https://github.com/actions/starter-workflows/blob/main/ci/cmake-single-platform.yml | |
name: CUDA CMake Multi-Platform Build | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
jobs: | |
build: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest, windows-latest] | |
include: | |
- os: ubuntu-latest | |
cuda: '12.1.0' | |
- os: windows-latest | |
cuda: '12.1.0' | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Set up CUDA | |
if: matrix.os == 'ubuntu-latest' | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y wget | |
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/cuda-repo-ubuntu2004_${{ matrix.cuda }}-1_amd64.deb | |
sudo dpkg -i cuda-repo-ubuntu2004_${{ matrix.cuda }}-1_amd64.deb | |
sudo apt-key adv --fetch-keys http://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/7fa2af80.pub | |
sudo apt-get update | |
sudo apt-get -y install cuda | |
shell: bash | |
- name: Set up CUDA on Windows | |
if: matrix.os == 'windows-latest' | |
run: | | |
choco install cuda --version=${{ matrix.cuda }} | |
shell: powershell | |
- name: Add CUDA to PATH on Ubuntu | |
if: matrix.os == 'ubuntu-latest' | |
run: echo "/usr/local/cuda-${{ matrix.cuda }}/bin" >> $GITHUB_PATH | |
shell: bash | |
- name: Add CUDA to PATH on Windows | |
if: matrix.os == 'windows-latest' | |
run: echo "C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v${{ matrix.cuda }}\\bin" >> $Env:GITHUB_PATH | |
shell: powershell | |
- name: Configure CMake | |
run: mkdir build && cd build && cmake .. | |
shell: bash | |
- name: Build with CMake | |
run: cmake --build build --config Release | |
shell: bash | |