@@ -57,17 +57,52 @@ jobs:
5757 fi
5858 bash .github/workflows/set-release-binary-outputs.sh "${{ github.actor }}" "$tag" "$upload"
5959
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+
6092 build-binaries :
6193 name : ${{ matrix.target.triple }}
6294 permissions :
6395 contents : write # To upload assets to release.
64- needs : prepare
96+ needs :
97+ - prepare
98+ - fill-cache
6599 runs-on : ${{ matrix.target.runs-on }}
66100 strategy :
67101 fail-fast : false
68102 matrix :
69103 target :
70104 - triple : x86_64-linux-gnu-ubuntu-22.04
105+ os : ubuntu-22.04
71106 runs-on : ubuntu-22.04-16x64
72107 debian-build-deps : >
73108 chrpath
@@ -81,6 +116,14 @@ jobs:
81116 ref : ${{ needs.prepare.outputs.ref }}
82117 path : ${{ needs.prepare.outputs.build-dir }}/llvm-project
83118
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+
84127 - name : Install Brew build dependencies
85128 if : matrix.target.brew-build-deps != ''
86129 run : brew install ${{ matrix.target.brew-build-deps }}
@@ -102,7 +145,8 @@ jobs:
102145 -triple ${{ matrix.target.triple }} \
103146 -use-ninja \
104147 -no-checkout \
105- -no-test-suite
148+ -no-test-suite \
149+ -configure-flags "-DCMAKE_C_COMPILER_LAUNCHER=sccache -DCMAKE_CXX_COMPILER_LAUNCHER=sccache"
106150
107151 - name : Upload binaries
108152 if : ${{ always() && needs.prepare.outputs.upload == 'true' }}
0 commit comments