Skip to content

Commit

Permalink
visionos-preview merged
Browse files Browse the repository at this point in the history
  • Loading branch information
MuniekMg committed May 8, 2024
2 parents a583be9 + 972d682 commit 385f670
Show file tree
Hide file tree
Showing 309 changed files with 15,097 additions and 1,978 deletions.
17 changes: 12 additions & 5 deletions .github/composite_actions/get_platform_parameters/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,22 @@ runs:
- id: get-xcode-version
run: |
LATEST_XCODE_VERSION=14.3.1
MINIMUM_XCODE_VERSION=14.0.1
MINIMUM_XCODE_VERSION_IOS_MAC=14.1.0
MINIMUM_XCODE_VERSION_WATCH_TV=14.3.1
INPUT_XCODE_VERSION=${{ inputs.xcode_version }}
case $INPUT_XCODE_VERSION in
latest)
XCODE_VERSION=$LATEST_XCODE_VERSION ;;
minimum)
XCODE_VERSION=$MINIMUM_XCODE_VERSION ;;
INPUT_PLATFORM=${{ inputs.platform }}
case $INPUT_PLATFORM in
iOS|macOS)
XCODE_VERSION=$MINIMUM_XCODE_VERSION_IOS_MAC ;;
tvOS|watchOS)
XCODE_VERSION=$MINIMUM_XCODE_VERSION_WATCH_TV ;;
esac ;;
*)
XCODE_VERSION=$INPUT_XCODE_VERSION ;;
esac
Expand All @@ -63,9 +70,9 @@ runs:
DESTINATION_MAPPING='{
"minimum": {
"iOS": "platform=iOS Simulator,name=iPhone 14,OS=16.0",
"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",
"iOS": "platform=iOS Simulator,name=iPhone 14,OS=16.1",
"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
3 changes: 2 additions & 1 deletion .github/workflows/build_amplify_swift_platforms.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,9 @@ jobs:
- platform: ${{ github.event.inputs.macos == 'false' && 'macOS' || 'None' }}
- platform: ${{ github.event.inputs.tvos == 'false' && 'tvOS' || 'None' }}
- platform: ${{ github.event.inputs.watchos == 'false' && 'watchOS' || 'None' }}
uses: ./.github/workflows/build_amplify_swift.yml
uses: ./.github/workflows/build_scheme.yml
with:
scheme: Amplify-Package
platform: ${{ matrix.platform }}

confirm-pass:
Expand Down
19 changes: 15 additions & 4 deletions .github/workflows/build_minimum_supported_swift_platforms.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,21 @@
name: Build with Minimum Supported Xcode Versions
name: Build with minimum Xcode version | Amplify Swift
on:
workflow_dispatch:
pull_request:
branches:
- main
push:
branches:
- main

permissions:
contents: read
actions: write

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: ${{ github.ref_name != 'main'}}

jobs:
build-amplify-with-minimum-supported-xcode:
name: Build Amplify Swift for ${{ matrix.platform }}
Expand All @@ -14,12 +24,13 @@ jobs:
matrix:
platform: [iOS, macOS, tvOS, watchOS]

uses: ./.github/workflows/build_amplify_swift.yml
uses: ./.github/workflows/build_scheme.yml
with:
os-runner: macos-12
scheme: Amplify-Build
os-runner: ${{ (matrix.platform == 'tvOS' || matrix.platform == 'watchOS') && 'macos-13' || 'macos-12' }}
xcode-version: 'minimum'
platform: ${{ matrix.platform }}
cacheable: false
save_build_cache: false

confirm-pass:
runs-on: ubuntu-latest
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
name: Build Amplify-Package for the given platform
name: Build scheme for the given platform and other parameters
on:
workflow_call:
inputs:
scheme:
type: string
required: true

platform:
type: string
required: true
Expand All @@ -14,7 +18,7 @@ on:
type: string
default: 'macos-13'

cacheable:
save_build_cache:
type: boolean
default: true

Expand All @@ -23,8 +27,8 @@ permissions:
actions: write

jobs:
build-amplify-swift:
name: Build Amplify-Package | ${{ inputs.platform }}
build-scheme:
name: Build ${{ inputs.scheme }} | ${{ inputs.platform }}
runs-on: ${{ inputs.os-runner }}
steps:
- name: Checkout repository
Expand All @@ -41,9 +45,8 @@ jobs:

- name: Attempt to use the dependencies cache
id: dependencies-cache
if: inputs.cacheable
timeout-minutes: 4
continue-on-error: ${{ inputs.cacheable }}
continue-on-error: true
uses: actions/cache/restore@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1
with:
path: ~/Library/Developer/Xcode/DerivedData/Amplify
Expand All @@ -53,20 +56,18 @@ jobs:
- name: Attempt to restore the build cache from main
id: build-cache
if: inputs.cacheable
timeout-minutes: 4
continue-on-error: ${{ inputs.cacheable }}
continue-on-error: true
uses: actions/cache/restore@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1
with:
path: ${{ github.workspace }}/Build
key: Amplify-${{ inputs.platform }}-build-cache

- name: Build Amplify for Swift
- name: Build ${{ inputs.scheme }}
id: build-package
continue-on-error: ${{ inputs.cacheable }}
uses: ./.github/composite_actions/run_xcodebuild
with:
scheme: Amplify-Package
scheme: ${{ inputs.scheme }}
destination: ${{ steps.platform.outputs.destination }}
sdk: ${{ steps.platform.outputs.sdk }}
xcode_path: /Applications/Xcode_${{ steps.platform.outputs.xcode-version }}.app
Expand All @@ -75,22 +76,22 @@ jobs:
disable_package_resolution: ${{ steps.dependencies-cache.outputs.cache-hit }}

- name: Save the dependencies cache in main
if: inputs.cacheable && steps.dependencies-cache.outputs.cache-hit != 'true' && github.ref_name == 'main'
if: 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.cacheable && steps.build-cache.outputs.cache-hit && github.ref_name == 'main'
if: inputs.save_build_cache && steps.build-cache.outputs.cache-hit && github.ref_name == 'main'
env:
GH_TOKEN: ${{ github.token }}
continue-on-error: ${{ inputs.cacheable }}
continue-on-error: true
run: |
gh cache delete ${{ steps.build-cache.outputs.cache-primary-key }}
- name: Save the build cache
if: inputs.cacheable && github.ref_name == 'main'
if: inputs.save_build_cache && github.ref_name == 'main'
uses: actions/cache/save@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1
with:
path: ${{ github.workspace }}/Build
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy_package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ jobs:
token: ${{steps.retrieve-token.outputs.token}}

- name: Setup Ruby
uses: ruby/setup-ruby@250fcd6a742febb1123a77a841497ccaa8b9e939 # v1.152.0
uses: ruby/setup-ruby@22fdc77bf4148f810455b226c90fb81b5cbc00a7 # v1.171.0
with:
ruby-version: '3.2.1'
bundler-cache: true
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ jobs:
token: ${{steps.retrieve-token.outputs.token}}

- name: Setup Ruby
uses: ruby/setup-ruby@250fcd6a742febb1123a77a841497ccaa8b9e939 # v1.152.0
uses: ruby/setup-ruby@22fdc77bf4148f810455b226c90fb81b5cbc00a7 # v1.171.0
with:
ruby-version: '3.2.1'
bundler-cache: true
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy_unstable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ jobs:
token: ${{steps.retrieve-token.outputs.token}}

- name: Setup Ruby
uses: ruby/setup-ruby@250fcd6a742febb1123a77a841497ccaa8b9e939 # v1.152.0
uses: ruby/setup-ruby@22fdc77bf4148f810455b226c90fb81b5cbc00a7 # v1.171.0
with:
ruby-version: '3.2.1'
bundler-cache: true
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release_doc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
token: ${{steps.retrieve-token.outputs.token}}

- name: Setup Ruby
uses: ruby/setup-ruby@250fcd6a742febb1123a77a841497ccaa8b9e939 # v1.152.0
uses: ruby/setup-ruby@22fdc77bf4148f810455b226c90fb81b5cbc00a7 # v1.171.0
with:
ruby-version: '3.2.1'
bundler-cache: true
Expand Down
13 changes: 7 additions & 6 deletions .github/workflows/unit_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ concurrency:
cancel-in-progress: ${{ github.ref_name != 'main'}}

jobs:
unit-tests-without-coverage:
targets-without-coverage:
name: ${{ matrix.scheme }} Unit Tests
strategy:
fail-fast: false
Expand All @@ -54,7 +54,7 @@ jobs:
scheme: ${{ matrix.scheme }}
generate_coverage_report: false

unit-tests-with-coverage:
targets-with-coverage:
name: ${{ matrix.scheme }} Unit Tests
strategy:
fail-fast: false
Expand All @@ -76,11 +76,12 @@ jobs:
uses: ./.github/workflows/run_unit_tests_platforms.yml
with:
scheme: ${{ matrix.scheme }}
generate_coverage_report: true
generate_coverage_report: ${{ vars.DISABLE_COVERAGE_REPORT != 'true' }}

report-coverage:
if: ${{ vars.DISABLE_COVERAGE_REPORT != 'true' }}
name: ${{ matrix.file.scheme }} Unit Tests
needs: [unit-tests-with-coverage]
needs: [targets-with-coverage]
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -108,8 +109,8 @@ jobs:
name: Confirm Passing Unit Tests
if: ${{ !cancelled() }}
needs: [
unit-tests-with-coverage,
unit-tests-without-coverage
targets-with-coverage,
targets-without-coverage
]
env:
EXIT_CODE: ${{ contains(needs.*.result, 'failure') && 1 || 0 }}
Expand Down
Loading

0 comments on commit 385f670

Please sign in to comment.