Skip to content

Commit

Permalink
chore: Update next from main (#11796)
Browse files Browse the repository at this point in the history
  • Loading branch information
jimblanc authored Aug 15, 2023
2 parents 8210987 + 363f364 commit 173ac13
Show file tree
Hide file tree
Showing 686 changed files with 125,446 additions and 14,092 deletions.
134 changes: 38 additions & 96 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ executors:

macos-executor:
macos:
xcode: 13.2.1
xcode: 13.4.1
resource_class: large

webkit-test-executor:
Expand Down Expand Up @@ -364,21 +364,14 @@ jobs:
- checkout
- run:
name: yarn install --non-interactive
# temporarily rename .yarnrc before installing so that we can generate a yarn.lock artifact
command: |
mv .yarnrc ._yarnrc
yarn
- run: yarn bootstrap
- run: yarn build
# storing yarn.lock as an artifact, so that we can quickly get a dependency diff
# with the last working build in the event that some upstream deps break the build in the future
- store_artifacts:
path: yarn.lock
- run:
name: delete lockfile after persisting
command: |
mv ._yarnrc .yarnrc
rm yarn.lock
- save_cache:
key: amplify-ssh-deps-{{ .Branch }}
paths:
Expand Down Expand Up @@ -1098,12 +1091,12 @@ jobs:
steps:
- integ_test_rn_ios

integ_rn_ios_push_notifications:
executor: macos-executor
<<: *test_env_vars
working_directory: ~/amplify-js-samples-staging/samples/react-native/push-notifications/PushNotificationApp
steps:
- integ_test_rn_ios
# integ_rn_ios_push_notifications:
# executor: macos-executor
# <<: *test_env_vars
# working_directory: ~/amplify-js-samples-staging/samples/react-native/push-notifications/PushNotificationApp
# steps:
# - integ_test_rn_ios

# integ_rn_android_storage:
# executor: macos-executor
Expand Down Expand Up @@ -1570,6 +1563,23 @@ jobs:
spec: websocket-disruption
browser: << parameters.browser >>

integ_react_api_optimistic_ui:
parameters:
browser:
type: string
executor: js-test-executor
<<: *test_env_vars
working_directory: ~/amplify-js-samples-staging/samples/react/api/optimistic-ui
steps:
- prepare_test_env
- integ_test_js:
test_name: 'API (GraphQL) - Optimistic UI'
framework: react
category: api
sample_name: optimistic-ui
spec: optimistic-ui
browser: << parameters.browser >>

deploy:
executor: macos-executor
working_directory: ~/amplify-js
Expand Down Expand Up @@ -2003,12 +2013,12 @@ workflows:
- build
filters:
<<: *releasable_branches
- integ_rn_ios_push_notifications:
requires:
- integ_setup
- build
filters:
<<: *releasable_branches
# - integ_rn_ios_push_notifications:
# requires:
# - integ_setup
# - build
# filters:
# <<: *releasable_branches
- integ_rn_ios_device_tracking:
requires:
- integ_setup
Expand Down Expand Up @@ -2237,84 +2247,16 @@ workflows:
matrix:
parameters:
<<: *minimal_browser_list
- deploy:
filters:
<<: *releasable_branches
- integ_react_api_optimistic_ui:
requires:
- unit_test
- bundle_test
- integ_react_delete_user
- integ_react_predictions
- integ_react_datastore
- integ_react_datastore_v2
- integ_react_datastore_multi_auth_one_rule
- integ_react_datastore_multi_auth_one_rule_v2
- integ_react_datastore_multi_auth_two_rules
- integ_react_datastore_multi_auth_two_rules_v2
- integ_react_datastore_multi_auth_three_plus_rules
- integ_react_datastore_multi_auth_three_plus_rules_v2
- integ_react_datastore_subs_disabled
- integ_react_datastore_subs_disabled_v2
- integ_react_datastore_consecutive_saves
- integ_react_datastore_consecutive_saves_v2
# - integ_react_datastore_observe_query
# - integ_react_datastore_observe_query_v2
- integ_react_datastore_schema_drift
- integ_react_storage
- integ_react_storage_multipart_progress
- integ_react_storage_copy
- integ_react_interactions
- integ_angular_interactions
- integ_vue_interactions
- integ_react_amazon_cognito_identity_js_cookie_storage
- integ_react_amazon_cognito_identity_js
- integ_node_amazon_cognito_identity_js
- integ_react_auth_1
- integ_react_auth_2
- integ_angular_auth
# - integ_javascript_auth # TODO: enable it when CDN deployment is automated
- integ_vue_auth
- integ_next_auth
- integ_rn_ios_storage
- integ_rn_ios_storage_multipart_progress
# - integ_rn_android_storage_multipart_progress
- integ_rn_ios_push_notifications
- integ_rn_ios_device_tracking
# - integ_rn_android_storage
# - integ_rn_ios_datastore_sqlite_adapter
- integ_datastore_auth
- integ_datastore_auth_v2
# - integ_duplicate_packages
- integ_auth_test_cypress_no_ui
- integ_react_graphql_api
# - integ_javascript_geo # TODO: enable it when CDN deployment is automated
- integ_react_geo
- integ_next_datastore_owner_auth
- integ_react_datastore_custom_pk_unconnected_models
- integ_react_datastore_custom_pk_unconnected_models_webkit
- integ_react_datastore_custom_pk_has_one
- integ_react_datastore_custom_pk_has_many_many_to_many
- integ_react_datastore_background_process_manager
- integ_react_datastore_background_process_manager_webkit
- integ_react_datastore_related_models
- integ_react_iot_reconnect
- integ_react_api_reconnect
- integ_react_datastore_selective_sync
- integ_react_datastore_nested_predicate
- integ_next_datastore_13_basic
- integ_next_datastore_13_js
- integ_vite_datastore_basic_crud
- integ_rollup_datastore_basic_crud
- integ_vanilla_js_datastore_basic_crud
- integ_react_datastore_docs_examples
- integ_react_datastore_websocket_disruption
- post_release:
- integ_setup
- build
filters:
branches:
only:
- release
requires:
- deploy
<<: *releasable_branches
matrix:
parameters:
<<: *extended_browser_list

# Scheduled smoke test workflow
# Jobs are pulled from the getting-started-smoke-test inline orb defined below
canaries:
Expand Down
50 changes: 50 additions & 0 deletions .github/actions/load-verdaccio-with-amplify-js/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Load Verdaccio with AmplifyJs
description: Turn on Verdaccio and load up all of the AmplifyJS build artifacts

runs:
using: 'composite'
steps:
- name: Start verdaccio
run: |
npx [email protected] &
while ! nc -z localhost 4873; do
echo "Verdaccio not running yet"
sleep 1
done
# Run your commands after verdaccio is up and running
echo "Verdaccio is up and running, proceeding with the script..."
shell: bash
- name: Install and run npm-cli-login
shell: bash
env:
NPM_REGISTRY: http://localhost:4873/
NPM_USER: verdaccio
NPM_PASS: verdaccio
NPM_EMAIL: [email protected]
run: |
npm i -g npm-cli-adduser
npm-cli-adduser
sleep 1
- name: Configure registry and git
shell: bash
working-directory: ./amplify-js
env:
NPM_REGISTRY: http://localhost:4873/
NPM_USER: verdaccio
NPM_PASS: verdaccio
NPM_EMAIL: [email protected]
run: |
yarn config set registry $NPM_REGISTRY
npm set registry $NPM_REGISTRY
git config --global user.email $NPM_EMAIL
git config --global user.name $NPM_USER
git status
git --no-pager diff
- name: Publish to verdaccio
shell: bash
working-directory: ./amplify-js
run: |
scripts/retry-yarn-script.sh -s publish:verdaccio -n 5 -r true
yarn info aws-amplify@unstable description
npm info aws-amplify@unstable version
48 changes: 48 additions & 0 deletions .github/actions/node-and-build/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Set Node and Build
description: Checks out Amplify and builds the package
inputs:
is-prebuild:
required: false
default: false
runs:
using: 'composite'
steps:
- name: Setup Node.js 16
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0 https://github.com/actions/setup-node/commit/64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c
with:
node-version: 16
env:
SEGMENT_DOWNLOAD_TIMEOUT_MINS: 2
- uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1
id: cache-build-artifacts
with:
path: |
**/node_modules
**/dist
**/lib
**/lib-esm/
**/es/
**/esm/
**/cjs/
**/packages/core/src/Platform/version.ts
key: ${{ runner.os }}-build-artifacts-${{ github.sha }}
restore-keys: |
${{ runner.os }}-build-artifacts-
env:
SEGMENT_DOWNLOAD_TIMEOUT_MINS: 2
# TODO We should be able to skip yarn / bootstrap if we cache enough things. Leaving because skipping causes issues.
- name: Install
if: inputs.is-prebuild != 'true' || steps.cache-build-artifacts.outputs.cache-hit != 'true'
run: yarn
shell: bash
working-directory: ./amplify-js
- name: Bootstrap
if: inputs.is-prebuild != 'true' || steps.cache-build-artifacts.outputs.cache-hit != 'true'
run: yarn bootstrap
shell: bash
working-directory: ./amplify-js
- name: Build packages
if: steps.cache-build-artifacts.outputs.cache-hit != 'true'
run: yarn build
shell: bash
working-directory: ./amplify-js
47 changes: 47 additions & 0 deletions .github/actions/npm-publish/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Publish to NPM
description: Publish changes from the current commit to npm using the target release process.

inputs:
github_user:
description: The git user to make commits with
required: true
github_email:
description: The git email to make commits with
required: true
target:
description: The release process target (either release or preid)
required: true
preid:
description: The preid to release to when the target is preid. The preid process will fail if this isn't provided.
required: false
npm_token:
description: The npm token that gives the job npm permissions
required: true

runs:
using: 'composite'
steps:
- name: Set github commit user
shell: bash
env:
GITHUB_EMAIL: ${{ inputs.github_email }}
GITHUB_USER: ${{ inputs.github_user }}
run: |
git config --global user.email $GITHUB_EMAIL
git config --global user.name $GITHUB_USER
- name: Run npm publish
if: github.repository_owner == 'aws-amplify'
shell: bash
working-directory: ./amplify-js
env:
NPM_TOKEN: ${{ inputs.npm_token }}
GH_SHA: ${{ github.sha }}
TARGET: ${{ inputs.target }}
PREID_PREFIX: ${{ inputs.preid || '' }}
run: |
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc
export PREID_HASH_SUFFIX=$(echo $GH_SHA | cut -c -7 | sed 's/^/\./')
git status
git --no-pager diff
yarn publish:$TARGET
51 changes: 51 additions & 0 deletions .github/actions/setup-samples-staging/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Setup Amplify Integration Test Package
description: Checks out "amplify-js-samples-staging" and builds the package with caching

inputs:
GH_TOKEN_STAGING_READ:
description: The token that grants read access to the sample staging repo
required: true

runs:
using: 'composite'
steps:
- name: Create cache
uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1 https://github.com/actions/cache/commit/88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8
id: cache-samples-staging-build
with:
key: aws-amplify-js-samples-staging-build-${{ github.sha }}
path: |
./amplify-js-samples-staging/node_modules
/home/runner/.cache/Cypress
env:
SEGMENT_DOWNLOAD_TIMEOUT_MINS: 2
- name: Checkout staging repo
uses: actions/checkout@24cb9080177205b6e8c946b17badbe402adc938f # v3.4.0 https://github.com/actions/checkout/commit/24cb9080177205b6e8c946b17badbe402adc938f
with:
repository: ${{ github.repository_owner }}/amplify-js-samples-staging
path: amplify-js-samples-staging
token: ${{ inputs.GH_TOKEN_STAGING_READ }}

# We test on the staging branch that corresponds to the amplify-js branch
# when it exists and test on the default branch `main` otherwise
- name: Staging repo branch selection
shell: bash
working-directory: ./amplify-js-samples-staging
env:
BRANCH: ${{ github.ref_name }}
run: |
if git ls-remote --exit-code --heads origin $BRANCH >/dev/null 2>&1; then
# Branch exists, checkout and echo success message
git fetch origin $BRANCH
git checkout $BRANCH
echo "Checked out branch: $BRANCH"
else
# Branch doesn't exist, echo error message
echo "Branch '$BRANCH' does not exist"
fi
- name: Install
run: |
yarn
shell: bash
working-directory: ./amplify-js-samples-staging
Loading

0 comments on commit 173ac13

Please sign in to comment.