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

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

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

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