Add ccache
This commit is contained in:
parent
540a99670b
commit
f7f64ee1fd
1 changed files with 31 additions and 0 deletions
31
.github/workflows/build-and-test.yml
vendored
31
.github/workflows/build-and-test.yml
vendored
|
|
@ -1,4 +1,7 @@
|
|||
on: [ push, pull_request ]
|
||||
env:
|
||||
CCACHE_COMPRESS: exists means true
|
||||
CCACHE_SLOPPINESS: include_file_ctime,include_file_mtime,time_macros
|
||||
jobs:
|
||||
test-release:
|
||||
name: Build and run tests in Release mode
|
||||
|
|
@ -7,6 +10,7 @@ jobs:
|
|||
- name: Install dependencies
|
||||
run: |
|
||||
sudo apt-get install -y \
|
||||
ccache \
|
||||
parallel \
|
||||
libboost-thread-dev \
|
||||
libboost-iostreams-dev \
|
||||
|
|
@ -29,11 +33,24 @@ jobs:
|
|||
cmake -D CMAKE_BUILD_TYPE=Release \
|
||||
-D CMAKE_CXX_OUTPUT_EXTENSION_REPLACE=ON \
|
||||
-D CMAKE_C_COMPILER=gcc \
|
||||
-D CMAKE_C_COMPILER_LAUNCHER=ccache \
|
||||
-D CMAKE_CXX_COMPILER=g++ \
|
||||
-D CMAKE_CXX_COMPILER_LAUNCHER=ccache \
|
||||
..
|
||||
popd
|
||||
- name: Load Cache
|
||||
uses: actions/cache@v1
|
||||
with:
|
||||
path: ccache
|
||||
key: ccache-release-${{ github.ref }}-${{ github.sha }}
|
||||
restore-keys: |
|
||||
ccache-release-${{ github.ref }}-
|
||||
ccache-release-
|
||||
ccache-
|
||||
- name: Build
|
||||
run: |
|
||||
export CCACHE_DIR="$GITHUB_WORKSPACE/ccache"
|
||||
mkdir -p "$CCACHE_DIR"
|
||||
make -j 2 -C _build
|
||||
- name: Test
|
||||
run: |
|
||||
|
|
@ -51,6 +68,7 @@ jobs:
|
|||
- name: Install dependencies
|
||||
run: |
|
||||
sudo apt-get install -y \
|
||||
ccache \
|
||||
parallel \
|
||||
libboost-thread-dev \
|
||||
libboost-iostreams-dev \
|
||||
|
|
@ -73,11 +91,24 @@ jobs:
|
|||
cmake -D CMAKE_BUILD_TYPE=Debug \
|
||||
-D CMAKE_CXX_OUTPUT_EXTENSION_REPLACE=ON \
|
||||
-D CMAKE_C_COMPILER=gcc \
|
||||
-D CMAKE_C_COMPILER_LAUNCHER=ccache \
|
||||
-D CMAKE_CXX_COMPILER=g++ \
|
||||
-D CMAKE_CXX_COMPILER_LAUNCHER=ccache \
|
||||
..
|
||||
popd
|
||||
- name: Load Cache
|
||||
uses: actions/cache@v1
|
||||
with:
|
||||
path: ccache
|
||||
key: ccache-debug-${{ github.ref }}-${{ github.sha }}
|
||||
restore-keys: |
|
||||
ccache-debug-${{ github.ref }}-
|
||||
ccache-debug-
|
||||
ccache-
|
||||
- name: Build
|
||||
run: |
|
||||
export CCACHE_DIR="$GITHUB_WORKSPACE/ccache"
|
||||
mkdir -p "$CCACHE_DIR"
|
||||
make -j 2 -C _build
|
||||
- name: Test
|
||||
run: |
|
||||
|
|
|
|||
Loading…
Reference in a new issue