-
Notifications
You must be signed in to change notification settings - Fork 0
113 lines (105 loc) · 4.43 KB
/
build-tests.yaml
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
name: Test Example Build
on:
push:
branches:
- main
pull_request:
workflow_dispatch:
jobs:
test:
name: "Test Examples Build (CUDA ${{ matrix.cases.cuda-version }} on ${{ matrix.cases.os }})"
runs-on: ${{ matrix.cases.os }}
timeout-minutes: 60
strategy:
matrix:
cases:
# - { os: "ubuntu-20.04", cuda-version: "11.2.2", source: "nvidia" }
# - { os: "ubuntu-20.04", cuda-version: "11.6.2", source: "nvidia" }
- {
os: "ubuntu-20.04",
cuda-version: "11.6.2",
source: "nvidia",
toolchain: "llvm",
toolchain-version: "16"
}
# - {
# os: "ubuntu-22.04",
# cuda-version: "11.5.1-1ubuntu1",
# source: "ubuntu",
# }
# - { os: "windows-2019", cuda-version: "10.1.243", source: "nvidia" }
# - { os: "windows-2019", cuda-version: "11.6.2", source: "nvidia" }
steps:
- uses: actions/checkout@v3
- uses: bazelbuild/setup-bazelisk@v2
- name: Mount bazel cache
if: ${{ !startsWith(matrix.cases.os, 'windows') }}
uses: actions/cache@v3
with:
path: ~/.cache/bazel
key: bazel-${{ matrix.cases.os }}-cuda-${{ matrix.cases.cuda-version }}-${{ hashFiles('.bazelversion') }}
- name: Install CUDA (NVIDIA, Linux)
uses: Jimver/cuda-toolkit@v0.2.11
if: ${{ !startsWith(matrix.cases.os, 'windows') && matrix.cases.source == 'nvidia' }}
with:
cuda: ${{ matrix.cases.cuda-version }}
sub-packages: '["nvcc", "cudart-dev"]'
method: network
- name: Show bin, include, lib (NVIDIA, Linux)
if: ${{ !startsWith(matrix.cases.os, 'windows') && matrix.cases.source == 'nvidia' }}
run: |
tree ${CUDA_PATH}/bin
tree ${CUDA_PATH}/include
tree ${CUDA_PATH}/lib64
- name: Install LLVM ${{ matrix.cases.toolchain-version }}
if: ${{ !startsWith(matrix.cases.os, 'windows') && matrix.cases.toolchain == 'llvm' }}
run: |
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh ${{ matrix.cases.toolchain-version }}
echo "build --config=clang" > $HOME/.bazelrc
sudo ln -sf /usr/bin/clang-${{ matrix.cases.toolchain-version }} /usr/bin/clang
clang --version
- name: Install CURAND For LLVM
uses: Jimver/cuda-toolkit@v0.2.11
if: ${{ !startsWith(matrix.cases.os, 'windows') && matrix.cases.toolchain == 'llvm' }}
with:
cuda: ${{ matrix.cases.cuda-version }}
non-cuda-sub-packages: '["libcurand-dev"]'
method: network
# - name: "FIXME: Early exit"
# run: exit -1
- name: Install CUDA (Ubuntu)
if: ${{ !startsWith(matrix.cases.os, 'windows') && matrix.cases.source == 'ubuntu' }}
run: |
sudo apt-get update
sudo apt-get install -y nvidia-cuda-dev=${{ matrix.cases.cuda-version }} nvidia-cuda-toolkit=${{ matrix.cases.cuda-version }} gcc-9 g++-9
export CC=gcc-9
export CXX=g++-9
echo "CC=gcc-9" >> $GITHUB_ENV
echo "CXX=g++-9" >> $GITHUB_ENV
- name: Install CUDA (Windows)
uses: Jimver/cuda-toolkit@v0.2.11
if: ${{ startsWith(matrix.cases.os, 'windows') }}
with:
cuda: ${{ matrix.cases.cuda-version }}
sub-packages: '["nvcc", "cudart"]'
method: network
- name: Show bin, include, lib64 (Windows)
if: ${{ startsWith(matrix.cases.os, 'windows') }}
run: |
tree /F $env:CUDA_PATH/bin
tree /F $env:CUDA_PATH/include
tree /F $env:CUDA_PATH/lib/x64
- name: Set Visual Studio Environment (Windows)
if: ${{ startsWith(matrix.cases.os, 'windows') }}
run: .github/workflows/Set-VSEnv.ps1 2019
- run: bazelisk build @rules_cuda_examples//basic:all
- run: bazelisk build @rules_cuda_examples//rdc:all
- run: bazelisk build @rules_cuda_examples//if_cuda:main
- run: bazelisk build @rules_cuda_examples//if_cuda:main --enable_cuda=False
- run: cd examples && bazelisk build //basic:all --config=bzlmod
- run: cd examples && bazelisk build //rdc:all --config=bzlmod
- run: cd examples && bazelisk build //if_cuda:main --config=bzlmod
- run: cd examples && bazelisk build //if_cuda:main --enable_cuda=False --config=bzlmod
- run: bazelisk shutdown