-
Notifications
You must be signed in to change notification settings - Fork 0
61 lines (53 loc) · 2.22 KB
/
cmake-multi-platform.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# 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'
- os: windows-latest
cuda: '12.1'
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up CUDA
if: matrix.os == 'ubuntu-latest'
run: |
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/cuda-ubuntu2004.pin
sudo mv cuda-ubuntu2004.pin /etc/apt/preferences.d/cuda-repository-pin-600
wget https://developer.download.nvidia.com/compute/cuda/12.1.0/local_installers/cuda-repo-ubuntu2004-12-1-local_12.1.0-530.30.02-1_amd64.deb
sudo dpkg -i cuda-repo-ubuntu2004-12-1-local_12.1.0-530.30.02-1_amd64.deb
sudo cp /var/cuda-repo-ubuntu2004-12-1-local/cuda-*-keyring.gpg /usr/share/keyrings/
sudo apt-get update
sudo apt-get -y install cuda
shell: bash
- name: Set up CUDA on Windows
if: matrix.os == 'windows-latest'
run: |
Invoke-WebRequest https://raw.githubusercontent.com/KonduitAI/cuda-install/master/.github/actions/install-cuda-windows/install_cuda_windows.ps1 -OutFile install_cuda_windows.ps1 | Out-Null
.\install_cuda_windows.ps1
echo "CUDA_PATH=$($CUDA_PATH))" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
echo "$($CUDA_PATH))\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
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: Configure CMake
run: mkdir build && cd build && cmake ..
shell: bash
- name: Build with CMake
run: cmake --build build --config Release
shell: bash