@@ -57,17 +57,52 @@ jobs:
57
57
fi
58
58
bash .github/workflows/set-release-binary-outputs.sh "${{ github.actor }}" "$tag" "$upload"
59
59
60
+ # Try to get around the 6 hour timeout by first running a job to fill
61
+ # the build cache.
62
+ fill-cache :
63
+ name : " Fill Cache ${{ matrix.os }}"
64
+ needs : prepare
65
+ runs-on : ${{ matrix.os }}
66
+ strategy :
67
+ matrix :
68
+ os :
69
+ - ubuntu-22.04
70
+ steps :
71
+ - name : Checkout LLVM
72
+ uses : actions/checkout@v4
73
+ with :
74
+ ref : ${{ inputs.tag || github.ref_name }}
75
+
76
+ - name : Install Ninja
77
+ uses : llvm/actions/install-ninja@main
78
+
79
+ - name : Setup sccache
80
+ uses : hendrikmuhs/ccache-action@v1
81
+ with :
82
+ max-size : 250M
83
+ key : sccache-${{ matrix.os }}-release
84
+ variant : sccache
85
+
86
+ - name : Build Clang
87
+ run : |
88
+ cmake -G Ninja -DCMAKE_C_COMPILER_LAUNCHER=sccache -DCMAKE_CXX_COMPILER_LAUNCHER=sccache -DCMAKE_BUILD_TYPE=Release -DCMAKE_ENABLE_ASSERTIONS=OFF -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DLLVM_ENABLE_PROJECTS=clang -S llvm -B build
89
+ ninja -v -C build
90
+
91
+
60
92
build-binaries :
61
93
name : ${{ matrix.target.triple }}
62
94
permissions :
63
95
contents : write # To upload assets to release.
64
- needs : prepare
96
+ needs :
97
+ - prepare
98
+ - fill-cache
65
99
runs-on : ${{ matrix.target.runs-on }}
66
100
strategy :
67
101
fail-fast : false
68
102
matrix :
69
103
target :
70
104
- triple : x86_64-linux-gnu-ubuntu-22.04
105
+ os : ubuntu-22.04
71
106
runs-on : ubuntu-22.04-16x64
72
107
debian-build-deps : >
73
108
chrpath
@@ -81,6 +116,14 @@ jobs:
81
116
ref : ${{ needs.prepare.outputs.ref }}
82
117
path : ${{ needs.prepare.outputs.build-dir }}/llvm-project
83
118
119
+ - name : Setup sccache
120
+ uses : hendrikmuhs/ccache-action@v1
121
+ with :
122
+ max-size : 250M
123
+ key : sccache-${{ matrix.target.os }}-release
124
+ save : false
125
+ variant : sccache
126
+
84
127
- name : Install Brew build dependencies
85
128
if : matrix.target.brew-build-deps != ''
86
129
run : brew install ${{ matrix.target.brew-build-deps }}
@@ -102,7 +145,8 @@ jobs:
102
145
-triple ${{ matrix.target.triple }} \
103
146
-use-ninja \
104
147
-no-checkout \
105
- -no-test-suite
148
+ -no-test-suite \
149
+ -configure-flags "-DCMAKE_C_COMPILER_LAUNCHER=sccache -DCMAKE_CXX_COMPILER_LAUNCHER=sccache"
106
150
107
151
- name : Upload binaries
108
152
if : ${{ always() && needs.prepare.outputs.upload == 'true' }}
0 commit comments