From 737ff8b3abf0f04c50f693e1142c713e0ae35ac7 Mon Sep 17 00:00:00 2001 From: Myk Taylor Date: Mon, 31 Jul 2023 02:50:32 -0700 Subject: [PATCH] more cache tuning --- .github/workflows/build-linux.yml | 13 +++++++++++-- .github/workflows/build-windows.yml | 13 +++++++++++-- .github/workflows/build.yml | 2 +- .github/workflows/steam.yml | 6 ++++-- 4 files changed, 27 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build-linux.yml b/.github/workflows/build-linux.yml index 77906bbd4..b504403ee 100644 --- a/.github/workflows/build-linux.yml +++ b/.github/workflows/build-linux.yml @@ -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 diff --git a/.github/workflows/build-windows.yml b/.github/workflows/build-windows.yml index b5a96b12d..8fe4502e4 100644 --- a/.github/workflows/build-windows.yml +++ b/.github/workflows/build-windows.yml @@ -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 diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 648fd3838..f6116b3c9 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -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: diff --git a/.github/workflows/steam.yml b/.github/workflows/steam.yml index 6d4533ee9..1801ad33f 100644 --- a/.github/workflows/steam.yml +++ b/.github/workflows/steam.yml @@ -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