Skip to content

Commit

Permalink
chore: fixing build cache and scheme
Browse files Browse the repository at this point in the history
  • Loading branch information
sebaland committed Apr 24, 2024
1 parent f383565 commit 10ff46e
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 21 deletions.
4 changes: 2 additions & 2 deletions .github/composite_actions/get_platform_parameters/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ runs:
DESTINATION_MAPPING='{
"minimum": {
"iOS": "platform=iOS Simulator,name=iPhone 14,OS=16.1",
"tvOS": "platform=tvOS Simulator,name=Apple TV 4K (2nd generation),OS=16.0",
"watchOS": "platform=watchOS Simulator,name=Apple Watch Series 8 (45mm),OS=9.0",
"tvOS": "platform=tvOS Simulator,name=Apple TV 4K (2nd generation),OS=16.1",
"watchOS": "platform=watchOS Simulator,name=Apple Watch Series 8 (45mm),OS=9.1",
"macOS": "platform=macOS,arch=x86_64"
},
"latest": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
os-runner: ${{ (matrix.platform == 'tvOS' || matrix.platform == 'watchOS') && 'macos-13' || 'macos-12' }}
xcode-version: 'minimum'
platform: ${{ matrix.platform }}
use_cache: false
save_build_cache: false

confirm-pass:
runs-on: ubuntu-latest
Expand Down
11 changes: 4 additions & 7 deletions .github/workflows/build_scheme.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ on:
type: string
default: 'macos-13'

use_cache:
save_build_cache:
type: boolean
default: true

Expand All @@ -45,7 +45,6 @@ jobs:

- name: Attempt to use the dependencies cache
id: dependencies-cache
if: inputs.use_cache
timeout-minutes: 4
continue-on-error: true
uses: actions/cache/restore@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1
Expand All @@ -57,7 +56,6 @@ jobs:
- name: Attempt to restore the build cache from main
id: build-cache
if: inputs.use_cache
timeout-minutes: 4
continue-on-error: true
uses: actions/cache/restore@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1
Expand All @@ -67,7 +65,6 @@ jobs:

- name: Build ${{ inputs.scheme }}
id: build-package
continue-on-error: true
uses: ./.github/composite_actions/run_xcodebuild
with:
scheme: ${{ inputs.scheme }}
Expand All @@ -79,22 +76,22 @@ jobs:
disable_package_resolution: ${{ steps.dependencies-cache.outputs.cache-hit }}

- name: Save the dependencies cache in main
if: inputs.use_cache && steps.dependencies-cache.outputs.cache-hit != 'true' && github.ref_name == 'main'
if: always() && inputs.save_build_cache && 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: inputs.use_cache && steps.build-cache.outputs.cache-hit && github.ref_name == 'main'
if: always() && inputs.save_build_cache && 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: inputs.use_cache && github.ref_name == 'main'
if: always() && inputs.save_build_cache && github.ref_name == 'main'
uses: actions/cache/save@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1
with:
path: ${{ github.workspace }}/Build
Expand Down
12 changes: 1 addition & 11 deletions .swiftpm/xcode/xcshareddata/xcschemes/Amplify-Build.xcscheme
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
version = "1.7">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES"
buildArchitectures = "Automatic">
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "NO"
Expand Down Expand Up @@ -201,15 +200,6 @@
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "Amplify"
BuildableName = "Amplify"
BlueprintName = "Amplify"
ReferencedContainer = "container:">
</BuildableReference>
</MacroExpansion>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
Expand Down

0 comments on commit 10ff46e

Please sign in to comment.