-
Notifications
You must be signed in to change notification settings - Fork 11
170 lines (164 loc) · 6 KB
/
build.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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
name: Build and test
# Run the jobs for pushes and pull requests targetting main branch.
on:
push:
branches:
- main
paths-ignore:
- '**.md'
- 'LICENSE'
- 'images/**'
- 'examples/**'
- 'docs/**'
pull_request:
branches:
- main
paths-ignore:
- '**.md'
- 'LICENSE'
- 'images/**'
- 'examples/**'
- 'docs/**'
jobs:
# A build job matrix based on pre-built USD binaries provided by NVIDIA.
nvidia-usd-binaries-linux-build:
strategy:
matrix:
usdVersion:
- 23.05
include:
- usdVersion: 23.05
usdVersionUrl: 21-05
pythonVersion: '3.10'
USE_PYTHON_3: ON
buildType: Release
buildTests: 'ON'
runs-on: ubuntu-22.04
name: 'Ubuntu 22.04 NVIDIA Pre-built Binaries
<USD Version=${{ matrix.usdVersion }},
Python Version=${{ matrix.pythonVersion }},
Build type:${{ matrix.buildType }},
Enable tests=${{ matrix.build-tests }}>'
steps:
- name: Install dependencies (Linux)
run: sudo apt-get install cmake python${{ matrix.pythonVersion }} python${{ matrix.pythonVersion }}-dev
- uses: actions/checkout@v4
- name: Download and extract pre-built USD binaries
run: |
curl -L -o /tmp/usd-${{ matrix.usdVersion }}.7z https://developer.nvidia.com/downloads/USD/usd_binaries/23.05/[email protected]+v23.05.b53573ea.zip
mkdir -p /tmp/usd-${{ matrix.usdVersion }}
7z x /tmp/usd-${{ matrix.usdVersion }}.7z -o/tmp/usd-${{ matrix.usdVersion }}
- name: Create build directories
run: |
mkdir _build
mkdir _install
- name: Configure
run: |
cmake -DUSD_ROOT="/tmp/usd-${{ matrix.usdVersion }}/" \
-DTBB_ROOT="/tmp/usd-${{ matrix.usdVersion }}/" \
-DBoost_ROOT="/tmp/usd-${{ matrix.usdVersion }}/" \
-DUSE_PYTHON_3=${{ matrix.USE_PYTHON_3 }} \
-DCMAKE_BUILD_TYPE=${{ matrix.buildType }} \
-DBUILD_TESTING=${{ matrix.buildTests }} \
-DCMAKE_CXX_FLAGS="-D_GLIBCXX_USE_CXX11_ABI=0" \
-DCMAKE_INSTALL_PREFIX=../_install \
../usd
working-directory: _build
- name: Build
run: |
cmake --build . \
--verbose \
--target install \
--config ${{ matrix.buildType }}
working-directory: _build
- name: Test
run: ctest -VV --output-on-failure -C ${{ matrix.buildType }}
working-directory: _build
# A build job matrix based on pre-built USD binaries provided by NVIDIA on Windows.
nvidia-usd-binaries-windows-build:
strategy:
matrix:
usdVersion:
- 24.05
include:
- usdVersion: 24.05
usdVersionUrl: 21-05
pythonVersion: '3.10'
USE_PYTHON_3: ON
buildType: Release
buildTests: ON
runs-on: windows-2019
name: 'Windows 2019 NVIDIA Pre-built Binaries
<USD Version=${{ matrix.usdVersion }},
Python Version=${{ matrix.pythonVersion }},
Build type:${{ matrix.buildType }},
Enable tests=${{ matrix.build-tests }}>'
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.pythonVersion }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.pythonVersion }}
- name: Download and extract pre-built USD binaries
run: |
Invoke-WebRequest https://developer.nvidia.com/downloads/usd/usd_binaries/24.05/[email protected]+release.2864f3d0.zip -OutFile $env:TEMP/usd-${{ matrix.usdVersion }}.zip
mkdir -Force $env:TEMP/usd-${{ matrix.usdVersion }}
7z x $env:TEMP/usd-${{ matrix.usdVersion }}.zip $("-o" + "$env:TEMP" + "\usd-${{ matrix.usdVersion }}") -y
- name: Create build directories
run: |
mkdir -Force _build
mkdir -Force _install
- name: Configure
run: |
cmake -DUSD_ROOT="$env:TEMP/usd-${{ matrix.usdVersion }}" `
-DTBB_ROOT="$env:TEMP/usd-${{ matrix.usdVersion }}" `
-DBoost_ROOT="$env:TEMP/usd-${{ matrix.usdVersion }}" `
-DUSE_PYTHON_3=${{ matrix.USE_PYTHON_3 }} `
-DCMAKE_BUILD_TYPE=${{ matrix.buildType }} `
-DBUILD_TESTING=${{ matrix.buildTests }} `
-DCMAKE_INSTALL_PREFIX="../_install" `
-G "Visual Studio 16 2019" `
../usd
working-directory: "_build"
- name: Build
run: |
cmake --build . `
--verbose `
--config ${{ matrix.buildType }} `
--target ALL_BUILD
working-directory: "_build"
- name: Run Tests
run: |
ctest --extra-verbose `
--output-on-failure `
-C ${{ matrix.buildType }}
working-directory: "_build"
- name: Install
run: |
cmake --build . `
--verbose `
--config ${{ matrix.buildType }} `
--target INSTALL
working-directory: "_build"
# Run automated code formatting checks.
code-formatting-check:
runs-on: ubuntu-24.04
steps:
- name: Install dependencies (Linux)
run: |
sudo apt-get install clang-format-16
- uses: actions/checkout@v4
- name: Run clang-format on source code
run: |
find . \
-name ".git" -prune -o \
-name "*.cpp" -type f -exec clang-format -i --verbose {} + -o \
-name "*.h" -type f -exec clang-format -i --verbose {} +
- name: Check for code differences
run: |
set +e
git diff --color
git diff-index --quiet HEAD --; EXIT_CODE=$?
set -e
if [ $EXIT_CODE -ne 0 ]; then echo "C++ code formatting check failed. Please run clang-format on *.h and *.cpp, then push your changes."; fi
exit $EXIT_CODE