more cache tuning

develop
Myk Taylor 2023-07-31 02:50:32 -07:00
parent 5c664fca1c
commit 737ff8b3ab
No known key found for this signature in database
4 changed files with 27 additions and 7 deletions

@ -14,6 +14,9 @@ on:
cache-id:
type: string
default: ''
cache-readonly:
type: boolean
default: false
platform-files:
type: boolean
default: true
@ -64,7 +67,7 @@ jobs:
fetch-depth: ${{ !inputs.platform-files && 1 || 0 }}
- name: Fetch ccache
if: inputs.platform-files
uses: actions/cache@v3
uses: actions/cache/restore@v3
with:
path: ~/.cache/ccache
key: linux-gcc-${{ inputs.gcc-ver }}-${{ inputs.cache-id }}-${{ github.sha }}
@ -101,9 +104,15 @@ jobs:
- name: Trim cache
if: inputs.platform-files
run: |
ccache --max-size 50M
ccache --max-size 40M
ccache --cleanup
ccache --show-stats --verbose
- name: Save ccache
if: inputs.platform-files && !inputs.cache-readonly
uses: actions/cache/save@v3
with:
path: ~/.cache/ccache
key: linux-gcc-${{ inputs.gcc-ver }}-${{ inputs.cache-id }}-${{ github.sha }}
- name: Format artifact name
if: inputs.append-date-and-hash
id: artifactname

@ -14,6 +14,9 @@ on:
cache-id:
type: string
default: ''
cache-readonly:
type: boolean
default: false
common-files:
type: boolean
default: true
@ -45,7 +48,7 @@ jobs:
ssh-key: ${{ secrets.DFHACK_3RDPARTY_TOKEN }}
path: depends/steam
- name: Fetch ccache
uses: actions/cache@v3
uses: actions/cache/restore@v3
with:
path: build/win64-cross/ccache
key: win-msvc-${{ inputs.cache-id }}-${{ github.sha }}
@ -60,9 +63,15 @@ jobs:
bash -x build-win64-from-linux.sh
- name: Trim cache
run: |
ccache -d win64-cross/ccache --max-size 50M
cd build
ccache -d win64-cross/ccache --max-size 200M
ccache -d win64-cross/ccache --cleanup
ccache -d win64-cross/ccache --show-stats --verbose
- name: Save ccache
uses: actions/cache/save@v3
with:
path: build/win64-cross/ccache
key: win-msvc-${{ inputs.cache-id }}-${{ github.sha }}
- name: Format artifact name
if: inputs.append-date-and-hash
id: artifactname

@ -89,7 +89,7 @@ jobs:
with:
artifact-name: dfhack-win64-build
append-date-and-hash: true
cache-id: msvc
cache-id: release
secrets: inherit
docs:

@ -36,7 +36,8 @@ jobs:
with:
artifact-name: linux64-depot
ref: ${{ github.event.inputs.ref }}
cache-id: depot
cache-id: release
cache-readonly: true
common-files: false
stonesense: true
gcc-ver: "10"
@ -48,7 +49,8 @@ jobs:
with:
artifact-name: win64-depot
ref: ${{ github.event.inputs.ref }}
cache-id: msvc
cache-id: release
cache-readonly: true
common-files: false
launchdf: true
secrets: inherit