Skip to content

Commit

Permalink
Merge pull request #632 from aws-amplify/main
Browse files Browse the repository at this point in the history
Release Codegen Utility
  • Loading branch information
alharris-at authored Jul 17, 2023
2 parents 90336db + 225ad09 commit 8dbaba7
Show file tree
Hide file tree
Showing 58 changed files with 4,873 additions and 1,848 deletions.
4 changes: 2 additions & 2 deletions .circleci/config.base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ install_cli_with_local_codegen: &install_cli
startLocalRegistry "$(pwd)/.circleci/verdaccio.yaml"
setNpmRegistryUrlToLocal
changeNpmGlobalPath
npm install -g @aws-amplify/cli-internal
npm install -g @aws-amplify/cli-internal@cdk228withdata3
amplify -v
npm list --global --depth=1
unsetNpmRegistryUrl
Expand Down Expand Up @@ -303,7 +303,7 @@ jobs:
yarn clean-e2e-resources
no_output_timeout: 20m
- store_artifacts:
path: ~/repo/packages/amplify-e2e-tests/amplify-e2e-reports
path: ~/repo/packages/amplify-codegen-e2e-tests/amplify-e2e-reports
working_directory: ~/repo

verify-api-extract:
Expand Down
4 changes: 2 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ install_cli_with_local_codegen: &ref_3
startLocalRegistry "$(pwd)/.circleci/verdaccio.yaml"
setNpmRegistryUrlToLocal
changeNpmGlobalPath
npm install -g @aws-amplify/cli-internal
npm install -g @aws-amplify/cli-internal@cdk228withdata3
amplify -v
npm list --global --depth=1
unsetNpmRegistryUrl
Expand Down Expand Up @@ -306,7 +306,7 @@ jobs:
yarn clean-e2e-resources
no_output_timeout: 20m
- store_artifacts:
path: ~/repo/packages/amplify-e2e-tests/amplify-e2e-reports
path: ~/repo/packages/amplify-codegen-e2e-tests/amplify-e2e-reports
verify-api-extract:
docker: *ref_4
working_directory: ~/repo
Expand Down
10 changes: 10 additions & 0 deletions .codebuild/build_linux.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
version: 0.2
env:
shell: bash
phases:
build:
commands:
- source ./shared-scripts.sh && _buildLinux
artifacts:
files:
- 'shared-scripts.sh'
11 changes: 11 additions & 0 deletions .codebuild/cleanup_e2e_resources.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
version: 0.2
env:
shell: bash
variables:
CI: true
CODEBUILD: true

phases:
build:
commands:
- source ./shared-scripts.sh && _cleanupE2EResources
12 changes: 12 additions & 0 deletions .codebuild/cleanup_workflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
version: 0.2
env:
shell: bash
variables:
CI: true
CODEBUILD: true

