Skip to content

Commit

Permalink
resolve comment
Browse files Browse the repository at this point in the history
  • Loading branch information
5d committed Jan 9, 2024
1 parent 798504b commit a1a66dd
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
18 changes: 12 additions & 6 deletions .github/workflows/build_amplify_swift.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
platform:
type: string
required: true

xcode-version:
type: string
default: '14.3'
Expand All @@ -14,6 +14,10 @@ on:
type: string
default: 'macos-13'

cachable:
type: boolean
default: true

permissions:
contents: read
actions: write
Expand All @@ -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
Expand All @@ -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
Expand All @@ -69,22 +75,22 @@ 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
run: |
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
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/build_minimum_supported_swift_platforms.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
push:
branches:
- main
- ci-build-with-min-version

permissions:
contents: read
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit a1a66dd

Please sign in to comment.