Skip to content

WIP: attempt to fix test workflows #161

WIP: attempt to fix test workflows

WIP: attempt to fix test workflows #161

Workflow file for this run

name: Run Tests
on:
push:
paths-ignore:
- '**.md'
pull_request:
paths-ignore:
- '**.md'
workflow_dispatch:
inputs:
enable-graphical-tests-mtlx:
description: Enable MaterialX graphical tests
type: boolean
default: false
enable-graphical-tests-preview:
description: Enable preview graphical tests
type: boolean
default: false
enable-usdchecker:
description: Run usdchecker on converted USD files
type: boolean
default: true
tests-branch:
description: Tests branch name
type: string
default: 'main'
test-filter:
description: Filter (regular expression)
type: string
defaults:
run:
shell: bash
jobs:
build-debug:
name: Build guc for USD v24.03 (Debug)
uses: ./.github/workflows/build-usd24.03.yml
with:
build-config: Debug
extra-cmake-flags: -DCMAKE_COMPILE_WARNING_AS_ERROR=ON
build-release:
name: Build guc for USD v24.03 (Release)
uses: ./.github/workflows/build-usd24.03.yml
with:
build-config: Release
extra-cmake-flags: -DCMAKE_COMPILE_WARNING_AS_ERROR=ON
smoke-test:
name: Smoke Test ${{ matrix.os-family }} (Release)
runs-on: ${{ matrix.image }}
needs: build-release
strategy:
fail-fast: false
matrix:
include:
- os-family: Linux
image: ubuntu-20.04
usd-download-url: "https://github.com/pablode/USD/releases/download/v24.03-ci-release/USD24.03_Linux_x64_Python3.9.tar.gz"
artifact-name: guc_USD24.03_Linux_x64_Python3.9.tar.gz
executable-name: guc
- os-family: Windows
image: windows-2019
usd-download-url: "https://github.com/pablode/USD/releases/download/v24.03-ci-release/USD24.03_Windows_x64_Python3.9.tar.gz"
artifact-name: guc_USD24.03_Windows_x64_Python3.9.tar.gz
executable-name: guc.exe
steps:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.9'
- name: Fetch USD binaries
run: curl ${{ matrix.usd-download-url }} -L -v -o USD.tar.gz
- name: Install USD binaries
run: mkdir -p USD_INSTALL && tar -xvf USD.tar.gz -C $PWD/USD_INSTALL
- name: Download guc artifacts
id: download-guc
uses: actions/download-artifact@v3
with:
name: ${{ needs.build-release.outputs.archive-name }}
- name: Install guc
run: mkdir -p GUC_INSTALL && tar -xvf ${{ matrix.artifact-name}} -C $PWD/GUC_INSTALL
- name: Set up environment variables (Linux)
if: matrix.os-family == 'Linux'
run: echo "LD_LIBRARY_PATH=$PWD/USD_INSTALL/lib" >> $GITHUB_ENV
- name: Set up environment variables (Windows)
if: matrix.os-family == 'Windows'
run: |
# We need to use real Windows paths, instead of MSYS2's auto-converted Unix paths
echo "$(pwd -W)/USD_INSTALL/lib" >> $GITHUB_PATH
echo "$(pwd -W)/USD_INSTALL/bin" >> $GITHUB_PATH
- name: Fetch example glTF file
run: mkdir test && curl "https://github.com/KhronosGroup/glTF-Sample-Models/raw/db9ff67c1116cfe28eb36320916bccd8c4127cc1/2.0/ToyCar/glTF-Binary/ToyCar.glb" -L -v -o test/asset.glb
- name: Run test
working-directory: test
run: ../GUC_INSTALL/bin/${{ matrix.executable-name }} asset.glb asset.usda --emit-mtlx
- name: Print output info
working-directory: test
run: |
ls -la .
cat asset.mtlx
cat asset.usda
conversion-tests:
name: Conversion Tests (Debug)
runs-on: ubuntu-20.04
needs: build-debug
env:
USD_DOWNLOAD_URL: "https://github.com/pablode/USD/releases/download/v24.03-ci-release/USD24.03_Linux_x64_Python3.9.tar.gz"
GUC_ARTIFACT_NAME: guc_USD24.03_Linux_x64_Python3.9.tar.gz
USD_INSTALL_PATH: /home/runner/work/USD/USD/INSTALL
steps:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.9'
- name: Fetch USD binaries
run: curl ${{ env.USD_DOWNLOAD_URL }} -L -v -o USD.tar.gz
- name: Install USD binaries
run: mkdir -p ${{ env.USD_INSTALL_PATH }} && tar -xvf USD.tar.gz -C ${{ env.USD_INSTALL_PATH }}
- name: Download guc artifacts
id: download-guc
uses: actions/download-artifact@v3
with:
name: ${{ needs.build-debug.outputs.archive-name }}
# Install guc to the USD installation so that we can use the usdGlTF Sdf plugin
- name: Install guc
run: tar -xvf ${{ env.GUC_ARTIFACT_NAME }} -C ${{ env.USD_INSTALL_PATH }}
- name: Install packages
run: |
# Use latest stable mesa because Storm requires OpenGL 4.6
sudo add-apt-repository ppa:kisak/kisak-mesa
sudo apt update
sudo apt upgrade
sudo apt-get install mesa-utils xvfb qt5-default
# usdrecord needs python (may change soon!)
- name: Install Python packages
run: pip3 install --user PySide2 PyOpenGL
- name: Set up environment variables
run: |
# Test options
if [[ -z "${{ inputs.enable-graphical-tests-mtlx }}" ]] || [[ "${{ inputs.enable-graphical-tests-mtlx }}" = "false" ]]; then
echo "GT_DISABLE_GRAPHICAL_MTLX=1" >> $GITHUB_ENV
fi
if [[ -z "${{ inputs.enable-graphical-tests-preview }}" ]] || [[ "${{ inputs.enable-graphical-tests-preview }}" = "false" ]]; then
echo "GT_DISABLE_GRAPHICAL_PREVIEW=1" >> $GITHUB_ENV
fi
if [[ -z "${{ inputs.enable-usdchecker }}" ]] || [[ "${{ inputs.enable-usdchecker }}" = "false" ]]; then
echo "GT_DISABLE_USDCHECKER=1" >> $GITHUB_ENV
fi
# Executables and libraries
echo "${{ env.USD_INSTALL_PATH }}/bin" >> $GITHUB_PATH
echo "LD_LIBRARY_PATH=${{ env.USD_INSTALL_PATH }}/lib" >> $GITHUB_ENV
echo "PYTHONPATH=${{ env.USD_INSTALL_PATH }}/lib/python" >> $GITHUB_ENV
# Software rendering
echo "DISPLAY=:1" >> $GITHUB_ENV
echo "LIBGL_ALWAYS_SOFTWARE=1" >> $GITHUB_ENV
echo "GALLIUM_DRIVER=llvmpipe" >> $GITHUB_ENV
echo "MESA_NO_ERROR=1" >> $GITHUB_ENV
# guc debug output
echo "TF_DEBUG=GUC" >> $GITHUB_ENV
- name: Start virtual framebuffer
run: |
Xvfb :1 -screen 0 1280x960x24 &
- name: Test glxinfo
run: glxinfo
- name: Print guc help
run: guc || [ $? -eq 1 ]
- name: Check out tests repository
uses: actions/checkout@v3
with:
repository: pablode/guc-tests
submodules: recursive
ref: ${{ inputs.tests-branch }}
- name: Run tests
run: bash ./run_tests.sh "${{ inputs.test-filter }}"
- name: Create test output archive
if: success() || failure()
working-directory: tests/output
run: tar -zcvf ../../test-output.tar.gz *
- name: Upload archive
if: success() || failure()
uses: actions/upload-artifact@v3
with:
path: test-output.tar.gz
if-no-files-found: error
name: test-output-${{ github.sha }}
retention-days: 7