phases:
build:
commands:
- yarn production-build
- cd packages/amplify-codegen-e2e-tests && yarn clean-cb-e2e-resources
8 changes: 8 additions & 0 deletions .codebuild/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
version: 0.2
env:
shell: bash
git-credential-helper: yes
phases:
build:
commands:
- source ./shared-scripts.sh && _deploy
130 changes: 130 additions & 0 deletions .codebuild/e2e_workflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
# auto generated file. DO NOT EDIT manually
version: 0.2
env:
shell: bash
compute-type: BUILD_GENERAL1_LARGE
batch:
fast-fail: false
build-graph:
- identifier: build_linux
buildspec: .codebuild/build_linux.yml
env:
compute-type: BUILD_GENERAL1_LARGE
- identifier: test
buildspec: .codebuild/test.yml
env:
compute-type: BUILD_GENERAL1_LARGE
depend-on:
- build_linux
- identifier: verify_api_extract
buildspec: .codebuild/verify_api_extract.yml
env:
compute-type: BUILD_GENERAL1_MEDIUM
depend-on:
- build_linux
- identifier: publish_to_local_registry
buildspec: .codebuild/publish_to_local_registry.yml
env:
compute-type: BUILD_GENERAL1_MEDIUM
depend-on:
- build_linux
- identifier: build_app_swift
buildspec: .codebuild/run_ios_modelgen_e2e_test.yml
env:
compute-type: BUILD_GENERAL1_LARGE
variables:
TEST_SUITE: src/__tests__/build-app-swift.test.ts
CLI_REGION: us-east-2
depend-on:
- publish_to_local_registry
- identifier: >-
add_codegen_ios_configure_codegen_android_configure_codegen_js_graphql_codegen_android
buildspec: .codebuild/run_e2e_tests.yml
env:
compute-type: BUILD_GENERAL1_LARGE
variables:
TEST_SUITE: >-
src/__tests__/add-codegen-ios.test.ts|src/__tests__/configure-codegen-android.test.ts|src/__tests__/configure-codegen-js.test.ts|src/__tests__/graphql-codegen-android.test.ts
CLI_REGION: us-east-1
depend-on:
- publish_to_local_registry
- identifier: >-
graphql_codegen_js_remove_codegen_android_remove_codegen_ios_add_codegen_android
buildspec: .codebuild/run_e2e_tests.yml
env:
compute-type: BUILD_GENERAL1_LARGE
variables:
TEST_SUITE: >-
src/__tests__/graphql-codegen-js.test.ts|src/__tests__/remove-codegen-android.test.ts|src/__tests__/remove-codegen-ios.test.ts|src/__tests__/add-codegen-android.test.ts
CLI_REGION: us-east-2
depend-on:
- publish_to_local_registry
- identifier: >-
configure_codegen_ios_datastore_modelgen_android_datastore_modelgen_js_feature_flags
buildspec: .codebuild/run_e2e_tests.yml
env:
compute-type: BUILD_GENERAL1_LARGE
variables:
TEST_SUITE: >-
src/__tests__/configure-codegen-ios.test.ts|src/__tests__/datastore-modelgen-android.test.ts|src/__tests__/datastore-modelgen-js.test.ts|src/__tests__/feature-flags.test.ts
CLI_REGION: us-west-2
depend-on:
- publish_to_local_registry
- identifier: >-
graphql_codegen_ios_add_codegen_js_datastore_modelgen_ios_remove_codegen_js
buildspec: .codebuild/run_e2e_tests.yml
env:
compute-type: BUILD_GENERAL1_LARGE
variables:
TEST_SUITE: >-
src/__tests__/graphql-codegen-ios.test.ts|src/__tests__/add-codegen-js.test.ts|src/__tests__/datastore-modelgen-ios.test.ts|src/__tests__/remove-codegen-js.test.ts
CLI_REGION: eu-west-2
depend-on:
- publish_to_local_registry
- identifier: >-
datastore_modelgen_flutter_env_codegen_model_introspection_codegen_pull_codegen
buildspec: .codebuild/run_e2e_tests.yml
env:
compute-type: BUILD_GENERAL1_LARGE
variables:
TEST_SUITE: >-
src/__tests__/datastore-modelgen-flutter.test.ts|src/__tests__/env-codegen.test.ts|src/__tests__/model-introspection-codegen.test.ts|src/__tests__/pull-codegen.test.ts
CLI_REGION: eu-central-1
depend-on:
- publish_to_local_registry
- identifier: >-
push_codegen_ios_push_codegen_android_graphql_documents_generator_push_codegen_js
buildspec: .codebuild/run_e2e_tests.yml
env:
compute-type: BUILD_GENERAL1_LARGE
variables:
TEST_SUITE: >-
src/__tests__/push-codegen-ios.test.ts|src/__tests__/push-codegen-android.test.ts|src/__tests__/graphql-documents-generator.test.ts|src/__tests__/push-codegen-js.test.ts
CLI_REGION: ap-southeast-1
depend-on:
- publish_to_local_registry
- identifier: build_app_ts
buildspec: .codebuild/run_e2e_tests.yml
env:
compute-type: BUILD_GENERAL1_LARGE
variables:
TEST_SUITE: src/__tests__/build-app-ts.test.ts
CLI_REGION: ap-southeast-2
depend-on:
- publish_to_local_registry
- identifier: build_app_android
buildspec: .codebuild/run_e2e_tests.yml
env:
compute-type: BUILD_GENERAL1_MEDIUM
variables:
TEST_SUITE: src/__tests__/build-app-android.test.ts
CLI_REGION: ap-northeast-1
depend-on:
- publish_to_local_registry
- identifier: cleanup_e2e_resources
buildspec: .codebuild/cleanup_e2e_resources.yml
env:
compute-type: BUILD_GENERAL1_MEDIUM
depend-on:
- >-
add_codegen_ios_configure_codegen_android_configure_codegen_js_graphql_codegen_android
39 changes: 39 additions & 0 deletions .codebuild/e2e_workflow_base.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
version: 0.2
env:
shell: bash
compute-type: BUILD_GENERAL1_LARGE

