| name: SPIR-V Tests | |
| permissions: | |
| contents: read | |
| on: | |
| pull_request: | |
| paths: | |
| - 'llvm/lib/Target/SPIRV/**' | |
| - 'llvm/test/CodeGen/SPIRV/**' | |
| - '.github/workflows/spirv-tests.yml' | |
| concurrency: | |
| # Skip intermediate builds: always. | |
| # Cancel intermediate builds: only if it is a pull request build. | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }} | |
| jobs: | |
| check_spirv: | |
| if: github.repository_owner == 'llvm' | |
| name: Test SPIR-V | |
| runs-on: ubuntu-26.04 | |
| container: | |
| image: ghcr.io/llvm/ci-ubuntu-26.04:latest@sha256:7ac659feb90ac48dd8676e4eb305b9aa5b31fc8b329b7e39379c38af06efc6e1 | |
| steps: | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| persist-credentials: false | |
| - name: Setup ccache | |
| uses: hendrikmuhs/ccache-action@f09c25b45002a07be2955cbe52e8cee55643f89d # v1.2.24 | |
| with: | |
| max-size: 2G | |
| key: spirv-ubuntu-26.04 | |
| variant: sccache | |
| - name: Build and Test | |
| run: | | |
| cmake -GNinja \ | |
| -S llvm \ | |
| -B build \ | |
| -DCMAKE_BUILD_TYPE=Release \ | |
| -DLLVM_ENABLE_ASSERTIONS=ON \ | |
| -DCMAKE_C_COMPILER_LAUNCHER=sccache \ | |
| -DCMAKE_CXX_COMPILER_LAUNCHER=sccache \ | |
| -DLLVM_TARGETS_TO_BUILD="SPIRV" \ | |
| -DLLVM_INCLUDE_SPIRV_TOOLS_TESTS=ON | |
| ninja -C build check-llvm-codegen-spirv |