From 590c636949b9edf36f54e708620deed7b1bac704 Mon Sep 17 00:00:00 2001 From: Michael Kazakov Date: Mon, 22 Jan 2024 21:38:17 +0000 Subject: [PATCH 1/2] Increased compression level of ccache, removing old caches only from the current branch --- .github/workflows/build.yml | 28 +++++++--------------------- 1 file changed, 7 insertions(+), 21 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8cd7a37b2..580e7172b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -5,7 +5,7 @@ on: [push, workflow_dispatch] env: XC_VERSION: ${{ '15.1' }} CCACHE_COMPRESS: "true" - CCACHE_COMPRESSLEVEL: "10" + CCACHE_COMPRESSLEVEL: "19" CCACHE_MAXSIZE: "400M" jobs: @@ -35,19 +35,12 @@ jobs: run: "ccache --show-stats --verbose" - name: Remove old ccache caches run: | - gh extension install actions/gh-actions-cache - echo "Fetching list of cache key" - cacheKeys=$(gh actions-cache list --key ccache-${{ github.job }}-${{ matrix.configuration }}- | cut -f 1 ) - ## Setting this to not fail the workflow while deleting cache keys. set +e - echo "Deleting caches..." - for cacheKey in $cacheKeys - do - gh actions-cache delete $cacheKey --confirm - done - echo "Done" + gh extension install actions/gh-actions-cache + gh actions-cache list -B $BRANCH --key ccache-${{ github.job }}-${{ matrix.configuration }}- | cut -f 1 | xargs -I {} gh actions-cache delete {} --confirm env: GH_TOKEN: ${{ github.token }} + BRANCH: ${{ github.ref }} build-unsigned: runs-on: macos-13 @@ -71,19 +64,12 @@ jobs: run: "ccache --show-stats --verbose" - name: Remove old ccache caches run: | - gh extension install actions/gh-actions-cache - echo "Fetching list of cache key" - cacheKeys=$(gh actions-cache list --key ccache-${{ github.job }}- | cut -f 1 ) - # Setting this to not fail the workflow while deleting cache keys. set +e - echo "Deleting caches..." - for cacheKey in $cacheKeys - do - gh actions-cache delete $cacheKey --confirm - done - echo "Done" + gh extension install actions/gh-actions-cache + gh actions-cache list -B $BRANCH --key ccache-${{ github.job }}- | cut -f 1 | xargs -I {} gh actions-cache delete {} --confirm env: GH_TOKEN: ${{ github.token }} + BRANCH: ${{ github.ref }} - uses: actions/upload-artifact@v4 with: name: nimble-commander-unsigned From f5fdbf2a1a2f7fcc941111fb7b8f0dc995f8e473 Mon Sep 17 00:00:00 2001 From: Michael Kazakov Date: Mon, 22 Jan 2024 22:26:04 +0000 Subject: [PATCH 2/2] Decreased the compression level to 15, simplified the yaml file a bit --- .github/workflows/build.yml | 26 +++++++++----------------- 1 file changed, 9 insertions(+), 17 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 580e7172b..f4828f905 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -5,8 +5,10 @@ on: [push, workflow_dispatch] env: XC_VERSION: ${{ '15.1' }} CCACHE_COMPRESS: "true" - CCACHE_COMPRESSLEVEL: "19" + CCACHE_COMPRESSLEVEL: "15" CCACHE_MAXSIZE: "400M" + GH_TOKEN: ${{ github.token }} + BRANCH: ${{ github.ref }} jobs: @@ -19,16 +21,14 @@ jobs: - name: Select latest Xcode run: "sudo xcode-select -s /Applications/Xcode_$XC_VERSION.app" - name: Install ccache - run: | - brew install ccache - which ccache + run: brew install ccache - name: Cache ccache - uses: actions/cache@v2 + uses: actions/cache@v3 with: path: ~/Library/Caches/ccache key: ccache-${{ github.job }}-${{ matrix.configuration }}-${{ github.run_id }} restore-keys: ccache-${{ github.job }}-${{ matrix.configuration }} - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Build and run unit tests run: "cd Scripts && ./run_all_unit_tests.sh ${{ matrix.configuration }}" - name: Show ccache stats @@ -38,9 +38,6 @@ jobs: set +e gh extension install actions/gh-actions-cache gh actions-cache list -B $BRANCH --key ccache-${{ github.job }}-${{ matrix.configuration }}- | cut -f 1 | xargs -I {} gh actions-cache delete {} --confirm - env: - GH_TOKEN: ${{ github.token }} - BRANCH: ${{ github.ref }} build-unsigned: runs-on: macos-13 @@ -48,16 +45,14 @@ jobs: - name: Select latest Xcode run: "sudo xcode-select -s /Applications/Xcode_$XC_VERSION.app" - name: Install deps - run: | - brew install ccache - brew install create-dmg + run: brew install ccache && brew install create-dmg - name: Cache ccache - uses: actions/cache@v2 + uses: actions/cache@v3 with: path: ~/Library/Caches/ccache key: ccache-${{ github.job }}-${{ github.run_id }} restore-keys: ccache-${{ github.job }} - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Build and package run: "cd Scripts && ./build_unsigned.sh" - name: Show ccache stats @@ -67,9 +62,6 @@ jobs: set +e gh extension install actions/gh-actions-cache gh actions-cache list -B $BRANCH --key ccache-${{ github.job }}- | cut -f 1 | xargs -I {} gh actions-cache delete {} --confirm - env: - GH_TOKEN: ${{ github.token }} - BRANCH: ${{ github.ref }} - uses: actions/upload-artifact@v4 with: name: nimble-commander-unsigned