Skip to content

Commit a2c17fc

Browse files
committed
Add CI test for build without python
1 parent 54940f0 commit a2c17fc

File tree

3 files changed

+85
-8
lines changed

3 files changed

+85
-8
lines changed

.github/workflows/test-linux.yml

Lines changed: 37 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,15 @@ jobs:
2222
fail-fast: false
2323
matrix:
2424
usd: ["v24.08", "v25.05"]
25-
python: ["3.10", "3.12"]
25+
python: ["", "3.10", "3.12"]
2626

27-
name: "USD-${{ matrix.usd }}-py${{ matrix.python }}"
27+
name: "USD-${{ matrix.usd }}${{ matrix.python != '' && format('-py{0}', matrix.python) || '-no-py' }}"
2828

2929
steps:
3030
- uses: actions/checkout@v4
3131

3232
- name: Set up Python ${{ matrix.python }}
33+
if: matrix.python != ''
3334
uses: actions/setup-python@v5
3435
with:
3536
python-version: ${{ matrix.python }}
@@ -38,10 +39,14 @@ jobs:
3839
run: |
3940
sudo apt update
4041
sudo apt install -y libgtest-dev ninja-build
41-
python -m pip install -r ${{github.workspace}}/test/requirements.txt
4242
mkdir -p ${{github.workspace}}/build
4343
mkdir -p ${{runner.temp}}/USD
4444
45+
- name: Install test Python deps
46+
if: matrix.python != ''
47+
run: |
48+
python -m pip install -r ${{github.workspace}}/test/requirements.txt
49+
4550
- name: Download USD
4651
working-directory: ${{runner.temp}}/USD
4752
run: |
@@ -57,6 +62,7 @@ jobs:
5762
sed -i '/BOOST_URL/ s|\.zip"|.zip/download"|' src/build_scripts/build_usd.py
5863
5964
- name: Install USD
65+
if: matrix.python != ''
6066
working-directory: ${{runner.temp}}/USD
6167
run: |
6268
python ./src/build_scripts/build_usd.py . \
@@ -69,7 +75,23 @@ jobs:
6975
--no-materialx \
7076
-v
7177
78+
- name: Install USD (without Python)
79+
if: matrix.python == ''
80+
working-directory: ${{runner.temp}}/USD
81+
run: |
82+
python ./src/build_scripts/build_usd.py . \
83+
--no-tests \
84+
--no-examples \
85+
--no-tutorials \
86+
--no-tools \
87+
--no-docs \
88+
--no-imaging \
89+
--no-materialx \
90+
--no-python \
91+
-v
92+
7293
- name: Configure & Build
94+
if: matrix.python != ''
7395
working-directory: ${{github.workspace}}/build
7496
run: |
7597
export PYTHONPATH="${{runner.temp}}/USD/lib/python"
@@ -80,6 +102,18 @@ jobs:
80102
..
81103
cmake --build . --config Release
82104
105+
- name: Configure & Build (without Python)
106+
if: matrix.python == ''
107+
working-directory: ${{github.workspace}}/build
108+
run: |
109+
cmake \
110+
-D "BUILD_DOCS=OFF" \
111+
-D "BUILD_PYTHON_BINDINGS=OFF" \
112+
-D "CMAKE_INCLUDE_PATH=${{runner.temp}}/USD/include" \
113+
-D "CMAKE_LIBRARY_PATH=${{runner.temp}}/USD/lib" \
114+
..
115+
cmake --build . --config Release
116+
83117
- name: Check for formatting errors
84118
working-directory: ${{github.workspace}}/build
85119
run: |

.github/workflows/test-windows.yml

Lines changed: 47 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,25 +22,30 @@ jobs:
2222
fail-fast: false
2323
matrix:
2424
usd: ["v24.08", "v25.05.01"]
25-
python: ["3.10", "3.12"]
25+
python: ["", "3.10", "3.12"]
2626

27-
name: "USD-${{ matrix.usd }}-py${{ matrix.python }}"
27+
name: "USD-${{ matrix.usd }}${{ matrix.python != '' && format('-py{0}', matrix.python) || '-no-py' }}"
2828

2929
steps:
3030
- uses: actions/checkout@v4
3131

3232
- name: Set up Python ${{ matrix.python }}
33+
if: matrix.python != ''
3334
uses: actions/setup-python@v5
3435
with:
3536
python-version: ${{ matrix.python }}
3637

