diff --git a/.github/canary-config/canary-all.yml b/.github/canary-config/canary-all.yml new file mode 100644 index 00000000000..b9a433bb3d7 --- /dev/null +++ b/.github/canary-config/canary-all.yml @@ -0,0 +1,329 @@ +minimal_browser_list: &minimal_browser_list + - chrome + - firefox + +extended_browser_list: &extended_browser_list + - chrome + - firefox + - edge + +tests: + # DATASTORE + - test_name: integ_datastore_auth-owner-based-default + desc: 'DataStore Auth - Chrome' + framework: react + category: datastore + sample_name: owner-based-default + spec: owner-based-default + browser: *minimal_browser_list + - test_name: integ_react_datastore + desc: 'React DataStore' + framework: react + category: datastore + sample_name: [many-to-many] + spec: many-to-many + browser: *minimal_browser_list + - test_name: integ_react_datastore_multi_auth_one_rule + desc: 'React DataStore Multi-Auth - One Rule' + framework: react + category: datastore + sample_name: [multi-auth] + spec: multi-auth-one-rule + browser: *minimal_browser_list + - test_name: integ_react_datastore_multi_auth_three_plus_rules + desc: 'React DataStore Multi-Auth - Three Plus Rules' + framework: react + category: datastore + sample_name: [multi-auth] + spec: multi-auth-three-plus-rules + browser: *minimal_browser_list + - test_name: integ_react_datastore_subs_disabled + desc: 'DataStore - Subs Disabled' + framework: react + category: datastore + sample_name: [subs-disabled] + spec: subs-disabled + browser: *minimal_browser_list + - test_name: integ_react_datastore_consecutive_saves + desc: 'DataStore - Subs Disabled' + framework: react + category: datastore + sample_name: [consecutive-saves] + spec: consecutive-saves + browser: *minimal_browser_list + - test_name: integ_react_datastore_schema_drift + desc: 'DataStore - Schema Drift' + framework: react + category: datastore + sample_name: [schema-drift] + spec: schema-drift + browser: *minimal_browser_list + - test_name: integ_react_datastore_custom_pk_has_one + desc: 'DataStore - Custom Primary Key (Has One)' + framework: react + category: datastore + sample_name: [v2/custom-pk-has-one] + spec: custom-pk-has-one + browser: *minimal_browser_list + - test_name: integ_react_datastore_custom_pk_has_many_many_to_many + desc: 'DataStore - Custom Primary Key (Has Many / Many to Many)' + framework: react + category: datastore + sample_name: [v2/custom-pk-has-many-many-to-many] + spec: custom-pk-has-many-many-to-many + browser: *minimal_browser_list + - test_name: integ_react_datastore_background_process_manager + desc: 'DataStore - Background Process Manager' + framework: react + category: datastore + sample_name: [v2/background-process-manager] + spec: background-process-manager + browser: *extended_browser_list + - test_name: integ_react_datastore_related_models + desc: 'DataStore - Related Models' + framework: react + category: datastore + sample_name: [related-models] + spec: related-models + browser: *minimal_browser_list + - test_name: integ_react_datastore_selective_sync + desc: 'DataStore - Selective Sync' + framework: react + category: datastore + sample_name: [selective-sync-v5] + spec: selective-sync-v5 + browser: *minimal_browser_list + - test_name: integ_react_datastore_docs_examples + desc: 'DataStore - Docs Examples' + framework: react + category: datastore + sample_name: [v2/amplify-docs-examples] + spec: amplify-docs-examples + browser: *minimal_browser_list + timeout_minutes: 45 + retry_count: 10 + - test_name: integ_react_datastore_websocket_disruption + desc: 'DataStore - WebSocket Disruption' + framework: react + category: datastore + sample_name: [websocket-disruption] + spec: websocket-disruption + browser: *minimal_browser_list + - test_name: integ_next_datastore_owner_auth + desc: 'next owner auth' + framework: next + category: datastore + sample_name: [owner-based-default] + spec: next-owner-based-default + browser: *minimal_browser_list + - test_name: integ_next_datastore_13_js + desc: 'DataStore - Nextjs 13 build with SWC - JS app' + framework: next + category: datastore + sample_name: [next-13-js] + spec: nextjs-13 + browser: *minimal_browser_list + - test_name: integ_rollup_datastore_basic_crud + desc: 'Rollup + DataStore - Basic CRUD' + framework: rollup + category: datastore + sample_name: [rollup-basic-crud] + spec: rollup-basic-crud + browser: [chrome] + timeout_minutes: 45 + retry_count: 10 + - test_name: integ_vite_datastore_basic_crud + desc: 'Vite + DataStore - Basic CRUD' + framework: vite + category: datastore + sample_name: [v2/basic-crud] + spec: vite-basic-crud + browser: [chrome] + timeout_minutes: 45 + retry_count: 10 + + # GEO + - test_name: integ_react_geo_display_map + desc: 'Display Map' + framework: react + category: geo + sample_name: [display-map] + spec: display-map + # Temp fix: + browser: [chrome] + - test_name: integ_react_geo_search_outside_map + desc: 'Search Outside Map' + framework: react + category: geo + sample_name: [search-outside-map] + spec: search-outside-map + # Temp fix: + browser: [chrome] + + # INTERACTIONS + - test_name: integ_react_interactions_react_interactions + desc: 'React Interactions' + framework: react + category: interactions + sample_name: [chatbot-component] + spec: chatbot-component + browser: *minimal_browser_list + - test_name: integ_react_interactions_chatbot_v1 + desc: 'Chatbot V1' + framework: react + category: interactions + sample_name: [lex-test-component] + spec: chatbot-v1 + browser: *minimal_browser_list + - test_name: integ_angular_interactions + desc: 'Angular Interactions' + framework: angular + category: interactions + sample_name: [chatbot-component] + spec: chatbot-component + browser: *minimal_browser_list + - test_name: integ_vue_interactions_vue_2_interactions + desc: 'Vue 2 Interactions' + framework: vue + category: interactions + sample_name: [chatbot-component] + spec: chatbot-component + browser: [chrome] + + # PREDICTIONS + - test_name: integ_react_predictions + desc: 'React Predictions' + framework: react + category: predictions + sample_name: [multi-user-translation] + spec: multiuser-translation + browser: *minimal_browser_list + + # PUBSUB + - test_name: integ_react_iot_reconnect + desc: 'PubSub - Reconnection for IoT' + framework: react + category: pubsub + sample_name: [reconnection-iot] + spec: reconnection + # Firefox doesn't support network state management in cypress + browser: [chrome] + - test_name: integ_react_api_reconnect + desc: 'PubSub - Reconnection for API' + framework: react + category: pubsub + sample_name: [reconnection-api] + spec: reconnection + # Firefox doesn't support network state management in cypress + browser: [chrome] + + # STORAGE + - test_name: integ_react_storage + desc: 'React Storage' + framework: react + category: storage + sample_name: [storageApp] + spec: storage + browser: *minimal_browser_list + - test_name: integ_react_storage_multipart_progress + desc: 'React Storage Multi-Part Upload with Progress' + framework: react + category: storage + sample_name: [multi-part-upload-with-progress] + spec: multi-part-upload-with-progress + browser: *minimal_browser_list + - test_name: integ_react_storage_copy + desc: 'React Storage Copy' + framework: react + category: storage + sample_name: [multi-part-copy-with-progress] + spec: multi-part-copy-with-progress + browser: *minimal_browser_list + + # API + - test_name: integ_react_graphql_api + desc: 'React GraphQL API' + framework: react + category: api + sample_name: [graphql] + spec: graphql + browser: *minimal_browser_list + + # AUTH + - test_name: integ_react_auth_1_react_authenticator + desc: 'React Authenticator' + framework: react + category: auth + sample_name: [amplify-authenticator] + spec: new-ui-authenticator + browser: *minimal_browser_list + - test_name: integ_react_auth_2_react_credentials_different_region + desc: 'React Credentials Different Region' + framework: react + category: auth + sample_name: [credentials-auth] + spec: credentials-auth + browser: *minimal_browser_list + - test_name: integ_react_amazon_cognito_identity_js_cookie_storage + desc: 'amazon-cognito-identity-js-cookie-storage' + framework: react + category: auth + sample_name: [amazon-cognito-identity-js-cookie-storage] + spec: amazon-cognito-identity-js-cookie-storage + browser: *minimal_browser_list + - test_name: integ_react_amazon_cognito_identity_js + desc: 'amazon-cognito-identity-js' + framework: react + category: auth + sample_name: [amazon-cognito-identity-js] + spec: amazon-cognito-identity-js + browser: *minimal_browser_list + - test_name: integ_react_device_tracking + desc: 'cognito-device-tracking' + framework: react + category: auth + sample_name: [device-tracking] + spec: device-tracking + browser: *minimal_browser_list + - test_name: integ_react_delete_user + desc: 'delete-user' + framework: react + category: auth + sample_name: [delete-user] + spec: delete-user + browser: *minimal_browser_list + - test_name: integ_angular_auth_angular_authenticator + desc: 'Angular Authenticator' + framework: angular + category: auth + sample_name: [amplify-authenticator] + spec: ui-amplify-authenticator + browser: *minimal_browser_list + - test_name: integ_javascript_auth + desc: 'JavaScript Auth CDN' + framework: javascript + category: auth + sample_name: [auth-cdn] + spec: auth-cdn + browser: *minimal_browser_list + amplifyjs_dir: true + - test_name: integ_vue_auth_legacy_vue_authenticator + desc: 'Legacy Vue Authenticator' + framework: vue + category: auth + sample_name: [amplify-authenticator-legacy] + spec: authenticator + browser: *minimal_browser_list + - test_name: integ_next_auth_authenticator_and_ssr_page + desc: 'Authenticator and SSR page' + framework: next + category: auth + sample_name: [auth-ssr] + spec: auth-ssr + browser: *minimal_browser_list + - test_name: integ_node_amazon_cognito_identity_js + desc: 'amazon-cognito-identity-js' + framework: node + category: auth + sample_name: [amazon-cognito-identity-js] + build_type: dev \ No newline at end of file diff --git a/.github/workflows/callable-canary-e2e-runner.yml b/.github/workflows/callable-canary-e2e-runner.yml new file mode 100644 index 00000000000..ecde3811698 --- /dev/null +++ b/.github/workflows/callable-canary-e2e-runner.yml @@ -0,0 +1,40 @@ +name: 'Canary E2E Test Runner' + +on: + workflow_call: + +jobs: + e2e-prep: + name: Get required configs to run canary e2e tests + runs-on: ubuntu-latest + steps: + - name: checkout AmplifyJs + uses: actions/checkout@24cb9080177205b6e8c946b17badbe402adc938f + with: + path: amplify-js + - name: read canary config files + id: load_config + run: | + echo "CANARY_CONFIG=$(cat .github/canary-config/canary-all.yml | yq '.tests' -o=json | jq -c .)" >> $GITHUB_OUTPUT + working-directory: ./amplify-js + outputs: + canary-config: ${{steps.load_config.outputs.CANARY_CONFIG}} + canary-e2e-test-runner: + name: canary e2e test runner + needs: e2e-prep + secrets: inherit + strategy: + matrix: + canary-config: ${{ fromJson(needs.e2e-prep.outputs.canary-config) }} + fail-fast: false + uses: ./.github/workflows/callable-canary-e2e-tests.yml + with: + test_name: ${{ matrix.canary-config.test_name }} + framework: ${{ matrix.canary-config.framework }} + category: ${{ matrix.canary-config.category }} + spec: ${{ matrix.canary-config.spec || '' }} + amplifyjs_dir: ${{ matrix.canary-config.amplifyjs_dir || false }} + sample_name: ${{ toJSON(matrix.canary-config.sample_name) || '[""]' }} + browser: ${{ toJSON(matrix.canary-config.browser) || '[""]' }} + timeout_minutes: ${{ matrix.canary-config.timeout_minutes || 35 }} + retry_count: ${{ matrix.canary-config.retry_count || 3 }} \ No newline at end of file diff --git a/.github/workflows/callable-canary-e2e-tests.yml b/.github/workflows/callable-canary-e2e-tests.yml new file mode 100644 index 00000000000..2827adea201 --- /dev/null +++ b/.github/workflows/callable-canary-e2e-tests.yml @@ -0,0 +1,149 @@ +name: 'Canary E2E Tests' + +on: + workflow_call: + inputs: + test_name: + required: true + type: string + framework: + required: true + type: string + category: + required: true + type: string + sample_name: + required: true + type: string + spec: + required: false + type: string + browser: + required: false + type: string + amplifyjs_dir: + required: false + type: boolean + default: false + timeout_minutes: + required: true + type: number + retry_count: + required: true + type: number + +env: + AMPLIFY_DIR: /home/runner/work/amplify-js/amplify-js/amplify-js + CYPRESS_GOOGLE_CLIENTID: ${{ secrets.CYPRESS_GOOGLE_CLIENTID }} + CYPRESS_GOOGLE_CLIENT_SECRET: ${{ secrets.CYPRESS_GOOGLE_CLIENT_SECRET }} + CYPRESS_GOOGLE_REFRESH_TOKEN: ${{ secrets.CYPRESS_GOOGLE_REFRESH_TOKEN }} + +jobs: + canary-e2e-test: + name: 'E2E: ${{ inputs.test_name }}' + runs-on: ubuntu-latest + strategy: + matrix: + browser: + - ${{ fromJson(inputs.browser) }} + sample_name: + - ${{ fromJson(inputs.sample_name) }} + fail-fast: false + timeout-minutes: ${{ inputs.timeout_minutes }} + + steps: + - name: Checkout repository + uses: actions/checkout@24cb9080177205b6e8c946b17badbe402adc938f # v3.4.0 https://github.com/actions/checkout/commit/24cb9080177205b6e8c946b17badbe402adc938f + with: + # Minimal depth 2 so we can checkout the commit before possible merge commit. + fetch-depth: 2 + path: amplify-js + - 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 + + - name: Install + run: yarn + shell: bash + working-directory: ./amplify-js + - name: Bootstrap + run: yarn bootstrap + shell: bash + working-directory: ./amplify-js + - name: Build packages + run: yarn build + shell: bash + working-directory: ./amplify-js + - name: Setup samples staging repository + uses: ./amplify-js/.github/actions/setup-samples-staging + with: + GH_TOKEN_STAGING_READ: ${{ secrets.GH_TOKEN_STAGING_READ }} + - name: Modify package.json to run against aws-amplify latest + env: + E2E_FRAMEWORK: ${{ inputs.framework }} + E2E_CATEGORY: ${{ inputs.category }} + E2E_SAMPLE_NAME: ${{ matrix.sample_name }} + run: | + tmpfile=$(mktemp) + cp samples/$E2E_FRAMEWORK/$E2E_CATEGORY/$E2E_SAMPLE_NAME/package.json "$tmpfile" && + jq 'select(.dependencies) |= with_entries(select(.key | startswith("aws-amplify")).value = "latest")' samples/$E2E_FRAMEWORK/$E2E_CATEGORY/$E2E_SAMPLE_NAME/package.json "$tmpfile" > samples/$E2E_FRAMEWORK/$E2E_CATEGORY/$E2E_SAMPLE_NAME/package.json && rm -f -- "$tmpfile" + working-directory: amplify-js-samples-staging + - name: Run cypress tests for ${{ inputs.test_name }} dev + env: + E2E_FRAMEWORK: ${{ inputs.framework }} + E2E_CATEGORY: ${{ inputs.category }} + E2E_SAMPLE_NAME: ${{ matrix.sample_name }} + E2E_SPEC: ${{ inputs.spec }} + E2E_BROWSER: ${{ matrix.browser }} + E2E_AMPLIFY_JS_DIR: ${{ inputs.amplifyjs_dir == true && env.AMPLIFY_DIR || ''}} + E2E_RETRY_COUNT: ${{ inputs.retry_count }} + E2E_TEST_NAME: ${{ inputs.test_name }} + run: | + ../amplify-js/.circleci/retry-yarn-script.sh -s \ + "ci:test \ + $E2E_FRAMEWORK \ + $E2E_CATEGORY \ + $E2E_SAMPLE_NAME \ + $E2E_SPEC \ + $E2E_BROWSER \ + dev \ + $E2E_AMPLIFY_JS_DIR" \ + -n $E2E_RETRY_COUNT + working-directory: amplify-js-samples-staging + shell: bash + - name: Run cypress tests for ${{ inputs.test_name }} prod + env: + E2E_FRAMEWORK: ${{ inputs.framework }} + E2E_CATEGORY: ${{ inputs.category }} + E2E_SAMPLE_NAME: ${{ matrix.sample_name }} + E2E_SPEC: ${{ inputs.spec }} + E2E_BROWSER: ${{ matrix.browser }} + E2E_AMPLIFY_JS_DIR: ${{ inputs.amplifyjs_dir == true && env.AMPLIFY_DIR || ''}} + E2E_RETRY_COUNT: ${{ inputs.retry_count }} + E2E_TEST_NAME: ${{ inputs.test_name }} + run: | + ../amplify-js/.circleci/retry-yarn-script.sh -s \ + "ci:test \ + $E2E_FRAMEWORK \ + $E2E_CATEGORY \ + $E2E_SAMPLE_NAME \ + $E2E_SPEC \ + $E2E_BROWSER \ + prod \ + $E2E_AMPLIFY_JS_DIR" \ + -n $E2E_RETRY_COUNT + working-directory: amplify-js-samples-staging + shell: bash + - name: Upload artifact + uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2 https://github.com/actions/upload-artifact/commit/0b7f8abb1508181956e8e162db84b466c27e18ce + if: failure() + with: + name: ${{ inputs.test_name }} + if-no-files-found: ignore + path: | + amplify-js-samples-staging/cypress/videos + amplify-js-samples-staging/cypress/screenshots + retention-days: 14 \ No newline at end of file diff --git a/.github/workflows/callable-canary-e2e.yml b/.github/workflows/callable-canary-e2e.yml new file mode 100644 index 00000000000..2225b0c78ff --- /dev/null +++ b/.github/workflows/callable-canary-e2e.yml @@ -0,0 +1,48 @@ +name: 'Canary E2E Tests' + +on: + workflow_call: + +env: + WORKFLOW_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} + WEBHOOK_URL: ${{ secrets.WEBHOOK_URL }} + +jobs: + prebuild-ubuntu: + uses: ./.github/workflows/callable-prebuild-amplify-js.yml + with: + runs_on: ubuntu-latest + prebuild-macos: + uses: ./.github/workflows/callable-prebuild-amplify-js.yml + with: + runs_on: macos-latest + prebuild-samples-staging: + secrets: inherit + uses: ./.github/workflows/callable-prebuild-samples-staging.yml + e2e: + needs: + - prebuild-macos + - prebuild-ubuntu + - prebuild-samples-staging + secrets: inherit + uses: ./.github/workflows/callable-canary-e2e-runner.yml + sample-app-tests: + secrets: inherit + uses: ./.github/workflows/callable-canary-sampleapp-tests.yml + slack-alert: + needs: + - e2e + - sample-app-tests + runs-on: ubuntu-latest + if: failure() + steps: + - name: Send slack message + env: + WORKFLOW_URL: ${{ env.WORKFLOW_URL }} + WEBHOOK_URL: ${{ env.WEBHOOK_URL }} + run: | + curl -X POST -H "Content-Type: application/json" \ + --data '{"URL":"$WORKFLOW_URL"}' \ + $WEBHOOK_URL + + \ No newline at end of file diff --git a/.github/workflows/callable-canary-sampleapp-tests.yml b/.github/workflows/callable-canary-sampleapp-tests.yml new file mode 100644 index 00000000000..97478f0df89 --- /dev/null +++ b/.github/workflows/callable-canary-sampleapp-tests.yml @@ -0,0 +1,222 @@ +name: 'Canary Sample App Tests' + +on: + workflow_call: + inputs: + amplifyjs_dir: + required: false + type: boolean + default: true + +env: + AMPLIFY_DIR: /home/runner/work/amplify-js/amplify-js/amplify-js + CYPRESS_GOOGLE_CLIENTID: ${{ secrets.CYPRESS_GOOGLE_CLIENTID }} + CYPRESS_GOOGLE_CLIENT_SECRET: ${{ secrets.CYPRESS_GOOGLE_CLIENT_SECRET }} + CYPRESS_GOOGLE_REFRESH_TOKEN: ${{ secrets.CYPRESS_GOOGLE_REFRESH_TOKEN }} + +jobs: + build_apps: + name: Build Sample App Tests + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@24cb9080177205b6e8c946b17badbe402adc938f # v3.4.0 https://github.com/actions/checkout/commit/24cb9080177205b6e8c946b17badbe402adc938f + with: + # Minimal depth 2 so we can checkout the commit before possible merge commit. + fetch-depth: 2 + path: amplify-js + - name: Setup samples staging repository + uses: ./amplify-js/.github/actions/setup-samples-staging + with: + GH_TOKEN_STAGING_READ: ${{ secrets.GH_TOKEN_STAGING_READ }} + - name: Setup node and build the repository + uses: ./amplify-js/.github/actions/node-and-build + + # React + - name: Create react application + run: npx create-react-app new-react-app + working-directory: amplify-js-samples-staging/samples/react/auth + - name: Remove existing src folder + run: rm -rf src + working-directory: amplify-js-samples-staging/samples/react/auth/new-react-app + - name: Copy files from samples staging repo + run: | + cp -R ./samples/react/auth/credentials-auth/src ./samples/react/auth/new-react-app + cp ./samples/react/auth/credentials-auth/package.json ./samples/react/auth/new-react-app/package.json + working-directory: amplify-js-samples-staging + - name: Copy test file from samples staging repo + run: | + cp credentials-auth.spec.js new-react-app.spec.js + working-directory: amplify-js-samples-staging/cypress/integration/auth + - name: Install amplify + run: npm install amplify + working-directory: amplify-js-samples-staging/samples/react/auth/new-react-app + - name: Start new application and run test + run: | + ../amplify-js/.circleci/retry-yarn-script.sh -s \ + "ci:test \ + react \ + auth \ + new-react-app \ + new-react-app \ + chrome \ + dev" \ + -n 3 + working-directory: amplify-js-samples-staging + shell: bash + + # Angular + - name: Install angular CLI + run: npm install -g @angular/cli + - name: Create angular application + run: npx -p @angular/cli ng new new-angular-app + working-directory: amplify-js-samples-staging/samples/angular/interactions + - name: Remove existing src folder + run: rm -rf src + working-directory: amplify-js-samples-staging/samples/angular/interactions/new-angular-app + - name: Copy files from samples staging repo + run: | + rm -r ./samples/angular/interactions/new-angular-app + cp -r ./samples/angular/interactions/chatbot-component ./samples/angular/interactions/new-angular-app + working-directory: amplify-js-samples-staging + - name: Copy test file from samples staging repo + run: | + cp chatbot-component.spec.js new-angular-app.spec.js + working-directory: amplify-js-samples-staging/cypress/integration/interactions + - name: Install dependencies + run: npm install --save --legacy-peer-deps + working-directory: amplify-js-samples-staging/samples/angular/interactions/new-angular-app + - name: Install amplify + run: | + npm install -g npm@latest + npm install aws-amplify -legacy-peer-deps + working-directory: amplify-js-samples-staging/samples/angular/interactions/new-angular-app + - name: Start application and run test + run: | + ../amplify-js/.circleci/retry-yarn-script.sh -s \ + "ci:test \ + angular \ + interactions \ + new-angular-app \ + new-angular-app \ + chrome \ + dev" \ + -n 3 + working-directory: amplify-js-samples-staging + shell: bash + + # Next + - name: Create next application + run: npx create-next-app new-next-app --no-app + working-directory: amplify-js-samples-staging/samples/next/auth + - name: Remove existing src folder + run: rm -rf src + working-directory: amplify-js-samples-staging/samples/next/auth/new-next-app + - name: Copy files from samples staging repo + run: | + rm -r ./samples/next/auth/new-next-app + cp -r ./samples/next/auth/auth-rsc ./samples/next/auth/new-next-app + working-directory: amplify-js-samples-staging + - name: Copy test file from samples staging repo + run: | + cp auth-rsc.spec.js new-next-app.spec.js + working-directory: amplify-js-samples-staging/cypress/integration/auth + - name: Install dependencies + run: npm install + working-directory: amplify-js-samples-staging/samples/next/auth/new-next-app + - name: Install amplify + run: | + npm install -g npm@latest + npm install aws-amplify -legacy-peer-deps + working-directory: amplify-js-samples-staging/samples/next/auth/new-next-app + - name: Start application and run test + run: | + ../amplify-js/.circleci/retry-yarn-script.sh -s \ + "ci:test \ + next \ + auth \ + new-next-app \ + new-next-app \ + chrome \ + dev" \ + -n 3 + working-directory: amplify-js-samples-staging + shell: bash + + # Vue + - name: Create Vue application + run: | + npm init vue@3 + working-directory: amplify-js-samples-staging/samples/vue/auth + - name: Copy files from samples staging repo + run: | + cp -r ./samples/vue/auth/authenticator-vue3 ./samples/vue/auth/new-vue-app + working-directory: amplify-js-samples-staging + - name: Copy test file from samples staging repo + run: | + cp new-ui-authenticator.spec.js new-vue-app.spec.js + working-directory: amplify-js-samples-staging/cypress/integration/auth + - name: Install amplify + run: | + npm install -g npm@latest + npm install aws-amplify -legacy-peer-deps + working-directory: amplify-js-samples-staging/samples/vue/auth/new-vue-app + - name: Install dependencies + run: npm install --save --legacy-peer-deps + working-directory: amplify-js-samples-staging/samples/vue/auth/new-vue-app + - name: Start application and run test + run: | + ../amplify-js/.circleci/retry-yarn-script.sh -s \ + "ci:test \ + vue \ + auth \ + new-vue-app \ + new-vue-app \ + chrome \ + dev" \ + -n 3 + working-directory: amplify-js-samples-staging + shell: bash + + # Javascript + - name: Create javascript application + run: | + mkdir -p new-javascript-app/src && cd new-javascript-app + touch index.html src/app.js webpack.config.js + working-directory: amplify-js-samples-staging/samples/javascript/auth + - name: Install amplify + run: | + npm install -g npm@latest + npm install aws-amplify -legacy-peer-deps + working-directory: amplify-js-samples-staging/samples/javascript/auth/new-javascript-app + - name: Remove existing src folder + run: rm -rf src + working-directory: amplify-js-samples-staging/samples/javascript/auth/new-javascript-app + - name: Copy files from samples staging repo + run: | + rm -r ./samples/javascript/auth/new-javascript-app + cp -r ./samples/javascript/auth/auth-cdn ./samples/javascript/auth/new-javascript-app + working-directory: amplify-js-samples-staging + - name: Copy test file from samples staging repo + run: | + cp auth-cdn.spec.js new-javascript-app.spec.js + working-directory: amplify-js-samples-staging/cypress/integration/auth + - name: Install dependencies + run: npm install --save --legacy-peer-deps + working-directory: amplify-js-samples-staging/samples/javascript/auth/new-javascript-app + - name: Start application and run test + env: + AMPLIFY_DIR: ${{ env.AMPLIFY_DIR }} + run: | + ../amplify-js/.circleci/retry-yarn-script.sh -s \ + "ci:test \ + javascript \ + auth \ + new-javascript-app \ + new-javascript-app \ + chrome \ + dev \ + $AMPLIFY_DIR" \ + -n 3 + working-directory: amplify-js-samples-staging + shell: bash \ No newline at end of file diff --git a/.github/workflows/on-schedule-canary-test.yml b/.github/workflows/on-schedule-canary-test.yml new file mode 100644 index 00000000000..9e9758281dd --- /dev/null +++ b/.github/workflows/on-schedule-canary-test.yml @@ -0,0 +1,10 @@ +on: + pull_request: + # Tests scheduled for every 1 hour + schedule: + - cron: '0 */1 * * *' + +jobs: + canaries: + secrets: inherit + uses: ./.github/workflows/callable-canary-e2e.yml