test-windows #149
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: test-windows | |
| on: | |
| push: | |
| branches: [ main, dev ] | |
| 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-2022 | |
| timeout-minutes: 300 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| usd: ["v24.08", "v25.05.01"] | |
| python: ["", "3.10", "3.12"] | |
| name: "USD-${{ matrix.usd }}${{ matrix.python != '' && format('-py{0}', matrix.python) || '-no-py' }}" | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python ${{ matrix.python }} | |
| if: matrix.python != '' | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python }} | |
| - name: Create Build Environment | |
| run: | | |
| vcpkg install --triplet=x64-windows gtest | |
| cmake -E make_directory ${{github.workspace}}\build | |
| cmake -E make_directory ${{runner.temp}}\USD | |
| - name: Install test Python deps | |
| if: matrix.python != '' | |
| run: | | |
| python -m pip install -r ${{github.workspace}}/test/requirements.txt | |
| - name: Download USD | |
| working-directory: ${{runner.temp}}/USD | |
| shell: cmd | |
| run: | | |
| git clone https://github.com/PixarAnimationStudios/OpenUSD.git ^ | |
| --depth 1 --branch ${{ matrix.usd }} ./src | |
| - name: Apply patch for USD v24.08 | |
| if: matrix.usd == 'v24.08' | |
| working-directory: ${{runner.temp}}/USD | |
| shell: bash | |
| run: | | |
| sed -i '/BOOST_URL/ s|boostorg.jfrog.io.*/release|sourceforge.net/projects/boost/files/boost|' src/build_scripts/build_usd.py | |
| sed -i '/BOOST_URL/ s|source/boost|boost|' src/build_scripts/build_usd.py | |
| sed -i '/BOOST_URL/ s|\.zip"|.zip/download"|' src/build_scripts/build_usd.py | |
| - name: Install USD | |
| if: matrix.python != '' | |
| 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 | |
| python ./src/build_scripts/build_usd.py . ^ | |
| --generator "Visual Studio 17 2022" ^ | |
| --no-tests ^ | |
| --no-examples ^ | |
| --no-tutorials ^ | |
| --no-tools ^ | |
| --no-docs ^ | |
| --no-imaging ^ | |
| --no-materialx ^ | |
| -v | |
| - name: Install USD (without Python) | |
| if: matrix.python == '' | |
| 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 | |
| python ./src/build_scripts/build_usd.py . ^ | |
| --generator "Visual Studio 17 2022" ^ | |
| --no-tests ^ | |
| --no-examples ^ | |
| --no-tutorials ^ | |
| --no-tools ^ | |
| --no-docs ^ | |
| --no-imaging ^ | |
| --no-materialx ^ | |
| --no-python ^ | |
| -v | |
| - name: Configure & Build | |
| if: matrix.python != '' | |
| shell: bash | |
| working-directory: ${{github.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 17 2022" -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" \ | |
| .. | |
| cmake --build . --config Release | |
| - name: Configure & Build (without Python) | |
| if: matrix.python == '' | |
| shell: bash | |
| working-directory: ${{github.workspace}}/build | |
| run: | | |
| export PATH="${{runner.temp}}/USD/bin;${{runner.temp}}/USD/lib;${PATH}" | |
| cmake \ | |
| -G "Visual Studio 17 2022" -A x64 \ | |
| -D "CMAKE_TOOLCHAIN_FILE=${VCPKG_INSTALLATION_ROOT}/scripts/buildsystems/vcpkg.cmake" \ | |
| -D "VCPKG_TARGET_TRIPLET=x64-windows" \ | |
| -D "BUILD_DOCS=OFF" \ | |
| -D "BUILD_PYTHON_BINDINGS=OFF" \ | |
| -D "CMAKE_INCLUDE_PATH=${{runner.temp}}/USD/include" \ | |
| -D "CMAKE_LIBRARY_PATH=${{runner.temp}}/USD/lib" \ | |
| .. | |
| cmake --build . --config Release | |
| - name: Check for formatting errors | |
| shell: bash | |
| working-directory: ${{github.workspace}}/build | |
| run: | | |
| cmake --build . --target format | |
| STATUS_OUTPUT=$(git -C .. status --porcelain) | |
| if [ -n "$STATUS_OUTPUT" ]; then | |
| echo "Code formatting errors found:" | |
| git -C .. diff | |
| exit 1 | |
| else | |
| echo "No formatting errors found." | |
| fi | |
| - name: Run Test | |
| shell: bash | |
| working-directory: ${{github.workspace}}/build | |
| run: ctest -VV -C Release | |
| env: | |
| CTEST_OUTPUT_ON_FAILURE: True |