Skip to content

Commit

Permalink
CI: Decrease compilation times with Ccache
Browse files Browse the repository at this point in the history
I've excluded the docker build since it would probably require a modified Dockerfile.
  • Loading branch information
HybridDog committed Mar 23, 2024
1 parent 5727d74 commit 0c1445a
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 0 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ jobs:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- name: ccache
uses: hendrikmuhs/[email protected]
with:
key: ${{ github.job }}
- name: Install deps
run: |
source ./util/ci/common.sh
Expand All @@ -59,6 +63,10 @@ jobs:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: ccache
uses: hendrikmuhs/[email protected]
with:
key: ${{ github.job }}
- name: Install deps
run: |
source ./util/ci/common.sh
Expand All @@ -83,6 +91,10 @@ jobs:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- name: ccache
uses: hendrikmuhs/[email protected]
with:
key: ${{ github.job }}
- name: Install deps
run: |
source ./util/ci/common.sh
Expand All @@ -105,6 +117,10 @@ jobs:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: ccache
uses: hendrikmuhs/[email protected]
with:
key: ${{ github.job }}
- name: Install deps
run: |
source ./util/ci/common.sh
Expand All @@ -131,6 +147,10 @@ jobs:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- name: ccache
uses: hendrikmuhs/[email protected]
with:
key: ${{ github.job }}
- name: Install deps
run: |
source ./util/ci/common.sh
Expand Down
10 changes: 10 additions & 0 deletions .github/workflows/lua.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ jobs:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- name: ccache
uses: hendrikmuhs/[email protected]
with:
key: ${{ github.job }}

- name: Install deps
run: |
source ./util/ci/common.sh
Expand All @@ -44,13 +49,18 @@ jobs:
steps:

- uses: actions/checkout@v4
- name: ccache
uses: hendrikmuhs/[email protected]
with:
key: ${{ github.job }}
- uses: leafo/gh-actions-lua@v10
with:
luaVersion: "5.1.5"
- uses: leafo/[email protected]

- name: Install LuaJIT
run: |
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
cd $HOME
git clone https://github.com/LuaJIT/LuaJIT/
cd LuaJIT
Expand Down
2 changes: 2 additions & 0 deletions util/buildbot/buildwin32.sh
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ cmake_args=(
-DENABLE_GETTEXT=1
-DENABLE_LEVELDB=1
)
# Use ccache if it is available
command -v ccache >/dev/null && cmake_args+=(-DCMAKE_{C,CXX}_COMPILER_LAUNCHER=ccache)
add_cmake_libs
cmake -S $sourcedir -B build "${cmake_args[@]}"

Expand Down
2 changes: 2 additions & 0 deletions util/buildbot/buildwin64.sh
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ cmake_args=(
-DENABLE_GETTEXT=1
-DENABLE_LEVELDB=1
)
# Use ccache if it is available
command -v ccache >/dev/null && cmake_args+=(-DCMAKE_{C,CXX}_COMPILER_LAUNCHER=ccache)
add_cmake_libs
cmake -S $sourcedir -B build "${cmake_args[@]}"

Expand Down
5 changes: 5 additions & 0 deletions util/ci/build.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
#!/bin/bash -e

# Use ccache if it is available
extra_args=()
command -v ccache >/dev/null && extra_args+=(-DCMAKE_{C,CXX}_COMPILER_LAUNCHER=ccache)

cmake -B build \
"${extra_args[@]}" \
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE:-Debug} \
-DENABLE_LTO=FALSE \
-DRUN_IN_PLACE=TRUE \
Expand Down
5 changes: 5 additions & 0 deletions util/ci/build_prometheus_cpp.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
#! /bin/bash -eu

# Use ccache if it is available
extra_args=()
command -v ccache >/dev/null && extra_args+=(-DCMAKE_{C,CXX}_COMPILER_LAUNCHER=ccache)

cd /tmp
git clone --recursive https://github.com/jupp0r/prometheus-cpp
mkdir prometheus-cpp/build
cd prometheus-cpp/build
cmake .. \
"${extra_args[@]}" \
-DCMAKE_INSTALL_PREFIX=/usr/local \
-DCMAKE_BUILD_TYPE=Release \
-DENABLE_TESTING=0
Expand Down

0 comments on commit 0c1445a

Please sign in to comment.