11
11
- ' llvm/**'
12
12
- ' .github/workflows/ci-post-commit-analyzer.yml'
13
13
pull_request :
14
+ types :
15
+ - opened
16
+ - synchronize
17
+ - reopened
18
+ - closed
14
19
paths :
15
20
- ' .github/workflows/ci-post-commit-analyzer.yml'
16
21
schedule :
@@ -28,41 +33,75 @@ jobs:
28
33
github.repository_owner == 'llvm' &&
29
34
github.event.action != 'closed'
30
35
runs-on : ubuntu-22.04
36
+ container :
37
+ image : ' ghcr.io/llvm/ci-ubuntu-22.04:latest'
31
38
env :
32
39
LLVM_VERSION : 18
33
40
steps :
34
41
- name : Checkout Source
35
42
uses : actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
36
43
37
44
- name : Install Dependencies
45
+ env :
46
+ DEBIAN_FRONTEND : noninteractive
38
47
run : |
39
- sudo echo "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-18 main" | sudo tee -a /etc/apt/sources.list.d/llvm.list
40
- wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
41
- sudo apt-get update
42
- sudo apt-get install \
48
+ apt-get update
49
+ apt-get -y install \
50
+ wget \
51
+ gnupg
52
+ echo "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-18 main" | tee -a /etc/apt/sources.list.d/llvm.list
53
+ wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add -
54
+ apt-get update
55
+ apt-get -y install \
43
56
cmake \
44
57
ninja-build \
45
58
perl \
46
59
clang-tools-$LLVM_VERSION \
47
60
clang-$LLVM_VERSION
48
61
62
+ - name : Setup ccache
63
+ uses : hendrikmuhs/ccache-action@v1
64
+ with :
65
+ # A full build of llvm, clang, lld, and lldb takes about 250MB
66
+ # of ccache space. There's not much reason to have more than this,
67
+ # because we usually won't need to save cache entries from older
68
+ # builds. Also, there is an overall 10GB cache limit, and each
69
+ # run creates a new cache entry so we want to ensure that we have
70
+ # enough cache space for all the tests to run at once and still
71
+ # fit under the 10 GB limit.
72
+ # Default to 2G to workaround: https://github.com/hendrikmuhs/ccache-action/issues/174
73
+ max-size : 2G
74
+ key : post-commit-analyzer
75
+ variant : ccache
76
+
49
77
- name : Configure
50
78
run : |
51
79
scan-build-$LLVM_VERSION \
52
- --use-c++=clang++ \
53
- --use-cc=clang \
80
+ --use-c++='clang++' \
81
+ --use-cc='clang' \
82
+ -analyzer-config max-nodes=75000 \
54
83
cmake -B build -S llvm -G Ninja \
55
84
-DLLVM_ENABLE_ASSERTIONS=ON \
85
+ -DLLVM_ENABLE_PROJECTS=clang \
56
86
-DLLVM_BUILD_LLVM_DYLIB=ON \
57
87
-DLLVM_LINK_LLVM_DYLIB=ON \
58
88
-DCMAKE_BUILD_TYPE=Release
59
89
60
90
- name : Build
61
91
run : |
62
- scan-build-$LLVM_VERSION -o analyzer-results --use-c++=clang++ --use-cc=clang ninja -v -C build
92
+ # Create symlinks for use with ccache.
93
+ ln -s /usr/bin/ccache /usr/local/bin/clang++
94
+ ln -s /usr/bin/ccache /usr/local/bin/clang
95
+ scan-build-$LLVM_VERSION \
96
+ -o analyzer-results \
97
+ --use-c++=/usr/local/bin/clang++ \
98
+ --use-cc=/usr/local/bin/clang \
99
+ -analyzer-config max-nodes=75000 \
100
+ ninja -v -C build
63
101
64
102
- name : Upload Results
65
103
uses : actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 # v4.3.0
104
+ if : always()
66
105
with :
67
106
name : analyzer-results
68
107
path : ' analyzer-results/**/*'
0 commit comments