Skip to content

Commit

Permalink
feat(aft): Split e2e workflows
Browse files Browse the repository at this point in the history
- Adds E2E workflows to `aft generate workflows`
- Removes mono-workflow for E2E tests
- Splits E2E workflows such that they run only when necessary
- Adds concurrency settings to all workflows
  • Loading branch information
Dillon Nys committed Aug 30, 2023
1 parent dec7fa7 commit 0b2758a
Show file tree
Hide file tree
Showing 92 changed files with 2,348 additions and 738 deletions.
1 change: 1 addition & 0 deletions .github/dependabot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ updates:
- dependency-name: "*"
update-types:
- "version-update:semver-patch"
- dependency-name: "aws_common"
- dependency-name: "amplify_lints"
- package-ecosystem: "pub"
directory: "canaries"
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/amplify_analytics_pinpoint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,15 @@ on:
defaults:
run:
shell: bash

permissions: read-all

# Cancels in-progress job when there is another push to same ref.
# https://docs.github.com/en/actions/using-jobs/using-concurrency#example-only-cancel-in-progress-jobs-or-runs-for-the-current-workflow
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
test:
uses: ./.github/workflows/flutter_vm.yaml
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,25 @@ on:
- 'packages/analytics/amplify_analytics_pinpoint/**/*.yaml'
- 'packages/analytics/amplify_analytics_pinpoint/android/**/*'
- 'packages/analytics/amplify_analytics_pinpoint/example/android/**/*'
- '.github/workflows/flutter_android.build.yaml'
- '.github/workflows/amplify_analytics_pinpoint.android.yaml'
- '.github/workflows/flutter_android.yaml'
- '.github/workflows/amplify_analytics_pinpoint_android.yaml'
schedule:
- cron: "0 0 * * 0" # Every Sunday at 00:00
defaults:
run:
shell: bash
permissions: read-all

# Cancels in-progress job when there is another push to same ref.
# https://docs.github.com/en/actions/using-jobs/using-concurrency#example-only-cancel-in-progress-jobs-or-runs-for-the-current-workflow
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
test:
uses: ./.github/workflows/flutter_android.build.yaml
android:
uses: ./.github/workflows/flutter_android.yaml
with:
working-directory: packages/analytics/amplify_analytics_pinpoint/example
example-directory: packages/analytics/amplify_analytics_pinpoint/example
package-name: amplify_analytics_pinpoint
has-native-tests: false
7 changes: 7 additions & 0 deletions .github/workflows/amplify_analytics_pinpoint_dart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,15 @@ on:
defaults:
run:
shell: bash

permissions: read-all

# Cancels in-progress job when there is another push to same ref.
# https://docs.github.com/en/actions/using-jobs/using-concurrency#example-only-cancel-in-progress-jobs-or-runs-for-the-current-workflow
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
test:
uses: ./.github/workflows/dart_vm.yaml
Expand Down
111 changes: 111 additions & 0 deletions .github/workflows/amplify_analytics_pinpoint_example.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
# Generated with aft. To update, run: `aft generate workflows`
name: amplify_analytics_pinpoint_example
on:
push:
branches:
- main
- stable
pull_request:
paths:
- '.github/workflows/amplify_analytics_pinpoint_example.yaml'
- '.github/workflows/e2e_android.yaml'
- '.github/workflows/e2e_ios.yaml'
- '.github/workflows/e2e_linux.yaml'
- '.github/workflows/e2e_web.yaml'
- '.github/workflows/e2e_windows.yaml'
- '.github/workflows/flutter_vm.yaml'
- 'packages/amplify_core/lib/**/*.dart'
- 'packages/amplify_core/pubspec.yaml'
- 'packages/amplify_lints/lib/**/*.yaml'
- 'packages/amplify_lints/pubspec.yaml'
- 'packages/analytics/amplify_analytics_pinpoint/example/**/*.dart'
- 'packages/analytics/amplify_analytics_pinpoint/example/**/*.yaml'
- 'packages/analytics/amplify_analytics_pinpoint/example/lib/**/*'
- 'packages/analytics/amplify_analytics_pinpoint/example/test/**/*'
- 'packages/analytics/amplify_analytics_pinpoint/lib/**/*.dart'
- 'packages/analytics/amplify_analytics_pinpoint/pubspec.yaml'
- 'packages/analytics/amplify_analytics_pinpoint_dart/lib/**/*.dart'
- 'packages/analytics/amplify_analytics_pinpoint_dart/pubspec.yaml'
- 'packages/aws_common/lib/**/*.dart'
- 'packages/aws_common/pubspec.yaml'
- 'packages/aws_signature_v4/lib/**/*.dart'
- 'packages/aws_signature_v4/pubspec.yaml'
- 'packages/common/amplify_db_common/lib/**/*.dart'
- 'packages/common/amplify_db_common/pubspec.yaml'
- 'packages/common/amplify_db_common_dart/lib/**/*.dart'
- 'packages/common/amplify_db_common_dart/pubspec.yaml'
- 'packages/secure_storage/amplify_secure_storage/lib/**/*.dart'
- 'packages/secure_storage/amplify_secure_storage/pubspec.yaml'
- 'packages/secure_storage/amplify_secure_storage_dart/lib/**/*.dart'
- 'packages/secure_storage/amplify_secure_storage_dart/pubspec.yaml'
- 'packages/smithy/smithy/lib/**/*.dart'
- 'packages/smithy/smithy/pubspec.yaml'
- 'packages/smithy/smithy_aws/lib/**/*.dart'
- 'packages/smithy/smithy_aws/pubspec.yaml'
- 'packages/worker_bee/worker_bee/lib/**/*.dart'
- 'packages/worker_bee/worker_bee/pubspec.yaml'
- 'packages/worker_bee/worker_bee_builder/lib/**/*.dart'
- 'packages/worker_bee/worker_bee_builder/pubspec.yaml'
schedule:
- cron: "0 0 * * 0" # Every Sunday at 00:00
defaults:
run:
shell: bash

