forked from organicmaps/organicmaps
[ci] Use ccache to decrease build time
Signed-off-by: Andrew Shkrob <andrew.shkrob.social@yandex.by>
This commit is contained in:
parent
4308a84d1a
commit
c16e56fdfe
2 changed files with 29 additions and 6 deletions
26
.github/workflows/linux-check.yaml
vendored
26
.github/workflows/linux-check.yaml
vendored
|
@ -26,11 +26,9 @@ jobs:
|
|||
linux-no-unity:
|
||||
name: Linux no unity build
|
||||
runs-on: ubuntu-22.04
|
||||
strategy:
|
||||
fail-fast: false
|
||||
# Cancels previous jobs if the same branch or PR was updated again.
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ matrix.compiler.CC }}-${{ matrix.CMAKE_BUILD_TYPE }}-${{ github.event.pull_request.number || github.ref }}
|
||||
group: ${{ github.workflow }}-no-unity-${{ github.event.pull_request.number || github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
steps:
|
||||
|
@ -63,6 +61,11 @@ jobs:
|
|||
shell: bash
|
||||
run: ./configure.sh
|
||||
|
||||
- name: Configure ccache
|
||||
uses: hendrikmuhs/ccache-action@v1.2
|
||||
with:
|
||||
key: ${{ github.workflow }}-no-unity
|
||||
|
||||
- name: CMake
|
||||
shell: bash
|
||||
env:
|
||||
|
@ -70,7 +73,9 @@ jobs:
|
|||
CXX: clang++-14
|
||||
# -g1 should slightly reduce build time.
|
||||
run: |
|
||||
cmake . -B build -G Ninja -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS=-g1 -DUNITY_DISABLE=ON
|
||||
cmake . -B build -G Ninja -DCMAKE_BUILD_TYPE=Debug \
|
||||
-DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
|
||||
-DCMAKE_CXX_FLAGS=-g1 -DUNITY_DISABLE=ON
|
||||
|
||||
- name: Compile
|
||||
shell: bash
|
||||
|
@ -85,6 +90,10 @@ jobs:
|
|||
matrix:
|
||||
compiler: [{ CXX: g++-12, CC: gcc-12 }, { CXX: clang++-14, CC: clang-14 }]
|
||||
CMAKE_BUILD_TYPE: [Debug, RelWithDebInfo]
|
||||
# Cancels previous jobs if the same branch or PR was updated again.
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-unity-${{ matrix.compiler.CC }}-${{ matrix.CMAKE_BUILD_TYPE }}-${{ github.event.pull_request.number || github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
steps:
|
||||
- name: Free disk space by removing .NET, Android and Haskell
|
||||
|
@ -116,6 +125,11 @@ jobs:
|
|||
shell: bash
|
||||
run: ./configure.sh
|
||||
|
||||
- name: Configure ccache
|
||||
uses: hendrikmuhs/ccache-action@v1.2
|
||||
with:
|
||||
key: ${{ github.workflow }}-unity-${{ matrix.compiler.CC }}-${{ matrix.CMAKE_BUILD_TYPE }}
|
||||
|
||||
- name: CMake
|
||||
shell: bash
|
||||
env:
|
||||
|
@ -124,7 +138,9 @@ jobs:
|
|||
# -g1 should slightly reduce build time.
|
||||
run: |
|
||||
echo "Building ${{ matrix.CMAKE_BUILD_TYPE }}"
|
||||
cmake . -B build -G Ninja -DCMAKE_BUILD_TYPE=${{ matrix.CMAKE_BUILD_TYPE }} -DCMAKE_C_FLAGS=-g1 -DCMAKE_CXX_FLAGS=-g1
|
||||
cmake . -B build -G Ninja -DCMAKE_BUILD_TYPE=${{ matrix.CMAKE_BUILD_TYPE }} \
|
||||
-DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
|
||||
-DCMAKE_C_FLAGS=-g1 -DCMAKE_CXX_FLAGS=-g1
|
||||
|
||||
- name: Compile
|
||||
shell: bash
|
||||
|
|
9
.github/workflows/macos-check.yaml
vendored
9
.github/workflows/macos-check.yaml
vendored
|
@ -55,11 +55,18 @@ jobs:
|
|||
shell: bash
|
||||
run: ./configure.sh
|
||||
|
||||
- name: Configure ccache
|
||||
uses: hendrikmuhs/ccache-action@v1.2
|
||||
with:
|
||||
key: ${{ github.workflow }}-${{ matrix.CMAKE_BUILD_TYPE }}
|
||||
|
||||
- name: CMake
|
||||
shell: bash
|
||||
run: |
|
||||
echo "Building ${{ matrix.CMAKE_BUILD_TYPE }}"
|
||||
cmake . -B build -G Ninja -DCMAKE_BUILD_TYPE=${{ matrix.CMAKE_BUILD_TYPE }} -DCMAKE_C_FLAGS=-g1 -DCMAKE_CXX_FLAGS=-g1
|
||||
cmake . -B build -G Ninja -DCMAKE_BUILD_TYPE=${{ matrix.CMAKE_BUILD_TYPE }} \
|
||||
-DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
|
||||
-DCMAKE_C_FLAGS=-g1 -DCMAKE_CXX_FLAGS=-g1
|
||||
|
||||
- name: Compile
|
||||
shell: bash
|
||||
|
|
Loading…
Add table
Reference in a new issue