Skip to content

Commit

Permalink
Enabled golden image validation on GitHub CI (#50)
Browse files Browse the repository at this point in the history
  • Loading branch information
TheMostDiligent committed Aug 9, 2022
1 parent 881e626 commit 30c0e75
Show file tree
Hide file tree
Showing 52 changed files with 40 additions and 222 deletions.
42 changes: 40 additions & 2 deletions .github/workflows/build-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@ name: Win32/UWP build

on: [push, pull_request]

env:
# 'capture' - generate golden images
# 'compare' - render and compare with the references
# 'compare_update' - first compare with the references and then update them
test_mode: compare_update

jobs:
precheks:
name: Win10 -> Pre-checks
Expand All @@ -23,13 +29,14 @@ jobs:
shell: cmd
working-directory: ${{github.workspace}}/DiligentSamples/BuildTools/FormatValidation
run: validate_format_win.bat


build:
needs: precheks
runs-on: windows-2022

strategy:
fail-fast: false
matrix:
name: ["Win10"]
toolset: ["Win32", "x64"]
Expand Down Expand Up @@ -85,9 +92,15 @@ jobs:
name: Win10 -> ${{ matrix.name }}-${{ matrix.toolset }}, ${{ matrix.build_type }}

steps:
- name: Checkout
- name: Checkout Code Base
uses: DiligentGraphics/github-action/checkout@v1

- name: Checkout Test Data
uses: actions/checkout@v2
with:
repository: DiligentGraphics/DiligentTestData
path: DiligentTestData

- name: Set up build environment
if: success()
uses: DiligentGraphics/github-action/setup-build-env@v1
Expand All @@ -108,3 +121,28 @@ jobs:
- name: Build
if: success()
uses: DiligentGraphics/github-action/build@v1

- name: Run Sample Tests D3D11
working-directory: ${{github.workspace}}/DiligentTestData/GoldenImages
if: ${{ success() && (matrix.name == 'Win10' || matrix.name == 'Win8.1') }}
shell: cmd
run: |
:: Run Sample Tests D3D11
ProcessGoldenImages.bat "$DILIGENT_BUILD_DIR" ${{matrix.build_type}} ${{matrix.test_mode}} "--mode d3d11 --adapter sw"
- name: Run Sample Tests D3D12
working-directory: ${{github.workspace}}/DiligentTestData/GoldenImages
if: ${{ success() && matrix.name == 'Win10' }}
shell: cmd
run: |
:: Run Sample Tests D3D12
ProcessGoldenImages.bat "$DILIGENT_BUILD_DIR" ${{matrix.build_type}} ${{matrix.test_mode}} "--mode d3d12 --adapter sw"
- name: Upload Golden Images
uses: actions/upload-artifact@v2
if: ${{ matrix.name == 'Win10' || matrix.name == 'Win8.1' }}
with:
name: GoldenImages-${{ matrix.name }}-${{ matrix.toolset }}-${{ matrix.build_type }}
path: |
${{github.workspace}}/DiligentTestData/GoldenImages
retention-days: 90
15 changes: 0 additions & 15 deletions BuildTools/Scripts/appveyor/run_tests.bat

This file was deleted.

188 changes: 0 additions & 188 deletions Tests/GoldenImages/ProcessGoldenImages.bat

This file was deleted.

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
17 changes: 0 additions & 17 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,6 @@ image:
- Visual Studio 2019

environment:
# use 'capture' to generate golden images and upload them as build artifacts
# use 'compare' to render and compare with the golden references
# use 'compare_update' to first compare with the references and then update them
test_mode: compare_update

matrix:
- platform: x64
configuration: Debug
Expand Down Expand Up @@ -52,15 +47,3 @@ build:
project: c:\projects\build\DiligentSamples_Test.sln
verbosity: minimal
parallel: true

test_script:
- 'cd %APPVEYOR_BUILD_FOLDER%\Tests\GoldenImages'
- '%APPVEYOR_BUILD_FOLDER%\BuildTools\Scripts\appveyor\run_tests.bat c:\projects\build %test_mode%'

after_test:
- 'cd %APPVEYOR_BUILD_FOLDER%'
- 7z a golden_images-"%CONFIGURATION%".zip .\Tests\GoldenImages\*\*

artifacts:
- path: \golden_images-*.zip
name: golden_images-zip

0 comments on commit 30c0e75

Please sign in to comment.