]> git.proxmox.com Git - ceph.git/blob - ceph/src/jaegertracing/opentelemetry-cpp/third_party/prometheus-cpp/.github/workflows/linting.yml
update ceph source to reef 18.1.2
[ceph.git] / ceph / src / jaegertracing / opentelemetry-cpp / third_party / prometheus-cpp / .github / workflows / linting.yml
1 name: Linting
2 on: [push, pull_request]
3
4 jobs:
5 iwyu:
6 name: Include What You Use
7 runs-on: ubuntu-latest
8 container:
9 image: debian:sid-slim
10 steps:
11 - name: Install dependencies
12 run: |
13 apt-get update
14 apt-get install -y --no-install-recommends ca-certificates clang-12 cmake git iwyu libbenchmark-dev libcurl4-openssl-dev ninja-build zlib1g-dev
15
16 - name: Checkout source
17 uses: actions/checkout@v2
18
19 - name: Checkout submodules
20 shell: bash
21 run: |
22 auth_header="$(git config --local --get http.https://github.com/.extraheader)"
23 git submodule sync --recursive
24 git -c "http.extraheader=$auth_header" -c protocol.version=2 submodule update --init --force --recursive --depth=1
25
26 - name: "CMake Configure"
27 run: cmake -GNinja -DRUN_IWYU=ON -DCMAKE_C_COMPILER=clang-12 -DCMAKE_CXX_COMPILER=clang++-12 -S ${GITHUB_WORKSPACE} -B ${GITHUB_WORKSPACE}/_build
28
29 - name: Build
30 run: cmake --build ${GITHUB_WORKSPACE}/_build 2>&1 | tee ${GITHUB_WORKSPACE}/output.txt
31
32 - name: Check build output
33 run: if egrep -q 'should (add|remove) these lines' ${GITHUB_WORKSPACE}/output.txt; then exit 1; fi
34
35 #- name: "CMake Configure"
36 # run: cmake -GNinja -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -S ${GITHUB_WORKSPACE} -B ${GITHUB_WORKSPACE}/_build
37
38 #- name: "Run IWYU"
39 # run: iwyu_tool -p ${GITHUB_WORKSPACE}/_build core push pull -- -Xiwyu --mapping_file=${GITHUB_WORKSPACE}/cmake/googletest.imp -Xiwyu --no_fwd_decls 2>&1 | tee ${{ github.workspace }}/output.txt
40
41 format:
42 name: Clang Format
43 runs-on: ubuntu-20.04
44 steps:
45 - name: Checkout source
46 uses: actions/checkout@v2
47
48 - name: Install dependencies
49 run: |
50 sudo apt-get remove -y --purge man-db # avoid time-consuming trigger
51 sudo apt-get update
52 sudo apt-get install -y clang-format-11
53
54 - name: Run clang-format
55 run: find . -type f \( -name '*.c' -o -name '*.cc' -o -name '*.cpp' -o -name '*.cxx' -o -name '*.o' -o -name '*.h' -o -name '*.hpp' -o -name '*.hxx' \) -exec clang-format-11 -style=file -i {} \;
56
57 - name: Check for changes
58 run: git diff --exit-code