Skip to content
This repository was archived by the owner on Oct 8, 2025. It is now read-only.

Commit c918166

Browse files
committed
ci: Add a clang-ast workflow
This does compile-time type and argument checking using a clang-plugin. It was run as part of buildbot. This covers unitd, src/test and the php, perl, python, ruby, wasm, java and nodejs language modules/support. It doesn't cover Go as that doesn't build anything with clang (uses cgo) or wasm-wasi-component as that uses rustc. Link: <https://github.com/nginx/clang-ast/tree/unit> Signed-off-by: Andrew Clayton <a.clayton@nginx.com>
1 parent ebd02c6 commit c918166

File tree

1 file changed

+76
-0
lines changed

1 file changed

+76
-0
lines changed

.github/workflows/clang-ast.yaml

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
name: "Clang AST"
2+
3+
on:
4+
push:
5+
branches: master
6+
paths:
7+
- configure
8+
- 'auto/**'
9+
- 'src/**'
10+
- 'test/**'
11+
- '.github/workflows/clang-ast.yaml'
12+
pull_request:
13+
branches: master
14+
paths:
15+
- configure
16+
- 'auto/**'
17+
- 'src/**'
18+
- 'test/**'
19+
- '.github/workflows/clang-ast.yaml'
20+
21+
jobs:
22+
clang-ast:
23+
runs-on: ubuntu-latest
24+
25+
container:
26+
image: debian:testing
27+
28+
steps:
29+
- name: Install tools/deps
30+
run: |
31+
apt-get -y update
32+
apt-get -y install git wget curl llvm-dev libclang-dev clang make \
33+
libssl-dev libpcre2-dev libperl-dev \
34+
libphp-embed php-dev python3-dev libpython3-dev \
35+
ruby-dev openjdk-17-jdk npm
36+
npm install -g node-gyp
37+
38+
- uses: actions/checkout@v4
39+
40+
- name: Checkout and build clang-ast
41+
run: |
42+
git clone https://github.com/nginx/clang-ast.git -b unit
43+
cd clang-ast
44+
make
45+
46+
- name: Configure Unit
47+
run: ./configure --cc=clang --cc-opt="-Xclang -load -Xclang clang-ast/ngx-ast.so -Xclang -add-plugin -Xclang ngx-ast" --openssl --debug --tests
48+
49+
- name: Build Unit
50+
run: make -j4 unitd
51+
52+
- name: Build C tests
53+
run: make -j4 tests
54+
55+
- name: Build Perl language module
56+
run: ./configure perl && make -j4 perl
57+
58+
- name: Build PHP language module
59+
run: ./configure php && make -j4 php
60+
61+
- name: Build Python language module
62+
run: ./configure python --config=python3-config && make -j4 python3
63+
64+
- name: Build Ruby language module
65+
run: ./configure ruby && make -j4 ruby
66+
67+
- name: Build Java support
68+
run: ./configure java && make -j4 java
69+
70+
- name: Build Nodejs support
71+
run: ./configure nodejs && make node-local-install DESTDIR=node
72+
73+
- name: Build wasm language module
74+
run: |
75+
wget -q -O- https://github.com/bytecodealliance/wasmtime/releases/download/v26.0.0/wasmtime-v26.0.0-x86_64-linux-c-api.tar.xz | tar -xJf -
76+
./configure wasm --include-path=wasmtime-v26.0.0-x86_64-linux-c-api/include --lib-path=wasmtime-v26.0.0-x86_64-linux-c-api/lib --rpath && make wasm

0 commit comments

Comments
 (0)