Skip to content

Commit

Permalink
Try to compare screenshots
Browse files Browse the repository at this point in the history
  • Loading branch information
RobDangerous committed Sep 24, 2024
1 parent aa746ac commit 33eb6b9
Show file tree
Hide file tree
Showing 2 changed files with 92 additions and 21 deletions.
104 changes: 84 additions & 20 deletions .github/workflows/windows-direct3d12.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,64 +19,128 @@ jobs:

- name: Get Submodules
run: ./get_dlc
- name: Get ImageMagick
run: |
choco install -y imagemagick.app --no-progress
Get-ChildItem -Path "${env:ProgramFiles}" | Where-Object {($_.Name -Like 'ImageMagick*')} | % { $_.FullName } | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8
- name: Compile Shader
working-directory: Shader
run: ../Kinc/make windows -v vs2022 -g direct3d12 --compile
run: ../Kinc/make windows -v vs2022 -g direct3d12 --option screenshot --run
- name: Check Shader
working-directory: Shader
run: magick compare -metric mae .\reference.png .\Deployment\test.png difference.png
- name: Compile Texture
working-directory: Texture
run: ../Kinc/make windows -v vs2022 -g direct3d12 --compile
run: ../Kinc/make windows -v vs2022 -g direct3d12 --option screenshot --run
- name: Check Texture
working-directory: Texture
run: magick compare -metric mae .\reference.png .\Deployment\test.png difference.png
- name: Compile ComputeShader
working-directory: ComputeShader
run: ../Kinc/make windows -v vs2022 -g direct3d12 --compile
run: ../Kinc/make windows -v vs2022 -g direct3d12 --option screenshot --run
- name: Check ComputeShader
working-directory: ComputeShader
run: magick compare -metric mae .\reference.png .\Deployment\test.png difference.png
- name: Compile TextureArray
working-directory: TextureArray
run: ../Kinc/make windows -v vs2022 -g direct3d12 --compile
run: ../Kinc/make windows -v vs2022 -g direct3d12 --option screenshot --run
- name: Check TextureArray
working-directory: TextureArray
run: magick compare -metric mae .\reference.png .\Deployment\test.png difference.png
- name: Compile 00_empty
working-directory: 00_empty
run: ../Kinc/make windows -v vs2022 -g direct3d12 --compile
run: ../Kinc/make windows -v vs2022 -g direct3d12 --option screenshot --run
- name: Check 00_empty
working-directory: 00_empty
run: magick compare -metric mae .\reference.png .\Deployment\test.png difference.png
- name: Compile 01_triangle
working-directory: 01_triangle
run: ../Kinc/make windows -v vs2022 -g direct3d12 --compile
run: ../Kinc/make windows -v vs2022 -g direct3d12 --option screenshot --run
- name: Check 01_triangle
working-directory: 01_triangle
run: magick compare -metric mae .\reference.png .\Deployment\test.png difference.png
- name: Compile 02_matrix
working-directory: 02_matrix
run: ../Kinc/make windows -v vs2022 -g direct3d12 --compile
run: ../Kinc/make windows -v vs2022 -g direct3d12 --option screenshot --run
- name: Check 02_matrix
working-directory: 02_matrix
run: magick compare -metric mae .\reference.png .\Deployment\test.png difference.png
- name: Compile 03_colored_cube
working-directory: 03_colored_cube
run: ../Kinc/make windows -v vs2022 -g direct3d12 --compile
run: ../Kinc/make windows -v vs2022 -g direct3d12 --option screenshot --run
- name: Check 03_colored_cube
working-directory: 03_colored_cube
run: magick compare -metric mae .\reference.png .\Deployment\test.png difference.png
- name: Compile 04_textured_cube
working-directory: 04_textured_cube
run: ../Kinc/make windows -v vs2022 -g direct3d12 --compile
run: ../Kinc/make windows -v vs2022 -g direct3d12 --option screenshot --run
- name: Check 04_textured_cube
working-directory: 04_textured_cube
run: magick compare -metric mae .\reference.png .\Deployment\test.png difference.png
- name: Compile 05_camera_controls
working-directory: 05_camera_controls
run: ../Kinc/make windows -v vs2022 -g direct3d12 --compile
run: ../Kinc/make windows -v vs2022 -g direct3d12 --option screenshot --run
- name: Check 05_camera_controls
working-directory: 05_camera_controls
run: magick compare -metric mae .\reference.png .\Deployment\test.png difference.png
- name: Compile 06_render_targets
working-directory: 06_render_targets
run: ../Kinc/make windows -v vs2022 -g direct3d12 --compile
run: ../Kinc/make windows -v vs2022 -g direct3d12 --option screenshot --run
- name: Check 06_render_targets
working-directory: 06_render_targets
run: magick compare -metric mae .\reference.png .\Deployment\test.png difference.png
- name: Compile 07_multiple_render_targets
working-directory: 07_multiple_render_targets
run: ../Kinc/make windows -v vs2022 -g direct3d12 --compile
run: ../Kinc/make windows -v vs2022 -g direct3d12 --option screenshot --run
- name: Check 07_multiple_render_targets
working-directory: 07_multiple_render_targets
run: magick compare -metric mae .\reference.png .\Deployment\test.png difference.png
- name: Compile 08_float_render_targets
working-directory: 08_float_render_targets
run: ../Kinc/make windows -v vs2022 -g direct3d12 --compile
run: ../Kinc/make windows -v vs2022 -g direct3d12 --option screenshot --run
- name: Check 08_float_render_targets
working-directory: 08_float_render_targets
run: magick compare -metric mae .\reference.png .\Deployment\test.png difference.png
- name: Compile 09_depth_render_targets
working-directory: 09_depth_render_targets
run: ../Kinc/make windows -v vs2022 -g direct3d12 --compile
run: ../Kinc/make windows -v vs2022 -g direct3d12 --option screenshot --run
- name: Check 09_depth_render_targets
working-directory: 09_depth_render_targets
run: magick compare -metric mae .\reference.png .\Deployment\test.png difference.png
- name: Compile 10_cubemap
working-directory: 10_cubemap
run: ../Kinc/make windows -v vs2022 -g direct3d12 --compile
run: ../Kinc/make windows -v vs2022 -g direct3d12 --option screenshot --run
- name: Check 10_cubemap
working-directory: 10_cubemap
run: magick compare -metric mae .\reference.png .\Deployment\test.png difference.png
- name: Compile 11_instanced_rendering
working-directory: 11_instanced_rendering
run: ../Kinc/make windows -v vs2022 -g direct3d12 --compile
run: ../Kinc/make windows -v vs2022 -g direct3d12 --option screenshot --run
- name: Check 11_instanced_rendering
working-directory: 11_instanced_rendering
run: magick compare -metric mae .\reference.png .\Deployment\test.png difference.png
- name: Compile 12_set_render_target_depth
working-directory: 12_set_render_target_depth
run: ../Kinc/make windows -v vs2022 -g direct3d12 --compile
run: ../Kinc/make windows -v vs2022 -g direct3d12 --option screenshot --run
- name: Check 12_set_render_target_depth
working-directory: 12_set_render_target_depth
run: magick compare -metric mae .\reference.png .\Deployment\test.png difference.png
- name: Compile 13_generate_mipmaps
working-directory: 13_generate_mipmaps
run: ../Kinc/make windows -v vs2022 -g direct3d12 --compile
run: ../Kinc/make windows -v vs2022 -g direct3d12 --option screenshot --run
- name: Check 13_generate_mipmaps
working-directory: 13_generate_mipmaps
run: magick compare -metric mae .\reference.png .\Deployment\test.png difference.png
- name: Compile 14_set_mipmap
working-directory: 14_set_mipmap
run: ../Kinc/make windows -v vs2022 -g direct3d12 --compile
run: ../Kinc/make windows -v vs2022 -g direct3d12 --option screenshot --run
- name: Check 14_set_mipmap
working-directory: 14_set_mipmap
run: magick compare -metric mae .\reference.png .\Deployment\test.png difference.png
- name: Compile 15_deinterleaved_buffers
working-directory: 15_deinterleaved_buffers
run: ../Kinc/make windows -v vs2022 -g direct3d12 --compile
run: ../Kinc/make windows -v vs2022 -g direct3d12 --option screenshot --run
- name: Check 15_deinterleaved_buffers
working-directory: 15_deinterleaved_buffers
run: magick compare -metric mae .\reference.png .\Deployment\test.png difference.png
9 changes: 8 additions & 1 deletion write_workflows.js
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,10 @@ ${java}
${steps}
- name: Get Submodules
run: ./get_dlc
- name: Get ImageMagick
run: |
choco install -y imagemagick.app --no-progress
Get-ChildItem -Path \"\${env:ProgramFiles}\" | Where-Object {($_.Name -Like 'ImageMagick*')} | % { $_.FullName } | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8
${postfixSteps}
`;

Expand Down Expand Up @@ -279,7 +283,10 @@ ${postfixSteps}
workflowText +=
` - name: Compile ${sample}
working-directory: ${sample}
run: ${prefix}../Kinc/make ${sys}${vs}${gfx}${options} --compile${postfix}
run: ${prefix}../Kinc/make ${sys}${vs}${gfx}${options} --option screenshot --run${postfix}
- name: Check ${sample}
working-directory: ${sample}
run: magick compare -metric mae .\\reference.png .\\Deployment\\test.png difference.png
`;
if (workflow.env) {
workflowText += workflow.env;
Expand Down

0 comments on commit 33eb6b9

Please sign in to comment.