From 390946560cc54ffe299a6975ba8250aa589f3ba1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pablo=20Delgado=20Kr=C3=A4mer?= Date: Sun, 1 Dec 2024 23:54:42 +0100 Subject: [PATCH] GA: run hdGatling graphical tests --- .github/workflows/build-houdini20.yml | 2 +- .github/workflows/build-usd.yml | 27 +++++++++--- .github/workflows/build.yml | 63 +++++++++++++++++++++++---- .github/workflows/deploy-release.yml | 10 +++-- .github/workflows/validation.yml | 10 +++-- 5 files changed, 90 insertions(+), 22 deletions(-) diff --git a/.github/workflows/build-houdini20.yml b/.github/workflows/build-houdini20.yml index 2b8372f1..e69b82fa 100644 --- a/.github/workflows/build-houdini20.yml +++ b/.github/workflows/build-houdini20.yml @@ -39,7 +39,7 @@ jobs: build-config: Release usd-download-url: ${{ matrix.usd-download-url }} usd-install-path: ${{ matrix.usd-install-path }} - upload-archive: true + upload-install-artifacts: true archive-name: build-Release-${{ github.sha }} archive-file-name: ${{ matrix.archive-file-name }} mdl-sdk-cache-key: ${{ inputs.mdl-sdk-cache-key-prefix }}_${{ matrix.image }} diff --git a/.github/workflows/build-usd.yml b/.github/workflows/build-usd.yml index 4d4e828a..5631c120 100644 --- a/.github/workflows/build-usd.yml +++ b/.github/workflows/build-usd.yml @@ -21,11 +21,19 @@ on: required: false type: string default: "MDL-SDK" - upload-archives: + upload-install-artifacts: description: "Whether build results should be uploaded or not" required: false type: boolean default: false + run-graphical-tests: + required: false + type: boolean + default: false + upload-test-artifacts: + required: false + type: boolean + default: false jobs: build: @@ -38,25 +46,31 @@ jobs: image: ubuntu-20.04 usd-download-url: "https://github.com/pablode/USD/releases/download/v${{ inputs.usd-version }}-ci-release/USD${{ inputs.usd-version }}_Linux_x64.tar.gz" usd-install-path: "/home/runner/work/USD/USD/INSTALL" - upload-archive: ${{ inputs.upload-archives }} + upload-install-artifacts: ${{ inputs.upload-install-artifacts }} archive-file-name: "gatling_USD${{ inputs.usd-version }}_Linux_x64.tar.gz" cmake-params: + run-graphical-tests: ${{ inputs.run-graphical-tests }} + executable-suffix: - name: Ubuntu / clang image: ubuntu-20.04 usd-download-url: "https://github.com/pablode/USD/releases/download/v${{ inputs.usd-version }}-ci-release/USD${{ inputs.usd-version }}_Linux_x64.tar.gz" usd-install-path: "/home/runner/work/USD/USD/INSTALL" # Don't upload clang build results -- we already have GCC's - upload-archive: false + upload-install-artifacts: false cmake-params: -DCMAKE_C_COMPILER=/usr/bin/clang -DCMAKE_CXX_COMPILER=/usr/bin/clang++ + run-graphical-tests: false + executable-suffix: - name: Windows / MSVC image: windows-2019 usd-download-url: "https://github.com/pablode/USD/releases/download/v${{ inputs.usd-version }}-ci-release/USD${{ inputs.usd-version }}_Windows_x64.tar.gz" usd-install-path: "C:/INSTALL" - upload-archive: ${{ inputs.upload-archives }} + upload-install-artifacts: ${{ inputs.upload-install-artifacts }} archive-file-name: "gatling_USD${{ inputs.usd-version }}_Windows_x64.tar.gz" cmake-params: -G"Visual Studio 16 2019" -Ax64 + run-graphical-tests: false + executable-suffix: '.exe' uses: ./.github/workflows/build.yml with: @@ -64,8 +78,11 @@ jobs: build-config: ${{ inputs.build-config }} usd-download-url: ${{ matrix.usd-download-url }} usd-install-path: ${{ matrix.usd-install-path }} - upload-archive: ${{ matrix.upload-archive }} + upload-install-artifacts: ${{ matrix.upload-install-artifacts }} archive-name: build-${{ inputs.build-config }}-${{ github.sha }} archive-file-name: ${{ matrix.archive-file-name }} mdl-sdk-cache-key: ${{ inputs.mdl-sdk-cache-key-prefix }}_${{ matrix.image }} cmake-params: ${{ matrix.cmake-params }} + run-graphical-tests: ${{ matrix.run-graphical-tests }} + upload-test-artifacts: ${{ inputs.upload-test-artifacts }} + executable-suffix: ${{ matrix.executable-suffix }} diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f8d4e5a1..25f638f4 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -16,7 +16,7 @@ on: usd-install-path: required: true type: string - upload-archive: + upload-install-artifacts: required: false type: boolean default: false @@ -36,6 +36,18 @@ on: required: false type: boolean default: false + run-graphical-tests: + required: false + type: boolean + default: false + upload-test-artifacts: + required: false + type: boolean + default: false + executable-suffix: + required: false + type: string + default: '' defaults: run: @@ -54,12 +66,38 @@ jobs: uses: actions/checkout@v4 with: submodules: recursive + lfs: true - name: Install libgl1 package if: runner.os == 'Linux' # There seems to be a transitive dependency on libGL (perhaps by hgi) run: sudo apt-get update && sudo apt-get install libgl1-mesa-dev + - name: Install Mesa & Vulkan packages + if: ${{ runner.os == 'Linux' && inputs.run-graphical-tests }} + run: | + sudo add-apt-repository ppa:kisak/kisak-mesa + sudo apt update + sudo apt upgrade + sudo apt-get install mesa-utils xvfb qt5-default libgl1-mesa-dev libvulkan-dev vulkan-tools mesa-vulkan-drivers + + - name: Set up graphical environment variables + if: ${{ runner.os == 'Linux' && inputs.run-graphical-tests }} + run: | + echo "LD_LIBRARY_PATH=${{ inputs.usd-install-path }}/lib" >> $GITHUB_ENV + echo "DISPLAY=:1" >> $GITHUB_ENV + echo "LIBGL_ALWAYS_SOFTWARE=1" >> $GITHUB_ENV + echo "GALLIUM_DRIVER=llvmpipe" >> $GITHUB_ENV + + - name: Start virtual framebuffer + if: ${{ runner.os == 'Linux' && inputs.run-graphical-tests }} + run: | + Xvfb :1 -screen 0 1280x960x24 & + + - name: Test vulkaninfo + if: ${{ runner.os == 'Linux' && inputs.run-graphical-tests }} + run: vulkaninfo + - name: Fetch USD binaries run: curl ${{ inputs.usd-download-url }} -L -v -o USD.tar.gz @@ -109,13 +147,12 @@ jobs: - name: Run imgio_test working-directory: BUILD - if: runner.os != 'Windows' - run: ./bin/imgio_test + run: ./bin/imgio_test${{ inputs.executable-suffix }} - - name: Run imgio_test + - name: Run hdGatling_test working-directory: BUILD - if: runner.os == 'Windows' - run: ./bin/imgio_test.exe + if: inputs.run-graphical-tests + run: ./bin/hdGatling_test${{ inputs.executable-suffix }} - name: Install gatling working-directory: BUILD @@ -134,13 +171,21 @@ jobs: mv hdGatling dso/usd_plugins mv hdGatling* dso/usd - - name: Create archive - if: inputs.upload-archive + - name: Upload test artifacts + if: ${{ inputs.run-graphical-tests && inputs.upload-test-artifacts && failure() }} + uses: actions/upload-artifact@v3 + with: + name: test-artifacts + path: TEST/* + retention-days: 7 + + - name: Create install artifacts + if: inputs.upload-install-artifacts working-directory: INSTALL run: tar -zcvf ${{ inputs.archive-file-name }} * - name: Upload archive - if: inputs.upload-archive + if: inputs.upload-install-artifacts uses: actions/upload-artifact@v3 with: name: ${{ inputs.archive-name }} diff --git a/.github/workflows/deploy-release.yml b/.github/workflows/deploy-release.yml index a781348c..b36dd71c 100644 --- a/.github/workflows/deploy-release.yml +++ b/.github/workflows/deploy-release.yml @@ -17,7 +17,8 @@ jobs: with: usd-version: 24.11 mdl-sdk-cache-key-prefix: ${{ vars.MDL_SDK_CACHE_KEY_PREFIX }} - upload-archives: true + upload-install-artifacts: true + run-graphical-tests: true build-usd2408: name: Build gatling for USD v24.08 @@ -26,7 +27,8 @@ jobs: with: usd-version: 24.08 mdl-sdk-cache-key-prefix: ${{ vars.MDL_SDK_CACHE_KEY_PREFIX }} - upload-archives: true + upload-install-artifacts: true + run-graphical-tests: true build-usd2405: name: Build gatling for USD v24.05 @@ -35,7 +37,7 @@ jobs: with: usd-version: 24.05 mdl-sdk-cache-key-prefix: ${{ vars.MDL_SDK_CACHE_KEY_PREFIX }} - upload-archives: true + upload-install-artifacts: true build-usd2403: name: Build gatling for USD v24.03 @@ -44,7 +46,7 @@ jobs: with: usd-version: 24.03 mdl-sdk-cache-key-prefix: ${{ vars.MDL_SDK_CACHE_KEY_PREFIX }} - upload-archives: true + upload-install-artifacts: true build-houdini20: name: Build gatling for Houdini 20.0 diff --git a/.github/workflows/validation.yml b/.github/workflows/validation.yml index 14cd6f09..a9ffdffc 100644 --- a/.github/workflows/validation.yml +++ b/.github/workflows/validation.yml @@ -2,9 +2,9 @@ name: Validation Build on: push: - branches: - - 'master' - - 'dev' + #branches: + # - 'master' + # - 'dev' paths-ignore: - '**.md' - '**.glsl' @@ -23,6 +23,8 @@ jobs: with: usd-version: 24.11 mdl-sdk-cache-key-prefix: ${{ vars.MDL_SDK_CACHE_KEY_PREFIX }} + run-graphical-tests: true + upload-test-artifacts: true build-2408: name: Build gatling for USD v24.08 (Release) @@ -31,6 +33,8 @@ jobs: with: usd-version: 24.08 mdl-sdk-cache-key-prefix: ${{ vars.MDL_SDK_CACHE_KEY_PREFIX }} + run-graphical-tests: true + upload-test-artifacts: true build-2405: name: Build gatling for USD v24.05 (Release)