summaryrefslogtreecommitdiff
path: root/.github/workflows/spirv-tests.yml
blob: 69374ae5633060ebb2067edf9586ae9e086af0bb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
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
    steps:
      - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
      - name: Setup ccache
        uses: hendrikmuhs/ccache-action@bfa03e1de4d7f7c3e80ad9109feedd05c4f5a716 # v1.2.19
        with:
          max-size: 2G
          key: spirv-ubuntu-24.04
          variant: sccache
      - name: Build and Test
        run: |
          mkdir build
          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