# These permissions are needed to interact with GitHub's OIDC Token endpoint.
permissions:
id-token: write
contents: read

# Cancels in-progress job when there is another push to same ref.
# https://docs.github.com/en/actions/using-jobs/using-concurrency#example-only-cancel-in-progress-jobs-or-runs-for-the-current-workflow
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
test:
uses: ./.github/workflows/flutter_vm.yaml
with:
package-name: amplify_analytics_pinpoint_example
working-directory: packages/analytics/amplify_analytics_pinpoint/example
e2e_android_test:
needs: [test]
uses: ./.github/workflows/e2e_android.yaml
secrets: inherit
with:
package-name: amplify_analytics_pinpoint_example
working-directory: packages/analytics/amplify_analytics_pinpoint/example
needs-aws-config: true
e2e_ios_test:
needs: [test]
uses: ./.github/workflows/e2e_ios.yaml
secrets: inherit
with:
package-name: amplify_analytics_pinpoint_example
working-directory: packages/analytics/amplify_analytics_pinpoint/example
needs-aws-config: true
e2e_web_test:
needs: [test]
uses: ./.github/workflows/e2e_web.yaml
secrets: inherit
with:
package-name: amplify_analytics_pinpoint_example
working-directory: packages/analytics/amplify_analytics_pinpoint/example
needs-aws-config: true
e2e_linux_test:
needs: [test]
uses: ./.github/workflows/e2e_linux.yaml
secrets: inherit
with:
package-name: amplify_analytics_pinpoint_example
working-directory: packages/analytics/amplify_analytics_pinpoint/example
needs-aws-config: true
e2e_windows_test:
needs: [test]
uses: ./.github/workflows/e2e_windows.yaml
secrets: inherit
with:
package-name: amplify_analytics_pinpoint_example
working-directory: packages/analytics/amplify_analytics_pinpoint/example
needs-aws-config: true
7 changes: 7 additions & 0 deletions .github/workflows/amplify_api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,15 @@ on:
defaults:
run:
shell: bash

permissions: read-all

# Cancels in-progress job when there is another push to same ref.
# https://docs.github.com/en/actions/using-jobs/using-concurrency#example-only-cancel-in-progress-jobs-or-runs-for-the-current-workflow
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
test:
uses: ./.github/workflows/flutter_vm.yaml
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/amplify_api_dart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,15 @@ on:
defaults:
run:
shell: bash

permissions: read-all

