|
| 1 | +name: HLSL Test |
| 2 | + |
| 3 | +permissions: |
| 4 | + contents: read |
| 5 | + checks: write |
| 6 | + |
| 7 | +on: |
| 8 | + workflow_dispatch: |
| 9 | + inputs: |
| 10 | + LLVM-Ref: |
| 11 | + description: 'Test Suite Branch' |
| 12 | + required: false |
| 13 | + default: 'main' |
| 14 | + type: string |
| 15 | + LLVM-branch: |
| 16 | + description: 'LLVM Branch' |
| 17 | + required: false |
| 18 | + default: 'main' |
| 19 | + type: string |
| 20 | + LLVM-fork: |
| 21 | + description: 'LLVM fork' |
| 22 | + required: false |
| 23 | + default: 'llvm' |
| 24 | + type: string |
| 25 | + DXC-branch: |
| 26 | + description: 'DXC Branch' |
| 27 | + required: false |
| 28 | + default: 'main' |
| 29 | + type: string |
| 30 | + BuildType: |
| 31 | + description: 'Build Type' |
| 32 | + required: false |
| 33 | + default: 'Release' |
| 34 | + type: choice |
| 35 | + options: |
| 36 | + - Release |
| 37 | + - RelWithDebInfo |
| 38 | + - Debug |
| 39 | + TestTarget: |
| 40 | + required: false |
| 41 | + default: 'check-hlsl' |
| 42 | + type: string |
| 43 | + Test-Clang: |
| 44 | + required: true |
| 45 | + type: choice |
| 46 | + options: |
| 47 | + - On |
| 48 | + - Off |
| 49 | + OS: |
| 50 | + required: true |
| 51 | + type: choice |
| 52 | + options: |
| 53 | + - macOS |
| 54 | + - windows |
| 55 | + SKU: |
| 56 | + required: true |
| 57 | + type: choice |
| 58 | + options: |
| 59 | + - hlsl-metal |
| 60 | + LLVM-ExtraCMakeArgs: |
| 61 | + description: 'Extra CMake Args for LLVM' |
| 62 | + required: false |
| 63 | + default: '' |
| 64 | + type: string |
| 65 | + workflow_call: |
| 66 | + inputs: |
| 67 | + OffloadTest-branch: |
| 68 | + description: 'Test Suite Branch' |
| 69 | + required: false |
| 70 | + default: 'main' |
| 71 | + type: string |
| 72 | + LLVM-branch: |
| 73 | + description: 'LLVM Branch' |
| 74 | + required: false |
| 75 | + default: 'main' |
| 76 | + type: string |
| 77 | + LLVM-fork: |
| 78 | + description: 'LLVM For' |
| 79 | + required: false |
| 80 | + default: 'llvm' |
| 81 | + type: string |
| 82 | + DXC-branch: |
| 83 | + description: 'DXC Branch' |
| 84 | + required: false |
| 85 | + default: 'main' |
| 86 | + type: string |
| 87 | + OS: |
| 88 | + required: true |
| 89 | + type: string |
| 90 | + SKU: |
| 91 | + required: true |
| 92 | + type: string |
| 93 | + BuildType: |
| 94 | + description: 'DXC Branch' |
| 95 | + required: false |
| 96 | + default: 'Release' |
| 97 | + type: string |
| 98 | + Test-Clang: |
| 99 | + required: false |
| 100 | + default: 'On' |
| 101 | + type: string |
| 102 | + TestTarget: |
| 103 | + required: false |
| 104 | + default: 'check-hlsl' |
| 105 | + type: string |
| 106 | + LLVM-ExtraCMakeArgs: |
| 107 | + description: 'Extra CMake Args for LLVM' |
| 108 | + required: false |
| 109 | + default: '' |
| 110 | + type: string |
| 111 | + |
| 112 | +jobs: |
| 113 | + build: |
| 114 | + runs-on: [self-hosted, "${{ inputs.SKU }}"] |
| 115 | + steps: |
| 116 | + - name: Checkout DXC |
| 117 | + uses: actions/checkout@v4 |
| 118 | + with: |
| 119 | + repository: Microsoft/DirectXShaderCompiler |
| 120 | + ref: ${{ inputs.DXC-branch }} |
| 121 | + path: DXC |
| 122 | + fetch-depth: 1 |
| 123 | + submodules: true |
| 124 | + - name: Checkout LLVM |
| 125 | + uses: actions/checkout@v4 |
| 126 | + with: |
| 127 | + repository: ${{ inputs.LLVM-fork }}/llvm-project |
| 128 | + ref: ${{ inputs.LLVM-branch }} |
| 129 | + path: llvm-project |
| 130 | + fetch-depth: 1 |
| 131 | + - name: Checkout OffloadTest |
| 132 | + uses: actions/checkout@v4 |
| 133 | + with: |
| 134 | + repository: llvm-beanz/offload-test-suite |
| 135 | + ref: ${{ inputs.OffloadTest-branch }} |
| 136 | + path: OffloadTest |
| 137 | + fetch-depth: 1 |
| 138 | + - name: Checkout Golden Images |
| 139 | + uses: actions/checkout@v4 |
| 140 | + with: |
| 141 | + repository: llvm-beanz/offload-golden-images |
| 142 | + ref: main |
| 143 | + path: golden-images |
| 144 | + fetch-depth: 1 |
| 145 | + - name: Setup Windows |
| 146 | + if: inputs.OS == 'windows' |
| 147 | + uses: llvm/actions/setup-windows@main |
| 148 | + with: |
| 149 | + arch: amd64 |
| 150 | + - name: Build DXC |
| 151 | + run: | |
| 152 | + cd DXC |
| 153 | + mkdir build |
| 154 | + cd build |
| 155 | + cmake -G Ninja -DCMAKE_BUILD_TYPE=${{ inputs.BuildType }} -C ${{ github.workspace }}/DXC/cmake/caches/PredefinedParams.cmake -C ${{ github.workspace }}/OffloadTest/cmake/caches/sccache.cmake -DHLSL_DISABLE_SOURCE_GENERATION=On ${{ github.workspace }}/DXC/ |
| 156 | + ninja |
| 157 | + - name: Build LLVM |
| 158 | + run: | |
| 159 | + cd llvm-project |
| 160 | + mkdir build |
| 161 | + cd build |
| 162 | + cmake -G Ninja ${{ inputs.LLVM-ExtraCMakeArgs }} -DDXIL_DIS=${{ github.workspace }}/DXC/build/bin/llvm-dis -DCMAKE_BUILD_TYPE=${{ inputs.BuildType }} -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" -DOFFLOADTEST_TEST_CLANG=${{ inputs.Test-Clang }} -DGOLDENIMAGE_DIR=${{ github.workspace }}/golden-images ${{ github.workspace }}/llvm-project/llvm/ |
| 163 | + ninja hlsl-test-depends llvm-test-depends clang-test-depends |
| 164 | + - name: Run HLSL Tests |
| 165 | + run: | |
| 166 | + cd llvm-project |
| 167 | + cd build |
| 168 | + ninja check-llvm |
| 169 | + ninja check-clang |
| 170 | + ninja check-hlsl-unit |
| 171 | + ninja ${{ inputs.TestTarget }} |
| 172 | + - name: Publish Test Results |
| 173 | + uses: EnricoMi/publish-unit-test-result-action/macos@v2 |
| 174 | + if: always() && inputs.OS == 'macOS' |
| 175 | + with: |
| 176 | + comment_mode: off |
| 177 | + files: llvm-project/build/**/testresults.xunit.xml |
0 commit comments