Skip to content

Commit bc79e3a

Browse files
committed
[SPIR-V] Add pre-commit CI workflow
Add a pre-commit CI workflow for the experimental SPIR-V backend. This action should only run when SPIR-V target or test files are modified. The `codegen-spirv` tests don't run as part of `check-all` because the SPIR-V backend is still experimental. Depends on #73371 (for a green tree)
1 parent 4d4c30a commit bc79e3a

File tree

2 files changed

+35
-1
lines changed

2 files changed

+35
-1
lines changed

.github/workflows/llvm-project-tests.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ on:
1010
required: false
1111
projects:
1212
required: false
13+
experimental_targets:
14+
required: false
1315
workflow_call:
1416
inputs:
1517
build_target:
@@ -20,6 +22,10 @@ on:
2022
required: true
2123
type: string
2224

25+
experimental_targets:
26+
required: false
27+
type: string
28+
2329
concurrency:
2430
# Skip intermediate builds: always.
2531
# Cancel intermediate builds: only if it is a pull request build.
@@ -85,7 +91,7 @@ jobs:
8591
# This should be a no-op for non-mac OSes
8692
PKG_CONFIG_PATH: /usr/local/Homebrew/Library/Homebrew/os/mac/pkgconfig//12
8793
with:
88-
cmake_args: '-GNinja -DLLVM_ENABLE_PROJECTS="${{ inputs.projects }}" -DCMAKE_BUILD_TYPE=Release -DLLDB_INCLUDE_TESTS=OFF -DCMAKE_C_COMPILER_LAUNCHER=sccache -DCMAKE_CXX_COMPILER_LAUNCHER=sccache'
94+
cmake_args: '-GNinja -DLLVM_ENABLE_PROJECTS="${{ inputs.projects }}" -DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD="${{ inputs.experimental_targets }}" -DCMAKE_BUILD_TYPE=Release -DLLDB_INCLUDE_TESTS=OFF -DCMAKE_C_COMPILER_LAUNCHER=sccache -DCMAKE_CXX_COMPILER_LAUNCHER=sccache'
8995
build_target: '${{ inputs.build_target }}'
9096

9197
- name: Build and Test libclc

.github/workflows/spirv-tests.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: SPIR-V Tests
2+
3+
permissions:
4+
contents: read
5+
6+
on:
7+
workflow_dispatch:
8+
pull_request:
9+
paths:
10+
- 'llvm/lib/Target/SPIRV/**'
11+
- 'llvm/test/CodeGen/SPIRV/**'
12+
- '.github/workflows/spirv-tests.yml'
13+
14+
concurrency:
15+
# Skip intermediate builds: always.
16+
# Cancel intermediate builds: only if it is a pull request build.
17+
group: ${{ github.workflow }}-${{ github.ref }}
18+
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}
19+
20+
jobs:
21+
check_spirv:
22+
if: github.repository_owner == 'llvm'
23+
name: Test SPIR-V
24+
uses: ./.github/workflows/llvm-project-tests.yml
25+
with:
26+
build_target: check-llvm-codegen-spirv
27+
projects: clang
28+
experimental_targets: SPIRV

0 commit comments

Comments
 (0)