batch:
fast-fail: false
build-graph:
- identifier: build_linux
buildspec: .codebuild/build_linux.yml
env:
compute-type: BUILD_GENERAL1_LARGE
- identifier: test
buildspec: .codebuild/test.yml
env:
compute-type: BUILD_GENERAL1_LARGE
depend-on:
- build_linux
- identifier: verify_api_extract
buildspec: .codebuild/verify_api_extract.yml
env:
compute-type: BUILD_GENERAL1_MEDIUM
depend-on:
- build_linux
- identifier: publish_to_local_registry
buildspec: .codebuild/publish_to_local_registry.yml
env:
compute-type: BUILD_GENERAL1_MEDIUM
depend-on:
- build_linux
- identifier: build_app_swift
buildspec: .codebuild/run_ios_modelgen_e2e_test.yml
env:
compute-type: BUILD_GENERAL1_LARGE
variables:
TEST_SUITE: src/__tests__/build-app-swift.test.ts
CLI_REGION: us-east-2
depend-on:
- publish_to_local_registry
7 changes: 7 additions & 0 deletions .codebuild/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
version: 0.2
env:
shell: bash
phases:
build:
commands:
- source ./shared-scripts.sh && _lint
22 changes: 22 additions & 0 deletions .codebuild/pr_workflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
version: 0.2
env:
shell: bash
compute-type: BUILD_GENERAL1_LARGE

batch:
fast-fail: false
build-graph:
- identifier: build_linux
buildspec: .codebuild/build_linux.yml
- identifier: test
buildspec: .codebuild/test.yml
depend-on:
- build_linux
- identifier: lint
buildspec: .codebuild/lint.yml
depend-on:
- build_linux
- identifier: verify_api_extract
buildspec: .codebuild/verify_api_extract.yml
depend-on:
- build_linux
11 changes: 11 additions & 0 deletions .codebuild/publish_to_local_registry.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
version: 0.2
env:
shell: bash
phases:
build:
commands:
- source ./shared-scripts.sh && _publishToLocalRegistry

artifacts:
files:
- 'shared-scripts.sh'
26 changes: 26 additions & 0 deletions .codebuild/release_workflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
version: 0.2
env:
shell: bash
compute-type: BUILD_GENERAL1_LARGE

batch:
fast-fail: false
build-graph:
- identifier: build_linux
buildspec: .codebuild/build_linux.yml
- identifier: test
buildspec: .codebuild/test.yml
depend-on:
- build_linux
- identifier: lint
buildspec: .codebuild/lint.yml
depend-on:
- build_linux
- identifier: verify_api_extract
buildspec: .codebuild/verify_api_extract.yml
depend-on:
- build_linux
- identifier: deploy
buildspec: .codebuild/deploy.yml
depend-on:
- test
23 changes: 23 additions & 0 deletions .codebuild/run_e2e_tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
version: 0.2
env:
shell: bash
variables:
AMPLIFY_DIR: /root/.npm-global/lib/node_modules/@aws-amplify/cli-internal/bin
AMPLIFY_PATH: /root/.npm-global/lib/node_modules/@aws-amplify/cli-internal/bin/amplify
CI: true
CODEBUILD: true
NODE_OPTIONS: --max-old-space-size=8096

phases:
build:
commands:
- source ./shared-scripts.sh && _runE2ETestsLinux
post_build:
commands:
- aws sts get-caller-identity
- source ./shared-scripts.sh && _scanArtifacts

artifacts:
files:
- $CODEBUILD_SRC_DIR/packages/amplify-codegen-e2e-tests/amplify-e2e-reports/*
discard-paths: yes
27 changes: 27 additions & 0 deletions .codebuild/run_ios_modelgen_e2e_test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
version: 0.2
env:
shell: bash
variables:
AMPLIFY_DIR: /root/.npm-global/lib/node_modules/@aws-amplify/cli-internal/bin
AMPLIFY_PATH: /root/.npm-global/lib/node_modules/@aws-amplify/cli-internal/bin/amplify
CI: true
CODEBUILD: true
NODE_OPTIONS: --max-old-space-size=8096
phases:
build:
commands:
- source ./shared-scripts.sh && _runE2ETestsLinux
- export PATH_TO_MODELS=$CODEBUILD_SRC_DIR/packages/amplify-codegen-e2e-tests/test-apps/swift/amplify/generated
- cd $PATH_TO_MODELS && zip -r models.zip models
- aws s3 cp $PATH_TO_MODELS/models.zip s3://$ARTIFACT_BUCKET_NAME/models.zip
- export MODELS_S3_URL=$(aws s3 presign s3://$ARTIFACT_BUCKET_NAME/models.zip --expires-in 3600)
- cd $CODEBUILD_SRC_DIR && ./.codebuild/scripts/run-ios-modelgen-e2e-test.sh
post_build:
commands:
- aws sts get-caller-identity
- source ./shared-scripts.sh && _scanArtifacts

artifacts:
files:
- $CODEBUILD_SRC_DIR/packages/amplify-codegen-e2e-tests/amplify-e2e-reports/*
discard-paths: yes
Loading

0 comments on commit 8dbaba7

Please sign in to comment.