-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Add pre-merge workflow for HLSL testing #122184
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
a6c0375
b2cee9e
e7372f7
12f924f
7c9763a
4dd8503
22fa02c
7c9f41f
a8b3089
c8fce72
18a274f
8d155e1
9969eea
b0bbdff
f165e31
bd85a5e
ce1b8b0
583f466
d85eb92
035b1d8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
name: HLSL Tests | ||
|
||
permissions: | ||
contents: read | ||
|
||
on: | ||
workflow_dispatch: | ||
pull_request: | ||
branches: | ||
- main | ||
paths: | ||
- llvm/**/DirectX/** | ||
- .github/workflows/hlsl* | ||
- clang/*HLSL*/**/* | ||
- clang/**/*HLSL* | ||
- llvm/**/Frontend/HLSL/**/* | ||
|
||
jobs: | ||
HLSL-Tests: | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
runs-on: | ||
- hlsl-macos | ||
|
||
uses: ./.github/workflows/hlsl-test-all.yaml | ||
with: | ||
SKU: hlsl-macos | ||
TestTarget: check-hlsl-clang-mtl # TODO: This target changes based on SKU | ||
LLVM-ref: ${{ github.ref }} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
name: HLSL Test | ||
|
||
permissions: | ||
contents: read | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
OffloadTest-branch: | ||
description: 'Test Suite Branch' | ||
required: false | ||
default: 'main' | ||
type: string | ||
LLVM-ref: | ||
description: 'LLVM Branch' | ||
required: false | ||
default: 'main' | ||
type: string | ||
SKU: | ||
required: true | ||
type: string | ||
TestTarget: | ||
required: false | ||
default: 'check-hlsl' | ||
type: string | ||
|
||
jobs: | ||
build: | ||
runs-on: ${{ inputs.SKU }} | ||
steps: | ||
- name: Checkout DXC | ||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | ||
with: | ||
repository: Microsoft/DirectXShaderCompiler | ||
ref: main | ||
path: DXC | ||
submodules: true | ||
- name: Checkout LLVM | ||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | ||
with: | ||
ref: ${{ inputs.LLVM-branch }} | ||
path: llvm-project | ||
- name: Checkout OffloadTest | ||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | ||
with: | ||
repository: llvm-beanz/offload-test-suite | ||
ref: main | ||
path: OffloadTest | ||
- name: Checkout Golden Images | ||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | ||
with: | ||
repository: llvm-beanz/offload-golden-images | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How are these images generated? Is there a reason this needs to be a separate repository? Are they expected to stay completely static? When working with something like this in the past I shipped images as a Github release, but I would had to regenerate things version to version of the software that I was trying to support. If things are expected to remain static, keeping them in a git repo seems reasonable enough to me. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. They are expected to mostly remain static, but also expected to be significant in size as we flesh out the test coverage. They're in a separate repository from the other tests because they are optional. Most tests do not rely on image comparison for correctness. |
||
ref: main | ||
path: golden-images | ||
- name: Setup Windows | ||
if: runner.os == 'Windows' | ||
uses: llvm/actions/setup-windows@main | ||
with: | ||
arch: amd64 | ||
- name: Build DXC | ||
run: | | ||
cd DXC | ||
mkdir build | ||
cd build | ||
cmake -G Ninja -DCMAKE_BUILD_TYPE=Release -C ${{ github.workspace }}/DXC/cmake/caches/PredefinedParams.cmake -C ${{ github.workspace }}/OffloadTest/cmake/caches/sccache.cmake -DHLSL_DISABLE_SOURCE_GENERATION=On ${{ github.workspace }}/DXC/ | ||
ninja dxv llvm-dis | ||
- name: Build LLVM | ||
run: | | ||
cd llvm-project | ||
mkdir build | ||
cd build | ||
cmake -G Ninja -DDXIL_DIS=${{ github.workspace }}/DXC/build/bin/llvm-dis -DLLVM_INCLUDE_DXIL_TESTS=On -DCMAKE_BUILD_TYPE=Release -C ${{ github.workspace }}/llvm-project/clang/cmake/caches/HLSL.cmake -C ${{ github.workspace }}/OffloadTest/cmake/caches/sccache.cmake -DDXC_DIR=${{ github.workspace }}/DXC/build/bin -DLLVM_EXTERNAL_OFFLOADTEST_SOURCE_DIR=${{ github.workspace }}/OffloadTest -DLLVM_EXTERNAL_PROJECTS="OffloadTest" -DLLVM_LIT_ARGS="--xunit-xml-output=testresults.xunit.xml -v" -DGOLDENIMAGE_DIR=${{ github.workspace }}/golden-images ${{ github.workspace }}/llvm-project/llvm/ | ||
ninja hlsl-test-depends llvm-test-depends clang-test-depends | ||
- name: Run HLSL Tests | ||
run: | | ||
cd llvm-project | ||
cd build | ||
ninja check-llvm | ||
ninja check-clang | ||
ninja check-hlsl-unit | ||
ninja ${{ inputs.TestTarget }} | ||
- name: Publish Test Results | ||
uses: EnricoMi/publish-unit-test-result-action/macos@170bf24d20d201b842d7a52403b73ed297e6645b # v2 | ||
if: always() && runner.os == 'macOS' | ||
with: | ||
comment_mode: off | ||
files: llvm-project/build/**/testresults.xunit.xml |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm assuming this is the repository for https://discourse.llvm.org/t/rfc-proposal-for-offload-execution-test-suite/83947?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes.