Skip to content

Commit 376baeb

Browse files
[GitHub] Add basic CI for libclang Python binding unit tests (llvm#76784)
This is important to aid development of Python type annotations in the libclang binding. See llvm#76664 for more details. * Run on all pull requests and direct pushes. * This makes use of the existing llvm-project-tests.yml recipe, which will preload ccache from previous runs. * Building libclang currently takes about 9mins when ccache is warm and about an 1hr 20mins if it is cold using the standard GitHub ubuntu runner. * In the future, this could be broken into the following discrete steps for clarity: 1. Build libclang dependency. ninja -C build libclang 2. Run Python unit tests. ninja -C build check-clang-python * Followup changes will bring testing on older python versions and static type checking. Issue llvm#76601.
1 parent cf02e6e commit 376baeb

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Libclang Python Binding Tests
2+
3+
permissions:
4+
contents: read
5+
6+
on:
7+
workflow_dispatch:
8+
push:
9+
paths:
10+
- 'clang/bindings/python/**'
11+
- 'clang/tools/libclang/**'
12+
- 'clang/CMakeList.txt'
13+
- '.github/workflows/libclang-python-tests.yml'
14+
- '.github/workflows/llvm-project-tests.yml'
15+
pull_request:
16+
paths:
17+
- 'clang/bindings/python/**'
18+
- 'clang/tools/libclang/**'
19+
- 'clang/CMakeList.txt'
20+
- '.github/workflows/libclang-python-tests.yml'
21+
- '.github/workflows/llvm-project-tests.yml'
22+
23+
concurrency:
24+
# Skip intermediate builds: always.
25+
# Cancel intermediate builds: only if it is a pull request build.
26+
group: ${{ github.workflow }}-${{ github.ref }}
27+
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}
28+
29+
jobs:
30+
check-clang-python:
31+
# Build libclang and then run the libclang Python binding's unit tests.
32+
name: Build and run Python unit tests
33+
uses: ./.github/workflows/llvm-project-tests.yml
34+
with:
35+
build_target: check-clang-python
36+
projects: clang
37+
# There is an issue running on "windows-2019".
38+
# See https://github.com/llvm/llvm-project/issues/76601#issuecomment-1873049082.
39+
os_list: '["ubuntu-latest"]'

0 commit comments

Comments
 (0)