summaryrefslogtreecommitdiff
path: root/.github
diff options
context:
space:
mode:
authorDaniel Bertalan <dani@danielbertalan.dev>2023-05-27 17:54:17 +0200
committerAndrew Kaster <andrewdkaster@gmail.com>2023-05-28 05:05:09 -0600
commit58da4c93fbc2dcd9bde273d0e0bf3f4a07d3a5c8 (patch)
tree20f60fc1cb822ce68729083cf165bf565f7a8080 /.github
parent18ee6e457dda39901d230be7a42b1fee3e3a78d6 (diff)
downloadserenity-58da4c93fbc2dcd9bde273d0e0bf3f4a07d3a5c8.zip
Toolchain+CI: Remove cache handling logic from `BuildIt.sh`
Instead of manually compressing/decompressing a toolchain tarball if `TRY_USE_LOCAL_TOOLCHAIN` is set, let's use the cache action's automatic built-in compression (which is zstd, I believe).
Diffstat (limited to '.github')
-rw-r--r--.github/workflows/cmake.yml9
-rw-r--r--.github/workflows/pvs-studio-static-analysis.yml10
-rw-r--r--.github/workflows/sonar-cloud-static-analysis.yml8
3 files changed, 16 insertions, 11 deletions
diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml
index 51f2c1fc7f..efa7aed1d0 100644
--- a/.github/workflows/cmake.yml
+++ b/.github/workflows/cmake.yml
@@ -86,14 +86,15 @@ jobs:
uses: actions/cache/restore@v3
id: toolchain-cache
with:
- path: ${{ github.workspace }}/Toolchain/Cache/
+ path: ${{ github.workspace }}/Toolchain/Local/${{ matrix.arch }}
# This assumes that *ALL* LibC and LibPthread headers have an impact on the Toolchain.
# This is wrong, and causes more Toolchain rebuilds than necessary.
# However, we want to avoid false cache hits at all costs.
key: ${{ runner.os }}-toolchain-${{ matrix.arch }}-${{ steps.stamps.outputs.libc_headers }}
- - name: Restore or regenerate Toolchain
- run: TRY_USE_LOCAL_TOOLCHAIN=y ARCH="${{ matrix.arch }}" ${{ github.workspace }}/Toolchain/BuildIt.sh
+ - name: Build toolchain
+ if: ${{ !steps.toolchain-cache.outputs.cache-hit }}
+ run: ARCH="${{ matrix.arch }}" ${{ github.workspace }}/Toolchain/BuildIt.sh
- name: Update toolchain cache
uses: actions/cache/save@v3
@@ -101,7 +102,7 @@ jobs:
# as it would be discarded after being merged anyway.
if: ${{ github.event_name != 'pull_request' && !steps.toolchain-cache.outputs.cache-hit }}
with:
- path: ${{ github.workspace }}/Toolchain/Cache/
+ path: ${{ github.workspace }}/Toolchain/Local/${{ matrix.arch }}
key: ${{ steps.toolchain-cache.outputs.cache-primary-key }}
- name: ccache(1) cache
diff --git a/.github/workflows/pvs-studio-static-analysis.yml b/.github/workflows/pvs-studio-static-analysis.yml
index e03afbf0bb..148b68a747 100644
--- a/.github/workflows/pvs-studio-static-analysis.yml
+++ b/.github/workflows/pvs-studio-static-analysis.yml
@@ -48,15 +48,17 @@ jobs:
- name: Toolchain cache
# This job should always read the cache, never populate it.
uses: actions/cache/restore@v3
+ id: toolchain-cache
with:
- path: ${{ github.workspace }}/Toolchain/Cache/
+ path: ${{ github.workspace }}/Toolchain/Local/${{ env.PVS_STUDIO_ANALYSIS_ARCH }}
# This assumes that *ALL* LibC and LibPthread headers have an impact on the Toolchain.
# This is wrong, and causes more Toolchain rebuilds than necessary.
# However, we want to avoid false cache hits at all costs.
- key: ${{ runner.os }}-toolchain-${{ env.PVS_STUDIO_NALYSIS_ARCH }}-${{ steps.stamps.outputs.libc_headers }}
+ key: ${{ runner.os }}-toolchain-${{ env.PVS_STUDIO_ANALYSIS_ARCH }}-${{ steps.stamps.outputs.libc_headers }}
- - name: Restore or regenerate Toolchain
- run: TRY_USE_LOCAL_TOOLCHAIN=y ARCH="${{ env.PVS_STUDIO_ANALYSIS_ARCH }}" ${{ github.workspace }}/Toolchain/BuildIt.sh
+ - name: Build toolchain
+ if: ${{ !steps.toolchain-cache.outputs.cache-hit }}
+ run: ARCH="${{ env.PVS_STUDIO_ANALYSIS_ARCH }}" ${{ github.workspace }}/Toolchain/BuildIt.sh
- name: Create build directory
run: |
diff --git a/.github/workflows/sonar-cloud-static-analysis.yml b/.github/workflows/sonar-cloud-static-analysis.yml
index d94b3a45b9..a8e575a433 100644
--- a/.github/workflows/sonar-cloud-static-analysis.yml
+++ b/.github/workflows/sonar-cloud-static-analysis.yml
@@ -80,15 +80,17 @@ jobs:
- name: Toolchain cache
# This job should always read the cache, never populate it.
uses: actions/cache/restore@v3
+ id: toolchain-cache
with:
- path: ${{ github.workspace }}/Toolchain/Cache/
+ path: ${{ github.workspace }}/Toolchain/Local/${{ env.SONAR_ANALYSIS_ARCH }}
# This assumes that *ALL* LibC and LibPthread headers have an impact on the Toolchain.
# This is wrong, and causes more Toolchain rebuilds than necessary.
# However, we want to avoid false cache hits at all costs.
key: ${{ runner.os }}-toolchain-${{ env.SONAR_ANALYSIS_ARCH }}-${{ steps.stamps.outputs.libc_headers }}
- - name: Restore or regenerate Toolchain
- run: TRY_USE_LOCAL_TOOLCHAIN=y ARCH="${{ env.SONAR_ANALYSIS_ARCH }}" ${{ github.workspace }}/Toolchain/BuildIt.sh
+ - name: Build toolchain
+ if: ${{ !steps.toolchain-cache.outputs.cache-hit }}
+ run: ARCH="${{ env.SONAR_ANALYSIS_ARCH }}" ${{ github.workspace }}/Toolchain/BuildIt.sh
- name: Create build directory
run: |