From 0893f6bcd1cbce7947962db579012a1de1b8a4d7 Mon Sep 17 00:00:00 2001 From: Andrew Clayton Date: Fri, 25 Oct 2024 17:48:44 +0100 Subject: [PATCH] ci: Add a clang-ast workflow This does compile time type-checking using a clang-plugin. It was run as part of buildbot. Link: Signed-off-by: Andrew Clayton --- .github/workflows/clang-ast.yaml | 55 ++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 .github/workflows/clang-ast.yaml diff --git a/.github/workflows/clang-ast.yaml b/.github/workflows/clang-ast.yaml new file mode 100644 index 000000000..e3ad528ab --- /dev/null +++ b/.github/workflows/clang-ast.yaml @@ -0,0 +1,55 @@ +name: "Clang AST" + +on: + push: + branches: master + paths: + - configure + - 'auto/**' + - 'src/**' + - 'test/**' + - '.github/workflows/clang-ast.yaml' + pull_request: + branches: master + paths: + - configure + - 'auto/**' + - 'src/**' + - 'test/**' + - '.github/workflows/clang-ast.yaml' + +jobs: + clang-ast: + runs-on: ubuntu-latest + + container: + image: debian:testing + + steps: + - name: Install tools/deps + run: | + apt-get -y update + apt-get -y install git llvm-dev libclang-dev clang make \ + libssl-dev libpcre2-dev + + - uses: actions/checkout@v4 + + - name: Checkout and build clang-ast + run: | + git clone https://github.com/nginx/clang-ast.git -b unit + cd clang-ast + make + + - name: Configure Unit + run: ./configure --cc=clang --openssl --debug --tests + + - name: Build Unit + run: | + make -j4 \ + EXTRA_CFLAGS="-Xclang -load -Xclang clang-ast/ngx-ast.so -Xclang -add-plugin -Xclang ngx-ast" \ + NXT_SHARED_LOCAL_LINK=: build/lib/libnxt.so + + - name: Build C tests + run: | + EXTRA_CFLAGS="-Xclang -load -Xclang clang-ast/ngx-ast.so -Xclang -add-plugin -Xclang ngx-ast" \ + tests