github actions get ccache working

This commit is contained in:
Daniel Agar
2020-06-20 13:18:06 -04:00
committed by GitHub
parent a641982ce7
commit 32828c99fd
5 changed files with 117 additions and 38 deletions
+21 -7
View File
@@ -24,16 +24,30 @@ jobs:
- uses: actions/checkout@v1
with:
token: ${{secrets.ACCESS_TOKEN}}
- uses: actions/cache@v1.1.0
id: ccache-persistence
- name: Prepare ccache timestamp
id: ccache_cache_timestamp
shell: cmake -P {0}
run: |
string(TIMESTAMP current_date "%Y-%m-%d-%H;%M;%S" UTC)
message("::set-output name=timestamp::${current_date}")
- name: ccache cache files
uses: actions/cache@v1.1.0
with:
path: ~/.ccache
key: ccache-linux-${{matrix.config}}
restore-keys: |
ccache-linux-${{matrix.config}}
key: ${{matrix.config}}-ccache-${{steps.ccache_cache_timestamp.outputs.timestamp}}
restore-keys: ${{matrix.config}}-ccache-
- name: setup ccache
run: mkdir -p ~/.ccache && echo "max_size = 300M" > ~/.ccache/ccache.conf && ccache -z && ccache -s
run: |
mkdir -p ~/.ccache
echo "base_dir = ${GITHUB_WORKSPACE}" > ~/.ccache/ccache.conf
echo "compression = true" >> ~/.ccache/ccache.conf
echo "compression_level = 6" >> ~/.ccache/ccache.conf
echo "max_size = 400M" >> ~/.ccache/ccache.conf
ccache -s
ccache -z
- name: make ${{matrix.config}}
run: make ${{matrix.config}}
- name: ccache post-run
run: ccache -s && ccache -z
run: ccache -s