# Cancels in-progress job when there is another push to same ref.
# https://docs.github.com/en/actions/using-jobs/using-concurrency#example-only-cancel-in-progress-jobs-or-runs-for-the-current-workflow
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
test:
uses: ./.github/workflows/dart_vm.yaml
Expand Down
105 changes: 105 additions & 0 deletions .github/workflows/amplify_api_example.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
# Generated with aft. To update, run: `aft generate workflows`
name: amplify_api_example
on:
push:
branches:
- main
- stable
pull_request:
paths:
- '.github/workflows/amplify_api_example.yaml'
- '.github/workflows/e2e_android.yaml'
- '.github/workflows/e2e_ios.yaml'
- '.github/workflows/e2e_linux.yaml'
- '.github/workflows/e2e_web.yaml'
- '.github/workflows/e2e_windows.yaml'
- '.github/workflows/flutter_vm.yaml'
- 'packages/amplify/amplify_flutter/lib/**/*.dart'
- 'packages/amplify/amplify_flutter/pubspec.yaml'
- 'packages/amplify_core/lib/**/*.dart'
- 'packages/amplify_core/pubspec.yaml'
- 'packages/amplify_lints/lib/**/*.yaml'
- 'packages/amplify_lints/pubspec.yaml'
- 'packages/api/amplify_api/example/**/*.dart'
- 'packages/api/amplify_api/example/**/*.yaml'
- 'packages/api/amplify_api/example/lib/**/*'
- 'packages/api/amplify_api/example/test/**/*'
- 'packages/api/amplify_api/lib/**/*.dart'
- 'packages/api/amplify_api/pubspec.yaml'
- 'packages/api/amplify_api_dart/lib/**/*.dart'
- 'packages/api/amplify_api_dart/pubspec.yaml'
- 'packages/aws_common/lib/**/*.dart'
- 'packages/aws_common/pubspec.yaml'
- 'packages/aws_signature_v4/lib/**/*.dart'
- 'packages/aws_signature_v4/pubspec.yaml'
- 'packages/secure_storage/amplify_secure_storage/lib/**/*.dart'
- 'packages/secure_storage/amplify_secure_storage/pubspec.yaml'
- 'packages/secure_storage/amplify_secure_storage_dart/lib/**/*.dart'
- 'packages/secure_storage/amplify_secure_storage_dart/pubspec.yaml'
- 'packages/worker_bee/worker_bee/lib/**/*.dart'
- 'packages/worker_bee/worker_bee/pubspec.yaml'
- 'packages/worker_bee/worker_bee_builder/lib/**/*.dart'
- 'packages/worker_bee/worker_bee_builder/pubspec.yaml'
schedule:
- cron: "0 0 * * 0" # Every Sunday at 00:00
defaults:
run:
shell: bash

# These permissions are needed to interact with GitHub's OIDC Token endpoint.
permissions:
id-token: write
contents: read

# Cancels in-progress job when there is another push to same ref.
# https://docs.github.com/en/actions/using-jobs/using-concurrency#example-only-cancel-in-progress-jobs-or-runs-for-the-current-workflow
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
test:
uses: ./.github/workflows/flutter_vm.yaml
with:
package-name: amplify_api_example
working-directory: packages/api/amplify_api/example
e2e_android_test:
needs: [test]
uses: ./.github/workflows/e2e_android.yaml
secrets: inherit
with:
package-name: amplify_api_example
working-directory: packages/api/amplify_api/example
needs-aws-config: true
e2e_ios_test:
needs: [test]
uses: ./.github/workflows/e2e_ios.yaml
secrets: inherit
with:
package-name: amplify_api_example
working-directory: packages/api/amplify_api/example
needs-aws-config: true
e2e_web_test:
needs: [test]
uses: ./.github/workflows/e2e_web.yaml
secrets: inherit
with:
package-name: amplify_api_example
working-directory: packages/api/amplify_api/example
needs-aws-config: true
e2e_linux_test:
needs: [test]
uses: ./.github/workflows/e2e_linux.yaml
secrets: inherit
with:
package-name: amplify_api_example
working-directory: packages/api/amplify_api/example
needs-aws-config: true
e2e_windows_test:
needs: [test]
uses: ./.github/workflows/e2e_windows.yaml
secrets: inherit
with:
package-name: amplify_api_example
working-directory: packages/api/amplify_api/example
needs-aws-config: true
28 changes: 0 additions & 28 deletions .github/workflows/amplify_auth_cognito.android.yaml

This file was deleted.

7 changes: 7 additions & 0 deletions .github/workflows/amplify_auth_cognito.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,15 @@ on:
defaults:
run:
shell: bash

permissions: read-all

# Cancels in-progress job when there is another push to same ref.
# https://docs.github.com/en/actions/using-jobs/using-concurrency#example-only-cancel-in-progress-jobs-or-runs-for-the-current-workflow
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
test:
uses: ./.github/workflows/flutter_vm.yaml
Expand Down
Loading

0 comments on commit 0b2758a

Please sign in to comment.