From a1a66dd50757853ea408ee651fbccf9a252c312a Mon Sep 17 00:00:00 2001 From: Di Wu Date: Tue, 9 Jan 2024 12:45:13 -0800 Subject: [PATCH] resolve comment --- .github/workflows/build_amplify_swift.yml | 18 ++++++++++++------ ...build_minimum_supported_swift_platforms.yml | 2 ++ 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build_amplify_swift.yml b/.github/workflows/build_amplify_swift.yml index d03a453913..6330472628 100644 --- a/.github/workflows/build_amplify_swift.yml +++ b/.github/workflows/build_amplify_swift.yml @@ -5,7 +5,7 @@ on: platform: type: string required: true - + xcode-version: type: string default: '14.3' @@ -14,6 +14,10 @@ on: type: string default: 'macos-13' + cachable: + type: boolean + default: true + permissions: contents: read actions: write @@ -34,9 +38,10 @@ jobs: with: platform: ${{ inputs.platform }} xcode_version: ${{ inputs.xcode-version }} - + - name: Attempt to use the dependencies cache id: dependencies-cache + if: inputs.cachable timeout-minutes: 4 continue-on-error: true uses: actions/cache/restore@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1 @@ -48,6 +53,7 @@ jobs: - name: Attempt to restore the build cache from main id: build-cache + if: inputs.cachable timeout-minutes: 4 continue-on-error: true uses: actions/cache/restore@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1 @@ -69,14 +75,14 @@ jobs: disable_package_resolution: ${{ steps.dependencies-cache.outputs.cache-hit }} - name: Save the dependencies cache in main - if: steps.dependencies-cache.outputs.cache-hit != 'true' && github.ref_name == 'main' + if: inputs.cachable && steps.dependencies-cache.outputs.cache-hit != 'true' && github.ref_name == 'main' uses: actions/cache/save@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1 with: path: ~/Library/Developer/Xcode/DerivedData/Amplify key: ${{ steps.dependencies-cache.outputs.cache-primary-key }} - + - name: Delete the old build cache - if: steps.build-cache.outputs.cache-hit && github.ref_name == 'main' + if: inputs.cachable && steps.build-cache.outputs.cache-hit && github.ref_name == 'main' env: GH_TOKEN: ${{ github.token }} continue-on-error: true @@ -84,7 +90,7 @@ jobs: gh cache delete ${{ steps.build-cache.outputs.cache-primary-key }} - name: Save the build cache - if: github.ref_name == 'main' + if: inputs.cachable && github.ref_name == 'main' uses: actions/cache/save@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1 with: path: ${{ github.workspace }}/Build diff --git a/.github/workflows/build_minimum_supported_swift_platforms.yml b/.github/workflows/build_minimum_supported_swift_platforms.yml index cac1600011..102d01d7a7 100644 --- a/.github/workflows/build_minimum_supported_swift_platforms.yml +++ b/.github/workflows/build_minimum_supported_swift_platforms.yml @@ -4,6 +4,7 @@ on: push: branches: - main + - ci-build-with-min-version permissions: contents: read @@ -37,6 +38,7 @@ jobs: os-runner: ${{ matrix.os-runner }} xcode-version: ${{ matrix.xcode-version }} platform: ${{ matrix.platform }} + cachable: false confirm-pass: runs-on: ubuntu-latest