| 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-24.04 | |
| container: | |
| image: ghcr.io/llvm/ci-ubuntu-24.04:latest@sha256:cc4fd65c131d4de97ebc077a4608f78fa959e45f2f9e7cf690c133b48d9cd7fa | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| persist-credentials: false | |
| - name: Setup ccache | |
| uses: hendrikmuhs/ccache-action@33522472633dbd32578e909b315f5ee43ba878ce # v1.2.22 | |
| with: | |
| max-size: 2G | |
| key: spirv-ubuntu-24.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 |