3738
- name: Create Build Environment
3839
run: |
3940
vcpkg install --triplet=x64-windows gtest
40-
python -m pip install -r ${{github.workspace}}\test\requirements.txt
4141
cmake -E make_directory ${{github.workspace}}\build
4242
cmake -E make_directory ${{runner.temp}}\USD
4343
44+
- name: Install test Python deps
45+
if: matrix.python != ''
46+
run: |
47+
python -m pip install -r ${{github.workspace}}/test/requirements.txt
48+
4449
- name: Download USD
4550
working-directory: ${{runner.temp}}/USD
4651
shell: cmd
@@ -58,6 +63,26 @@ jobs:
5863
sed -i '/BOOST_URL/ s|\.zip"|.zip/download"|' src/build_scripts/build_usd.py
5964
6065
- name: Install USD
66+
if: matrix.python != ''
67+
working-directory: ${{runner.temp}}/USD
68+
shell: cmd
69+
run: |
70+
call "C:/Program Files/Microsoft Visual Studio/2022/Enterprise/VC/Auxiliary/Build/vcvars64.bat"
71+
set VCPKG_TARGET_TRIPLET=x64-windows
72+
set CMAKE_TOOLCHAIN_FILE=%VCPKG_INSTALLATION_ROOT%/scripts/buildsystems/vcpkg.cmake
73+
python ./src/build_scripts/build_usd.py . ^
74+
--generator "Visual Studio 17 2022" ^
75+
--no-tests ^
76+
--no-examples ^
77+
--no-tutorials ^
78+
--no-tools ^
79+
--no-docs ^
80+
--no-imaging ^
81+
--no-materialx ^
82+
-v
83+
84+
- name: Install USD (without Python)
85+
if: matrix.python == ''
6186
working-directory: ${{runner.temp}}/USD
6287
shell: cmd
6388
run: |
@@ -73,9 +98,11 @@ jobs:
7398
--no-docs ^
7499
--no-imaging ^
75100
--no-materialx ^
101+
--no-python ^
76102
-v
77103
78104
- name: Configure & Build
105+
if: matrix.python != ''
79106
shell: bash
80107
working-directory: ${{github.workspace}}/build
81108
run: |
@@ -91,6 +118,23 @@ jobs:
91118
..
92119
cmake --build . --config Release
93120
121+
- name: Configure & Build
122+
if: matrix.python == ''
123+
shell: bash
124+
working-directory: ${{github.workspace}}/build
125+
run: |
126+
export PATH="${{runner.temp}}/USD/bin;${{runner.temp}}/USD/lib;${PATH}"
127+
cmake \
128+
-G "Visual Studio 17 2022" -A x64 \
129+
-D "CMAKE_TOOLCHAIN_FILE=${VCPKG_INSTALLATION_ROOT}/scripts/buildsystems/vcpkg.cmake" \
130+
-D "VCPKG_TARGET_TRIPLET=x64-windows" \
131+
-D "BUILD_DOCS=OFF" \
132+
-D "BUILD_PYTHON_BINDINGS=OFF" \
133+
-D "CMAKE_INCLUDE_PATH=${{runner.temp}}/USD/include" \
134+
-D "CMAKE_LIBRARY_PATH=${{runner.temp}}/USD/lib" \
135+
..
136+
cmake --build . --config Release
137+
94138
- name: Check for formatting errors
95139
shell: bash
96140
working-directory: ${{github.workspace}}/build

cmake/modules/FindUSD.cmake

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,8 @@ if(USD_INCLUDE_DIR AND EXISTS "${USD_INCLUDE_DIR}/pxr/pxr.h")
8585
# if internal Boost.Python is not explicitly disabled
8686
if (USD_VERSION VERSION_LESS "0.25.5" OR _use_external_boost_python)
8787
set(USD_USE_INTERNAL_BOOST_PYTHON OFF CACHE INTERNAL "")
88-
list(APPEND USD_DEPENDENCIES "Boost::boost")
8988
if (BUILD_PYTHON_BINDINGS)
90-
list(APPEND USD_DEPENDENCIES "Boost::python")
89+
list(APPEND USD_DEPENDENCIES "Boost::boost" "Boost::python")
9190
endif()
9291
endif()
9392

0 commit comments

Comments
 (0)