File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ # Copyright 2026-present Alibaba Inc.
2+ #
3+ # Licensed under the Apache License, Version 2.0 (the "License");
4+ # you may not use this file except in compliance with the License.
5+ # You may obtain a copy of the License at
6+ #
7+ # http://www.apache.org/licenses/LICENSE-2.0
8+ #
9+ # Unless required by applicable law or agreed to in writing, software
10+ # distributed under the License is distributed on an "AS IS" BASIS,
11+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+ # See the License for the specific language governing permissions and
13+ # limitations under the License.
14+
15+ name : Setup ccache
16+ description : Install, configure and cache ccache for CI builds
17+
18+ inputs :
19+ cache-key-prefix :
20+ description : Prefix for the cache key (e.g., ccache-gcc-test)
21+ required : true
22+
23+ runs :
24+ using : composite
25+ steps :
26+ - name : Install ccache
27+ shell : bash
28+ run : sudo apt-get update && sudo apt-get install -y ccache
29+
30+ - name : Restore ccache
31+ uses : actions/cache@v4
32+ with :
33+ path : ~/.ccache
34+ key : ${{ inputs.cache-key-prefix }}-${{ runner.os }}-${{ github.ref_name }}-${{ hashFiles('**/CMakeLists.txt', '**/*.cmake') }}
35+ restore-keys : |
36+ ${{ inputs.cache-key-prefix }}-${{ runner.os }}-${{ github.ref_name }}-
37+ ${{ inputs.cache-key-prefix }}-${{ runner.os }}-
38+
39+ - name : Configure ccache
40+ shell : bash
41+ run : ${{ github.workspace }}/ci/scripts/setup_ccache.sh
Original file line number Diff line number Diff line change @@ -40,18 +40,10 @@ jobs:
4040 uses : actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
4141 with :
4242 lfs : true
43- - name : Install ccache
44- run : sudo apt-get update && sudo apt-get install -y ccache
4543 - name : Setup ccache
46- uses : actions/cache@v4
44+ uses : ./.github/ actions/setup-ccache
4745 with :
48- path : ~/.ccache
49- key : ccache-clang-release-${{ runner.os }}-${{ github.ref_name }}-${{ hashFiles('**/CMakeLists.txt', '**/*.cmake') }}
50- restore-keys : |
51- ccache-clang-release-${{ runner.os }}-${{ github.ref_name }}-
52- ccache-clang-release-${{ runner.os }}-
53- - name : Configure ccache
54- run : ci/scripts/setup_ccache.sh
46+ cache-key-prefix : ccache-clang-release
5547 - name : Build Paimon
5648 shell : bash
5749 env :
@@ -71,18 +63,10 @@ jobs:
7163 uses : actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
7264 with :
7365 lfs : true
74- - name : Install ccache
75- run : sudo apt-get update && sudo apt-get install -y ccache
7666 - name : Setup ccache
77- uses : actions/cache@v4
67+ uses : ./.github/ actions/setup-ccache
7868 with :
79- path : ~/.ccache
80- key : ccache-gcc-release-${{ runner.os }}-${{ github.ref_name }}-${{ hashFiles('**/CMakeLists.txt', '**/*.cmake') }}
81- restore-keys : |
82- ccache-gcc-release-${{ runner.os }}-${{ github.ref_name }}-
83- ccache-gcc-release-${{ runner.os }}-
84- - name : Configure ccache
85- run : ci/scripts/setup_ccache.sh
69+ cache-key-prefix : ccache-gcc-release
8670 - name : Build Paimon
8771 shell : bash
8872 env :
Original file line number Diff line number Diff line change @@ -41,18 +41,10 @@ jobs:
4141 with :
4242 lfs : true
4343 fetch-depth : 0 # fetch all history for git diff in clang-tidy
44- - name : Install ccache
45- run : sudo apt-get update && sudo apt-get install -y ccache
4644 - name : Setup ccache
47- uses : actions/cache@v4
45+ uses : ./.github/ actions/setup-ccache
4846 with :
49- path : ~/.ccache
50- key : ccache-clang-test-${{ runner.os }}-${{ github.ref_name }}-${{ hashFiles('**/CMakeLists.txt', '**/*.cmake') }}
51- restore-keys : |
52- ccache-clang-test-${{ runner.os }}-${{ github.ref_name }}-
53- ccache-clang-test-${{ runner.os }}-
54- - name : Configure ccache
55- run : ci/scripts/setup_ccache.sh
47+ cache-key-prefix : ccache-clang-test
5648 - name : Build Paimon
5749 shell : bash
5850 env :
Original file line number Diff line number Diff line change 4242 - name : Install dependencies
4343 run : |
4444 apt-get update
45- DEBIAN_FRONTEND=noninteractive apt-get install -y gcc-8 g++-8 ninja-build git git-lfs tar curl tzdata zip unzip pkg-config build-essential python3-dev gdb ccache
45+ DEBIAN_FRONTEND=noninteractive apt-get install -y gcc-8 g++-8 ninja-build git git-lfs tar curl tzdata zip unzip pkg-config build-essential python3-dev gdb
4646 curl -L -O https://github.com/Kitware/CMake/releases/download/v3.28.3/cmake-3.28.3-linux-x86_64.tar.gz
4747 tar -zxvf cmake-3.28.3-linux-x86_64.tar.gz -C /usr/local --strip-components=1
4848 rm cmake-3.28.3-linux-x86_64.tar.gz
6060 with :
6161 lfs : true
6262 - name : Setup ccache
63- uses : actions/cache@v4
63+ uses : ./.github/ actions/setup-ccache
6464 with :
65- path : ~/.ccache
66- key : ccache-gcc8-test-${{ runner.os }}-${{ github.ref_name }}-${{ hashFiles('**/CMakeLists.txt', '**/*.cmake') }}
67- restore-keys : |
68- ccache-gcc8-test-${{ runner.os }}-${{ github.ref_name }}-
69- ccache-gcc8-test-${{ runner.os }}-
70- - name : Configure ccache
71- run : ci/scripts/setup_ccache.sh
65+ cache-key-prefix : ccache-gcc8-test
7266 - name : Build Paimon
7367 shell : bash
7468 env :
Original file line number Diff line number Diff line change @@ -40,18 +40,10 @@ jobs:
4040 uses : actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
4141 with :
4242 lfs : true
43- - name : Install ccache
44- run : sudo apt-get update && sudo apt-get install -y ccache
4543 - name : Setup ccache
46- uses : actions/cache@v4
44+ uses : ./.github/ actions/setup-ccache
4745 with :
48- path : ~/.ccache
49- key : ccache-gcc-test-${{ runner.os }}-${{ github.ref_name }}-${{ hashFiles('**/CMakeLists.txt', '**/*.cmake') }}
50- restore-keys : |
51- ccache-gcc-test-${{ runner.os }}-${{ github.ref_name }}-
52- ccache-gcc-test-${{ runner.os }}-
53- - name : Configure ccache
54- run : ci/scripts/setup_ccache.sh
46+ cache-key-prefix : ccache-gcc-test
5547 - name : Build Paimon
5648 shell : bash
5749 env :
Original file line number Diff line number Diff line change @@ -40,18 +40,10 @@ jobs:
4040 uses : actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
4141 with :
4242 lfs : true
43- - name : Install ccache
44- run : sudo apt-get update && sudo apt-get install -y ccache
4543 - name : Setup ccache
46- uses : actions/cache@v4
44+ uses : ./.github/ actions/setup-ccache
4745 with :
48- path : ~/.ccache
49- key : ccache-sanitizer-${{ runner.os }}-${{ github.ref_name }}-${{ hashFiles('**/CMakeLists.txt', '**/*.cmake') }}
50- restore-keys : |
51- ccache-sanitizer-${{ runner.os }}-${{ github.ref_name }}-
52- ccache-sanitizer-${{ runner.os }}-
53- - name : Configure ccache
54- run : ci/scripts/setup_ccache.sh
46+ cache-key-prefix : ccache-sanitizer
5547 - name : Build Paimon
5648 shell : bash
5749 env :
You can’t perform that action at this time.
0 commit comments