-
Notifications
You must be signed in to change notification settings - Fork 92
127 lines (110 loc) · 3.55 KB
/
ci.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
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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
name: Build
on:
push:
workflow_dispatch:
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
# `include` will only run specific combinations (not permutations of these)
include:
- os: windows-2019
cuda: "11.4.0"
visual_studio: "Visual Studio 16 2019"
python: "3.9"
- os: ubuntu-20.04
cuda: "11.4.0"
python: "3.9"
env:
build_dir: "build"
config: "Release"
steps:
- uses: actions/checkout@v3
- name: Cache build
uses: actions/cache@v3
with:
path: ${{github.workspace}}/build
key: ${{ matrix.os }}-build
restore-keys: ${{ matrix.os }}-build
- name: Setup Python ${{ matrix.python }}
uses: actions/setup-python@v4
with:
python-version: "${{ matrix.python }}"
cache: "pip" # cache pip dependencies
- name: Upgrade Pip and Install wheel
run: |
python -m pip install --upgrade pip
pip install wheel
- name: Install CUDA (Windows)
uses: Jimver/[email protected]
if: runner.os == 'Windows'
with:
sub-packages: '["nvcc", "visual_studio_integration", "cublas", "curand", "nvrtc", "cudart"]'
cuda: ${{ matrix.cuda }}
method: network
use-github-cache: false
- name: Install CUDA (Linux)
uses: Jimver/[email protected]
if: runner.os == 'Linux'
with:
sub-packages: '["nvcc", "nvrtc", "cudart"]'
cuda: ${{ matrix.cuda }}
method: network
use-github-cache: false
- name: nvcc check
shell: bash
run: |
nvcc -V
ls "$CUDA_PATH"
ls "$CUDA_PATH/bin"
ls "$CUDA_PATH/include"
- name: cmake version
shell: bash
run: cmake --version
- name: Configure CMake
id: configure
shell: bash
run: |
if [ "${{ runner.os }}" -eq "Windows" ]
then
cmake . -B "${{ env.build_dir }}" -G "${{ matrix.visual_studio }}" -A x64
else
cmake . -B "${{ env.build_dir }}" -DCMAKE_BUILD_TYPE=RELEASE
fi
- name: Configure Error Processing
if: ${{ (failure() && steps.configure.outcome == 'failure') || success() }}
working-directory: ${{ env.build_dir }}
shell: bash
run: |
if [[ -f "CMakeFiles/CMakeOutput.log" ]]; then
echo "---- CMakeFiles/CMakeOutput.log"
cat CMakeFiles/CMakeOutput.log
echo "----"
fi
if [[ -f "CMakeFiles/CMakeError.log" ]]; then
echo "---- CMakeFiles/CMakeError.log"
cat CMakeFiles/CMakeError.log
echo "----"
fi
- name: Build (Windows)
if: runner.os == 'Windows'
working-directory: ${{ env.build_dir }}
run: cmake --build . --config ${{ env.config }} --target ALL_BUILD --verbose
- name: Build (Linux)
if: runner.os == 'Linux'
working-directory: ${{ env.build_dir }}
run: make
- name: Upload Artifacts (Windows)
uses: actions/upload-artifact@v3
if: runner.os == 'Windows'
with:
name: ${{ matrix.os }}-x64-cuda-${{ matrix.cuda }}
path: build/Release/**/*
- name: Upload Artifacts (Linux)
uses: actions/upload-artifact@v3
if: runner.os == 'Linux'
with:
name: ${{ matrix.os }}-x64-cuda-${{ matrix.cuda }}
path: build/**/*