-
Notifications
You must be signed in to change notification settings - Fork 7
102 lines (89 loc) · 3.13 KB
/
test-windows.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
name: test-windows
on:
push:
branches: [ main ]
pull_request:
branches: [ main, dev ]
# Run tests once a week on Sunday.
schedule:
- cron: "0 6 * * 0"
permissions:
contents: read
jobs:
test-windows:
runs-on: windows-2019
timeout-minutes: 300
strategy:
fail-fast: false
matrix:
usd: ["v23.11", "v24.08"]
python: ["3.7", "3.10"]
include:
- usd: "v24.08"
python: "3.11"
name: "USD-${{ matrix.usd }}-py${{ matrix.python }}"
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
- name: Create Build Environment
run: |
vcpkg install --triplet=x64-windows gtest
pip install pytest pytest-cmake
cmake -E make_directory ${{runner.workspace}}/build
cmake -E make_directory ${{runner.temp}}/USD
- name: Install USD
working-directory: ${{runner.temp}}/USD
shell: cmd
run: |
call "C:/Program Files/Microsoft Visual Studio/2022/Enterprise/VC/Auxiliary/Build/vcvars64.bat"
set VCPKG_TARGET_TRIPLET=x64-windows
set CMAKE_TOOLCHAIN_FILE=%VCPKG_INSTALLATION_ROOT%/scripts/buildsystems/vcpkg.cmake
git clone https://github.com/PixarAnimationStudios/OpenUSD.git ^
--depth 1 --branch ${{ matrix.usd }} ./src
python ./src/build_scripts/build_usd.py . ^
--generator "Visual Studio 16 2019" ^
--no-tests ^
--no-examples ^
--no-tutorials ^
--no-tools ^
--no-docs ^
--no-imaging ^
--no-materialx ^
-v
- name: Configure & Build
shell: bash
working-directory: ${{runner.workspace}}/build
run: |
export PATH="${{runner.temp}}/USD/bin;${{runner.temp}}/USD/lib;${PATH}"
export PYTHONPATH="${{runner.temp}}/USD/lib/python;${PYTHONPATH}"
cmake \
-G "Visual Studio 16 2019" -A x64 \
-D "CMAKE_TOOLCHAIN_FILE=${VCPKG_INSTALLATION_ROOT}/scripts/buildsystems/vcpkg.cmake" \
-D "VCPKG_TARGET_TRIPLET=x64-windows" \
-D "BUILD_DOCS=OFF" \
-D "CMAKE_INCLUDE_PATH=${{runner.temp}}/USD/include" \
-D "CMAKE_LIBRARY_PATH=${{runner.temp}}/USD/lib" \
'${{github.workspace}}'
cmake --build . --config Release
- name: Check for formatting errors
shell: bash
working-directory: ${{runner.workspace}}/build
run: |
cmake --build . --target format
STATUS_OUTPUT=$(git -C ${GITHUB_WORKSPACE} status --porcelain)
if [ -n "$STATUS_OUTPUT" ]; then
echo "Code formatting errors found:"
git -C ${GITHUB_WORKSPACE} diff
exit 1
else
echo "No formatting errors found."
fi
- name: Run Test
shell: bash
working-directory: ${{runner.workspace}}/build
run: ctest -VV -C Release
env:
CTEST_OUTPUT_ON_FAILURE: True