diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index 4e7a9b2cbc..0000000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,507 +0,0 @@ -# .circleci/config.yml - -version: 2.1 - -orbs: - aws-cli: circleci/aws-cli@3.1.4 - - # Using inline orb for now - getting-started-smoke-test: - orbs: - macos: circleci/macos@2 - node: circleci/node@5.0.2 - ruby: circleci/ruby@1.6.0 - aws-cli: circleci/aws-cli@3.1.1 - - commands: - send-metric-on-fail: - description: Send failure datapoint to cloudwatch - steps: - - run: - name: Send failure datapoint to cloudwatch - command: | - payload="{\"jobName\": \"${CIRCLE_JOB}\", \"projectRepoName\": \"${CIRCLE_PROJECT_REPONAME}\"}" - echo $payload - aws lambda invoke --function-name CircleCIWorkflowFailureHandler --payload "$payload" --cli-binary-format raw-in-base64-out response.json - when: on_fail - run-with-retry: - description: Run command with retry - parameters: - label: - description: Display name - type: string - command: - description: Command to run - type: string - retry-count: - description: Number of retry - type: integer - default: 3 - sleep: - description: Wait duration until next retry - type: integer - default: 5 - no_output_timeout: - description: Elapsed time the command can run without output - type: string - default: 10m - steps: - - run: - name: << parameters.label >> - command: | - retry() { - MAX_RETRY=<< parameters.retry-count >> - n=0 - until [ $n -ge $MAX_RETRY ] - do - << parameters.command >> && break - n=$[$n+1] - sleep << parameters.sleep >> - done - if [ $n -ge $MAX_RETRY ]; then - echo "failed: ${@}" >&2 - exit 1 - fi - } - retry - no_output_timeout: << parameters.no_output_timeout >> - jobs: - ios: - parameters: - xcode-version: - type: string - default: 13.3.0 - simulator-device: - type: string - default: iPhone 13 - simulator-os-version: - type: string - default: "15.4" - working_directory: ~/ios-canaries/canaries/example - macos: - xcode: <> - environment: - FL_OUTPUT_DIR: output - # Add steps to the job - # See: https://circleci.com/docs/2.0/configuration-reference/#steps - steps: - - checkout: - path: ~/ios-canaries - - aws-cli/setup: - role-session-name: ${CIRCLE_WORKFLOW_JOB_ID} - role-arn: ${AWS_ROLE_ARN} - session-duration: '2000' - - node/install - - run: npm install -g @aws-amplify/cli - - run: amplify init --quickstart --frontend ios - - macos/preboot-simulator: - device: <> - version: <> - - ruby/install-deps - - run-with-retry: - label: Run pod install - command: pod install - no_output_timeout: 20m - - run-with-retry: - label: Run tests - command: bundle exec fastlane scan - - send-metric-on-fail - -defaults: &defaults - macos: - xcode: '13.3.0' - working_directory: ~/amplify-swift - environment: - BUNDLE_PATH: vendor/bundle - -references: - repo_cache_key: &repo_cache_key v2-repo-{{ .Branch }}-{{ .Revision }} - - restore_repo: &restore_repo - restore_cache: - keys: - - *repo_cache_key - - v2-repo-{{ .Branch }} - - v2-repo - - pods_cache_key: &pods_cache_key v3-dependency-pods-{{ checksum "~/amplify-swift/Podfile" }} - - pods_backup_cache_key: &pods_backup_cache_key v3-dependency-pods - - restore_pods: &restore_pods - restore_cache: - keys: - - *pods_cache_key - - *pods_backup_cache_key - - plugin_pods_cache_key: &plugin_pods_cache_key - -commands: - pre_start_simulator: - description: >- - pre start simulator, build may fail if simulator is not started - steps: - - run: - name: Pre-start simulator - command: bash ~/amplify-swift/CircleciScripts/pre_start_simulator.sh - - restore_gems: - steps: - - restore_cache: - keys: - - v2-gems-{{ checksum "~/amplify-swift/Gemfile.lock" }} - - v2-gems- - - check_bundle: - steps: - - run: - name: Check bundle - command: bundle check --path $BUNDLE_PATH || bundle install --path $BUNDLE_PATH - - make_artifacts_directory: - steps: - - run: - name: Make artifacts directory - command: mkdir -p "artifacts" - - save_plugin_pods: - parameters: - prefix: - type: string - steps: - - save_cache: - key: v1-<< parameters.prefix >>-dependency-pods-{{ checksum "Podfile" }} - paths: - - ./Pods - - restore_plugin_pods: - parameters: - prefix: - type: string - steps: - - restore_cache: - keys: - - v1-<< parameters.prefix >>-dependency-pods-{{ checksum "Podfile" }} - - v1-<< parameters.prefix >>-dependency-pods - - upload_artifacts: - steps: - - store_artifacts: - path: artifacts - - -jobs: - checkout_code: - <<: *defaults - steps: - - *restore_repo - - checkout - - save_cache: - key: *repo_cache_key - paths: - - ~/amplify-swift - - install_gems: - <<: *defaults - steps: - - *restore_repo - - restore_gems - - run: - name: Bundle install - command: bundle check --path $BUNDLE_PATH || bundle install --path $BUNDLE_PATH - environment: - BUNDLE_JOBS: 4 - BUNDLE_RETRY: 3 - - save_cache: - key: v2-gems-{{ checksum "~/amplify-swift/Gemfile.lock" }} - paths: - - vendor/bundle - - build_test_amplify: - <<: *defaults - steps: - - *restore_repo - - pre_start_simulator - - run: pod install - - restore_gems - - check_bundle - - make_artifacts_directory - - run: - name: Build amplify - command: xcodebuild build-for-testing -workspace Amplify.xcworkspace -scheme Amplify -sdk iphonesimulator -destination "${destination}" | tee "artifacts/build-Amplify.log" | xcpretty - - run: - name: Test amplify - command: xcodebuild test -workspace Amplify.xcworkspace -scheme Amplify -sdk iphonesimulator -destination "${destination}" | tee "artifacts/test-Amplify.log" | xcpretty --simple --color --report junit - - run: - name: Upload coverage report to Codecov - command: bash ~/amplify-swift/build-support/codecov.sh -F 'Amplify' -J '^Amplify$' - - store_test_results: - path: build/reports - - upload_artifacts - - build_amplify_spm: - <<: *defaults - working_directory: ~/amplify-swift/.swiftpm/xcode - steps: - - *restore_repo - - pre_start_simulator - - restore_gems - - check_bundle - - make_artifacts_directory - - run: - name: Build amplify for SPM - command: xcodebuild build-for-testing -workspace package.xcworkspace -scheme Amplify-Package -sdk iphonesimulator -destination "${destination}" | tee "artifacts/build-Ampify-for-SPM.log" | xcpretty - - build_test_aws_plugins_core: - <<: *defaults - steps: - - *restore_repo - - pre_start_simulator - - run: pod install - - restore_gems - - check_bundle - - make_artifacts_directory - - run: - name: Build AWS plugins core - command: xcodebuild build-for-testing -workspace Amplify.xcworkspace -scheme AWSPluginsCore -sdk iphonesimulator -destination "${destination}" | tee "artifacts/build-AWSPluginsCore.log" | xcpretty - - run: - name: Test AWS plugins core - command: xcodebuild test -workspace Amplify.xcworkspace -scheme AWSPluginsCore -sdk iphonesimulator -destination "${destination}" | tee "artifacts/test-AWSPluginsCore.log" | xcpretty --simple --color --report junit - - run: - name: Upload coverage report to Codecov - command: bash ~/amplify-swift/build-support/codecov.sh -F 'AWSPluginsCore' -J '^AWSPluginsCore$' - - store_test_results: - path: build/reports - - upload_artifacts - - plugin_unit_test: - <<: *defaults - parameters: - path: - type: string - workspace: - type: string - scheme: - type: string - working_directory: ~/amplify-swift/AmplifyPlugins/<< parameters.path >> - description: << parameters.path >> unit test - steps: - - *restore_repo - - restore_plugin_pods: - prefix: << parameters.path >> - - pre_start_simulator - - run: pod install - - save_plugin_pods: - prefix: << parameters.path >> - - restore_gems - - check_bundle - - make_artifacts_directory - - run: - name: Build << parameters.path >> - command: xcodebuild build-for-testing -workspace << parameters.workspace >>.xcworkspace -scheme << parameters.scheme >> -sdk iphonesimulator -destination "${destination}" | tee "artifacts/build-<< parameters.scheme >>.log" | xcpretty - - run: - name: Test << parameters.path >> - command: xcodebuild test -workspace << parameters.workspace >>.xcworkspace -scheme << parameters.scheme >> -sdk iphonesimulator -destination "${destination}" | tee "artifacts/test-<< parameters.scheme >>.log" | xcpretty --simple --color --report junit - - run: - name: Upload << parameters.path >> coverage report to Codecov - command: bash ~/amplify-swift/build-support/codecov.sh -F << parameters.path >>_plugin_unit_test -J '^<< parameters.scheme >>$' - - store_test_results: - path: build/reports - - upload_artifacts - - deploy: - <<: *defaults - parameters: - lane: - type: string - default: 'unstable' - description: deploy pods to trunk - steps: - - add_ssh_keys: - fingerprints: - - '7a:f2:7f:a6:62:1a:9e:0f:f1:03:8c:fc:86:93:77:6e' - - *restore_repo - - restore_gems - - check_bundle - - aws-cli/setup: - role-arn: $AWS_OIDC_ROLE_ARN - role-session-name: "${CIRCLE_WORKFLOW_JOB_ID}.release" - session-duration: '900' - - run: - name: Release pods - command: bundle exec fastlane << parameters.lane >> - no_output_timeout: 60m - - fortify_scan: - <<: *defaults - steps: - - *restore_repo - - run: - name: Make source directory - command: | - mkdir source - cp -r Amplify source - cp -r AmplifyPlugins source - - aws-cli/setup: - role-arn: 'arn:aws:iam::971028514469:role/CircleCiOIDC' - role-session-name: 'aws-s3-session' - - run: - name: Download License - command: | - aws s3 cp s3://amplify-swift-fortify-prod/fortify.license fortify.license - - run: - name: Download Installer - command: | - aws s3 cp s3://amplify-swift-fortify-prod/Fortify_SCA_and_Apps_22.1.1_Mac.tar.gz Fortify_SCA_and_Apps_22.1.1_Mac.tar.gz - tar -xvf Fortify_SCA_and_Apps_22.1.1_Mac.tar.gz - unzip Fortify_SCA_and_Apps_22.1.1_osx_x64.app.zip - - run: - name: Download Scripts - command: | - aws s3 cp s3://amplify-swift-fortify-prod/amplify_swift_fortify_scan.sh fortify_scan.sh - - run: - name: Run Installer - command: | - Fortify_SCA_and_Apps_22.1.1_osx_x64.app/Contents/MacOS/installbuilder.sh --mode unattended --installdir Fortify --InstallSamples 0 --fortify_license_path fortify.license --MigrateSCA 0 - export PATH=~/amplify-swift/Fortify/bin:$PATH - echo "export PATH=~/amplify-swift/Fortify/bin:\$PATH" >> "$BASH_ENV" - fortifyupdate -acceptKey - sourceanalyzer -version - - run: - name: Run Scan - command: | - sh ./fortify_scan.sh source - -deploy_requires: &deploy_requires - requires: - - build_test_amplify - - build_amplify_spm - - build_test_aws_plugins_core - - unit_test_analytics - - unit_test_api - - unit_test_auth - - unit_test_core_ml - - unit_test_datastore - - unit_test_geo - - unit_test_predictions - - unit_test_storage - - fortify_scan - -workflows: - build_test_deploy: - when: - not: - equal: [ scheduled_pipeline, << pipeline.trigger_source >> ] - jobs: - - checkout_code - - install_gems: - requires: - - checkout_code - - fortify_scan: - context: - - amplify-swift-aws-s3-download - requires: - - install_gems - - build_test_amplify: - requires: - - fortify_scan - - build_test_aws_plugins_core: - requires: - - fortify_scan - - build_amplify_spm: - requires: - - fortify_scan - - plugin_unit_test: - name: unit_test_analytics - path: Analytics - workspace: AnalyticsCategoryPlugin - scheme: AWSPinpointAnalyticsPlugin - requires: - - fortify_scan - - plugin_unit_test: - name: unit_test_api - path: API - workspace: APICategoryPlugin - scheme: AWSAPICategoryPlugin - requires: - - fortify_scan - - plugin_unit_test: - name: unit_test_auth - path: Auth - workspace: AWSCognitoAuthPlugin - scheme: AWSCognitoAuthPlugin - requires: - - fortify_scan - - plugin_unit_test: - name: unit_test_datastore - path: DataStore - workspace: DataStoreCategoryPlugin - scheme: AWSDataStoreCategoryPlugin - requires: - - fortify_scan - - plugin_unit_test: - name: unit_test_geo - path: Geo - workspace: GeoCategoryPlugin - scheme: AWSLocationGeoPlugin - requires: - - fortify_scan - - plugin_unit_test: - name: unit_test_core_ml - path: Predictions - workspace: PredictionsCategoryPlugin - scheme: CoreMLPredictionsPlugin - requires: - - fortify_scan - - plugin_unit_test: - name: unit_test_predictions - path: Predictions - workspace: PredictionsCategoryPlugin - scheme: AWSPredictionsPlugin - requires: - - fortify_scan - - plugin_unit_test: - name: unit_test_storage - path: Storage - workspace: StoragePlugin - scheme: AWSS3StoragePlugin - requires: - - fortify_scan - - deploy: - name: deploy unstable - context: amplify-swift-aws-oidc - <<: *deploy_requires - filters: - branches: - only: - - v1 - - deploy: - name: deploy stable - lane: release - context: amplify-swift-aws-oidc - <<: *deploy_requires - filters: - branches: - only: - - release-v1 - - # Scheduled smoke test workflow - # Jobs are pulled from the getting-started-smoke-test inline orb defined below - canaries: - when: - and: - - equal: [ scheduled_pipeline, << pipeline.trigger_source >> ] - - equal: [ "Canaries", << pipeline.schedule.name >> ] - jobs: - - getting-started-smoke-test/ios: - context: - - cloudwatch-monitoring - xcode-version: "13.3.0" - simulator-os-version: "15.4" - simulator-device: "iPhone 13" - - getting-started-smoke-test/ios: - context: - - cloudwatch-monitoring - xcode-version: "12.5.1" - simulator-os-version: "14.5" - simulator-device: "iPhone 12" diff --git a/.github/workflows/build_test_amplify.yml b/.github/workflows/build_test_amplify.yml new file mode 100644 index 0000000000..9f2b8d9b48 --- /dev/null +++ b/.github/workflows/build_test_amplify.yml @@ -0,0 +1,37 @@ +name: Build Test Amplify +on: + workflow_call: + workflow_dispatch: + push: + branches-ignore: + - v1 + - release-v1 + pull_request: + branches: + - v1 + +permissions: + contents: read + +jobs: + build-test-amplify: + runs-on: macos-latest + steps: + - uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b + with: + persist-credentials: false + - name: Build Test Amplify + uses: ./.github/composite_actions/run_xcodebuild_test + with: + project_path: . + workspace: Amplify.xcworkspace + scheme: Amplify + + build-amplify-spm: + runs-on: macos-latest + steps: + - uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b + with: + persist-credentials: false + - name: Build Amplify for SPM + run: xcodebuild build-for-testing -scheme Amplify-Package -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 13,OS=latest' | xcpretty diff --git a/.github/workflows/deploy_package.yml b/.github/workflows/deploy_package.yml new file mode 100644 index 0000000000..9cb668f088 --- /dev/null +++ b/.github/workflows/deploy_package.yml @@ -0,0 +1,81 @@ +name: Deploy Package +on: + workflow_call: + inputs: + type: + description: 'The type of deployment. Valid values are unstable (default) and release' + default: 'unstable' + required: false + type: string + +permissions: + id-token: write + contents: write + +jobs: + build-and-test-amplify: + name: Build and Test Amplify + uses: ./.github/workflows/build_test_amplify.yml + + unit-tests: + name: Run Plugins Unit Tests + uses: ./.github/workflows/unit_test.yml + + integration-tests: + name: Run Integration Tests + uses: ./.github/workflows/integ_test.yml + + fortify: + name: Run Fortify Scan + uses: ./.github/workflows/fortify_scan.yml + + release: + name: Release new ${{ inputs.type }} version + environment: Release + needs: [unit-tests, fortify, integration-tests] + runs-on: macos-latest + steps: + - name: Configure AWS credentials + uses: aws-actions/configure-aws-credentials@5fd3084fc36e372ff1fff382a39b10d03659f355 #v2 + with: + role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }} + role-session-name: ${{ format('{0}.release', github.run_id) }} + aws-region: ${{ secrets.AWS_REGION }} + role-duration-seconds: 900 + + - id: retrieve-token + name: Retrieve Deploy Token + env: + DEPLOY_SECRET_ARN: ${{ secrets.DEPLOY_SECRET_ARN }} + run: | + PAT=$(aws secretsmanager get-secret-value \ + --secret-id "$DEPLOY_SECRET_ARN" \ + | jq ".SecretString | fromjson | .Credential") + echo "token=$PAT" >> $GITHUB_OUTPUT + + - name: Checkout repo + uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 + with: + fetch-depth: 10 + token: ${{steps.retrieve-token.outputs.token}} + + - name: Restore Gems Cache + uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1 + with: + path: vendor/bundle + key: v2-gems-${{ hashFiles('**/Gemfile.lock') }} + + - name: Install Bundle + env: + BUNDLE_PATH: vendor/bundle + run: | + bundle config set --local path $BUNDLE_PATH + bundle check || bundle install + + - name: Release Pods + env: + COCOAPODS_SECRET_ARN: ${{ secrets.COCOAPODS_SECRET_ARN }} + WORKING_DIRECTORY: ${{ github.workspace }} + GITHUB_EMAIL: aws-amplify-ops@amazon.com + GITHUB_USER: aws-amplify-ops + run: bundle exec fastlane ${{ inputs.type }} diff --git a/.github/workflows/deploy_release.yml b/.github/workflows/deploy_release.yml new file mode 100644 index 0000000000..01a68524e5 --- /dev/null +++ b/.github/workflows/deploy_release.yml @@ -0,0 +1,16 @@ +name: Build, Test and Release | Stable version +on: + push: + branches: + release-v1 + +permissions: + id-token: write + contents: write + +jobs: + release-stable: + uses: ./.github/workflows/deploy_package.yml + with: + type: release + secrets: inherit diff --git a/.github/workflows/deploy_unstable.yml b/.github/workflows/deploy_unstable.yml new file mode 100644 index 0000000000..ebbde132ed --- /dev/null +++ b/.github/workflows/deploy_unstable.yml @@ -0,0 +1,16 @@ +name: Build, Test and Release | Unstable version +on: + push: + branches: + v1 + +permissions: + id-token: write + contents: write + +jobs: + release-unstable: + uses: ./.github/workflows/deploy_package.yml + with: + type: unstable + secrets: inherit \ No newline at end of file diff --git a/.github/workflows/fortify_scan.yml b/.github/workflows/fortify_scan.yml new file mode 100644 index 0000000000..c4824b385a --- /dev/null +++ b/.github/workflows/fortify_scan.yml @@ -0,0 +1,56 @@ +name: Fortify Scan +on: + workflow_dispatch: + workflow_call: + push: + branches-ignore: + - v1 + - release-v1 + +permissions: + id-token: write + contents: read + +jobs: + fortify-scan: + runs-on: macos-latest + environment: Fortify + steps: + - uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b + with: + persist-credentials: false + + - name: Make source directory + run: | + mkdir source + cp -r Amplify source + cp -r AmplifyPlugins source + - name: Configure AWS credentials for fetching fortify resources + uses: aws-actions/configure-aws-credentials@05b148adc31e091bafbaf404f745055d4d3bc9d2 # Pin to 1.6.1 + with: + role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }} + aws-region: ${{ secrets.AWS_REGION }} + role-session-name: GHAFortifySession + role-duration-seconds: 900 + + - name: Download License + run: | + aws s3 cp s3://${{ secrets.AWS_S3_FORTIFY_BUCKET }}${{ vars.LICENSE_PATH }} fortify.license + - name: Download Installer + run: | + aws s3 cp s3://${{ secrets.AWS_S3_FORTIFY_BUCKET }}${{ vars.INSTALLER_PATH }} Fortify_SCA_and_Apps_22.1.1_Mac.tar.gz + tar -xvf Fortify_SCA_and_Apps_22.1.1_Mac.tar.gz + unzip Fortify_SCA_and_Apps_22.1.1_osx_x64.app.zip + - name: Download Scripts + run: | + aws s3 cp s3://${{ secrets.AWS_S3_FORTIFY_BUCKET }}${{ vars.SCRIPTS_PATH }} fortify_scan.sh + - name: Run Installer + run: | + Fortify_SCA_and_Apps_22.1.1_osx_x64.app/Contents/MacOS/installbuilder.sh --mode unattended --installdir ~/amplify-swift/Fortify --InstallSamples 0 --fortify_license_path fortify.license --MigrateSCA 0 + export PATH=~/amplify-swift/Fortify/bin:$PATH + fortifyupdate -acceptKey + sourceanalyzer -version + - name: Run Scan + run: | + export PATH=~/amplify-swift/Fortify/bin:$PATH + sh ./fortify_scan.sh source \ No newline at end of file diff --git a/.github/workflows/integ_test.yml b/.github/workflows/integ_test.yml index c3811ae997..2bc8db6fd7 100644 --- a/.github/workflows/integ_test.yml +++ b/.github/workflows/integ_test.yml @@ -1,7 +1,6 @@ name: Integration Tests on: - push: - branches: [v1] + workflow_call: permissions: id-token: write diff --git a/.github/workflows/release_kickoff.yml b/.github/workflows/release_kickoff.yml index d5161e9241..31b55f4cb7 100644 --- a/.github/workflows/release_kickoff.yml +++ b/.github/workflows/release_kickoff.yml @@ -1,4 +1,4 @@ -# Creates a PR to push main to release branch to kick-off the CircleCI release workflow +# Creates a PR to push main to release branch to kick-off the release workflow name: Release Amplify iOS V1+ on: diff --git a/.github/workflows/unit_test.yml b/.github/workflows/unit_test.yml new file mode 100644 index 0000000000..d791783d0b --- /dev/null +++ b/.github/workflows/unit_test.yml @@ -0,0 +1,127 @@ +name: Unit Tests +on: + workflow_call: + workflow_dispatch: + push: + branches-ignore: + - v1 + - release-v1 + pull_request: + branches: + - v1 + +permissions: + contents: read + +jobs: + unit-test-aws-plugins-core: + runs-on: macos-latest + steps: + - uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b + with: + persist-credentials: false + + - name: Unit Test AWSPluginsCore + uses: ./.github/composite_actions/run_xcodebuild_test + with: + project_path: . + workspace: Amplify.xcworkspace + scheme: AWSPluginsCore + + unit-test-analytics: + runs-on: macos-latest + steps: + - uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b + with: + persist-credentials: false + + - name: Unit Test Analytics + uses: ./.github/composite_actions/run_xcodebuild_test + with: + project_path: ./AmplifyPlugins/Analytics/ + workspace: AnalyticsCategoryPlugin.xcworkspace + scheme: AWSPinpointAnalyticsPlugin + + unit-test-api: + runs-on: macos-latest + steps: + - uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b + with: + persist-credentials: false + + - name: Unit Test API + uses: ./.github/composite_actions/run_xcodebuild_test + with: + project_path: ./AmplifyPlugins/API/ + workspace: APICategoryPlugin.xcworkspace + scheme: AWSAPICategoryPlugin + + unit-test-auth: + runs-on: macos-latest + steps: + - uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b + with: + persist-credentials: false + + - name: Unit Test Auth + uses: ./.github/composite_actions/run_xcodebuild_test + with: + project_path: ./AmplifyPlugins/Auth/ + workspace: AWSCognitoAuthPlugin.xcworkspace + scheme: AWSCognitoAuthPlugin + + unit-test-datastore: + runs-on: macos-latest + steps: + - uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b + with: + persist-credentials: false + + - name: Unit Test DataStore + uses: ./.github/composite_actions/run_xcodebuild_test + with: + project_path: ./AmplifyPlugins/DataStore/ + workspace: DataStoreCategoryPlugin.xcworkspace + scheme: AWSDataStoreCategoryPlugin + + unit-test-geo: + runs-on: macos-latest + steps: + - uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b + with: + persist-credentials: false + + - name: Unit Test Geo + uses: ./.github/composite_actions/run_xcodebuild_test + with: + project_path: ./AmplifyPlugins/Geo/ + workspace: GeoCategoryPlugin.xcworkspace + scheme: AWSLocationGeoPlugin + + unit-test-predictions: + runs-on: macos-latest + steps: + - uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b + with: + persist-credentials: false + + - name: Unit Test Predictions + uses: ./.github/composite_actions/run_xcodebuild_test + with: + project_path: ./AmplifyPlugins/Predictions/ + workspace: PredictionsCategoryPlugin.xcworkspace + scheme: CoreMLPredictionsPlugin + + unit-test-storage: + runs-on: macos-latest + steps: + - uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b + with: + persist-credentials: false + + - name: Unit Test Auth + uses: ./.github/composite_actions/run_xcodebuild_test + with: + project_path: ./AmplifyPlugins/Storage/ + workspace: StoragePlugin.xcworkspace + scheme: AWSS3StoragePlugin diff --git a/fastlane/Fastfile b/fastlane/Fastfile index 8212e0f772..6bc2b70efa 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -145,7 +145,7 @@ platform :ios do version = options[:version].to_s changelog = options[:changelog] tag = "#{version}" - plugin_root = File.expand_path("#{ENV['CIRCLE_WORKING_DIRECTORY']}/AmplifyPlugins") + plugin_root = File.expand_path("#{ENV['WORKING_DIRECTORY']}/AmplifyPlugins") sh('bundle', 'exec', 'swift', 'package', 'update')