Skip to content

replaced AmplifyLogger with AWSLoggerMixin instead. #2433

replaced AmplifyLogger with AWSLoggerMixin instead.

replaced AmplifyLogger with AWSLoggerMixin instead. #2433

name: Amplify Integration Tests
on:
push:
branches:
- main
- stable
- feat/**
- fix/**
- test/**
pull_request:
paths:
- ".github/workflows/amplify_integration_tests.yaml"
schedule:
# 6am pacific time daily, only runs on default branch
- cron: "0 13 * * *"
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
android:
runs-on: macos-latest
# These permissions are needed to interact with GitHub's OIDC Token endpoint.
permissions:
id-token: write
contents: read
strategy:
fail-fast: false
matrix:
scope:
- "amplify_analytics_pinpoint_example"
- "amplify_api_example"
- "amplify_authenticator_example"
- "amplify_auth_cognito_example"
- "amplify_datastore_example"
- "amplify_storage_s3_example"
- "amplify_db_common_example"
api-level:
- 25
- 33
target:
- google_apis
include:
- api-level: 25
arch: x86
- api-level: 33
arch: x86_64
steps:
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # 3.5.3
with:
persist-credentials: false
submodules: true
# Flutter requires Java 11 to build android apps with Gradle.
- uses: actions/setup-java@cd89f46ac9d01407894225f350157564c9c7cee2 # 3.12.0
with:
distribution: "corretto" # Amazon Corretto Build of OpenJDK
java-version: "11"
- name: Install dependencies
uses: ./.github/composite_actions/install_dependencies
- name: Pub Upgrade
run: aft exec --include=${{ matrix.scope }} -- flutter pub upgrade
- name: Fetch Amplify backend configurations
uses: ./.github/composite_actions/fetch_backends
with:
role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }}
aws-region: ${{ secrets.AWS_REGION }}
scope: ${{ matrix.scope }}
secret-identifier: ${{ secrets.AWS_SECRET_IDENTIFIER }}
- name: Launch Android emulator
uses: ./.github/composite_actions/launch_android_emulator
# Make the timeout a little longer and add retry due to delay from starting emulator.
timeout-minutes: 90
with:
api-level: ${{ matrix.api-level }}
target: ${{ matrix.target }}
arch: ${{ matrix.arch }}
script: aft exec --include=${{ matrix.scope }} -- small=true "<AFT_ROOT>/build-support/integ_test.sh" -d emulator-5554 --retries 1
ios:
runs-on: macos-latest-xl
# These permissions are needed to interact with GitHub's OIDC Token endpoint.
permissions:
id-token: write
contents: read
strategy:
fail-fast: false
matrix:
scope:
- "amplify_analytics_pinpoint_example"
- "amplify_api_example"
- "amplify_authenticator_example"
- "amplify_auth_cognito_example"
- "amplify_datastore_example"
- "amplify_storage_s3_example"
- "amplify_db_common_example"
steps:
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # 3.5.3
with:
persist-credentials: false
submodules: true
- name: Install dependencies
uses: ./.github/composite_actions/install_dependencies
- name: Launch iOS simulator
uses: ./.github/composite_actions/launch_ios_simulator
timeout-minutes: 20
- name: Pub Upgrade
run: aft exec --include=${{ matrix.scope }} -- flutter pub upgrade
- name: Fetch Amplify backend configurations
uses: ./.github/composite_actions/fetch_backends
with:
role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }}
aws-region: ${{ secrets.AWS_REGION }}
scope: ${{ matrix.scope }}
secret-identifier: ${{ secrets.AWS_SECRET_IDENTIFIER }}
- name: Run integration tests
timeout-minutes: 60
run: aft exec --include=${{ matrix.scope }} -- small=true "<AFT_ROOT>/build-support/integ_test_ios.sh" -d test
web:
runs-on: ubuntu-latest
# These permissions are needed to interact with GitHub's OIDC Token endpoint.
permissions:
id-token: write
contents: read
strategy:
fail-fast: false
matrix:
scope:
- "amplify_analytics_pinpoint_example"
- "amplify_api_example"
# TODO(dnys1): Web UI tests are not currently able to be run in CI
# - "amplify_authenticator_example"
- "amplify_auth_cognito_example"
- "amplify_storage_s3_example"
- "amplify_db_common_example"
steps:
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # 3.5.3
with:
persist-credentials: false
submodules: true
- name: Install dependencies
uses: ./.github/composite_actions/install_dependencies
- name: Pub Upgrade
run: aft exec --include=${{ matrix.scope }} -- flutter pub upgrade
- name: Fetch Amplify backend configurations
uses: ./.github/composite_actions/fetch_backends
with:
role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }}
aws-region: ${{ secrets.AWS_REGION }}
scope: ${{ matrix.scope }}
secret-identifier: ${{ secrets.AWS_SECRET_IDENTIFIER }}
- uses: ./.github/composite_actions/setup_chromedriver
- name: Run integration tests
timeout-minutes: 60
run: |
chromedriver --port=4444 &
aft exec --include=${{ matrix.scope }} -- "<AFT_ROOT>/build-support/integ_test.sh" -d web-server
# TODO(dnys1): Re-enable with self-hosted runners
# macos:
# runs-on: macos-latest
# # These permissions are needed to interact with GitHub's OIDC Token endpoint.
# permissions:
# id-token: write
# contents: read
# strategy:
# fail-fast: false
# matrix:
# scope:
# - "amplify_analytics_pinpoint_example"
# - "amplify_api_example"
# # TODO(dnys1): macOS tests are failing for some reason
# # - "amplify_authenticator_example"
# - "amplify_auth_cognito_example"
# - "amplify_storage_s3_example"
# - "amplify_db_common_example"
# steps:
# - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # 3.5.3
# with:
# persist-credentials: false
# submodules: true
# - name: Install dependencies
# uses: ./.github/composite_actions/install_dependencies
# with:
# channel: stable
# flutter-version: "3.3.10"
# - name: Fetch Amplify backend configurations
# uses: ./.github/composite_actions/fetch_backends
# with:
# role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }}
# aws-region: ${{ secrets.AWS_REGION }}
# scope: ${{ matrix.scope }}
# secret-identifier: ${{ secrets.AWS_SECRET_IDENTIFIER }}
# - name: Run integration tests
# timeout-minutes: 30
# run: |
# flutter config --enable-macos-desktop
# aft exec --include=${{ matrix.scope }} -- "<AFT_ROOT>/build-support/integ_test.sh" -d macos
linux:
runs-on: ubuntu-latest
# These permissions are needed to interact with GitHub's OIDC Token endpoint.
permissions:
id-token: write
contents: read
strategy:
fail-fast: false
matrix:
scope:
- "amplify_analytics_pinpoint_example"
- "amplify_api_example"
- "amplify_authenticator_example"
- "amplify_auth_cognito_example"
- "amplify_storage_s3_example"
- "amplify_db_common_example"
steps:
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # 3.5.3
with:
persist-credentials: false
submodules: true
- name: Install dependencies
uses: ./.github/composite_actions/install_dependencies
- name: Pub Upgrade
run: aft exec --include=${{ matrix.scope }} -- flutter pub upgrade
- name: Fetch Amplify backend configurations
uses: ./.github/composite_actions/fetch_backends
with:
role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }}
aws-region: ${{ secrets.AWS_REGION }}
scope: ${{ matrix.scope }}
secret-identifier: ${{ secrets.AWS_SECRET_IDENTIFIER }}
- name: Run integration tests
timeout-minutes: 60
run: |
flutter config --enable-linux-desktop
aft exec --include=${{ matrix.scope }} -- "<AFT_ROOT>/build-support/integ_test.sh" -d linux
windows:
runs-on: windows-latest
# These permissions are needed to interact with GitHub's OIDC Token endpoint.
permissions:
id-token: write
contents: read
strategy:
fail-fast: false
matrix:
scope:
- "amplify_analytics_pinpoint_example"
- "amplify_api_example"
- "amplify_authenticator_example"
- "amplify_auth_cognito_example"
- "amplify_storage_s3_example"
- "amplify_db_common_example"
steps:
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # 3.5.3
with:
persist-credentials: false
submodules: true
- name: Change path restrictions
run: git config --global core.longpaths true
- name: Install dependencies
uses: ./.github/composite_actions/install_dependencies
- name: Pub Upgrade
run: dart pub global run aft exec --include=${{ matrix.scope }} -- flutter pub upgrade
- name: Fetch Amplify backend configurations
uses: ./.github/composite_actions/fetch_backends
with:
role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }}
aws-region: ${{ secrets.AWS_REGION }}
scope: ${{ matrix.scope }}
secret-identifier: ${{ secrets.AWS_SECRET_IDENTIFIER }}
- name: Run integration tests
timeout-minutes: 60
run: |
flutter config --enable-windows-desktop
dart pub global run aft exec --include=${{ matrix.scope }} -- flutter test integration_test/main_test.dart -d windows