Skip to content

Commit 712b60c

Browse files
Travis Shepparddnys1
authored andcommitted
chore: migrate iOS unit tests to GH actions (#2749)
1 parent 29b9341 commit 712b60c

File tree

6 files changed

+173
-0
lines changed

6 files changed

+173
-0
lines changed
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: amplify_analytics_pinpoint iOS
2+
on:
3+
push:
4+
branches:
5+
- main
6+
- stable
7+
pull_request:
8+
paths:
9+
- 'packages/analytics/amplify_analytics_pinpoint/**/*.yaml'
10+
- 'packages/analytics/amplify_analytics_pinpoint/ios/**/*'
11+
- 'packages/analytics/amplify_analytics_pinpoint/example/ios/unit_tests/**/*'
12+
- 'packages/analytics/amplify_analytics_pinpoint_ios/**/*'
13+
- '.github/workflows/flutter_ios.yaml'
14+
- '.github/workflows/amplify_analytics_pinpoint.ios.yaml'
15+
schedule:
16+
- cron: "0 0 * * 0" # Every Sunday at 00:00
17+
defaults:
18+
run:
19+
shell: bash
20+
permissions: read-all
21+
22+
jobs:
23+
test:
24+
uses: ./.github/workflows/flutter_ios.yaml
25+
with:
26+
working-directory: packages/analytics/amplify_analytics_pinpoint_ios/example/ios
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: amplify_api iOS
2+
on:
3+
push:
4+
branches:
5+
- main
6+
- stable
7+
pull_request:
8+
paths:
9+
- 'packages/api/amplify_api/**/*.yaml'
10+
- 'packages/api/amplify_api/ios/**/*'
11+
- 'packages/api/amplify_api/example/ios/unit_tests/**/*'
12+
- 'packages/api/amplify_api_ios/**/*'
13+
- '.github/workflows/flutter_ios.yaml'
14+
- '.github/workflows/amplify_api.ios.yaml'
15+
schedule:
16+
- cron: "0 0 * * 0" # Every Sunday at 00:00
17+
defaults:
18+
run:
19+
shell: bash
20+
permissions: read-all
21+
22+
jobs:
23+
test:
24+
uses: ./.github/workflows/flutter_ios.yaml
25+
with:
26+
working-directory: packages/api/amplify_api_ios/example/ios
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: amplify_auth_cognito iOS
2+
on:
3+
push:
4+
branches:
5+
- main
6+
- stable
7+
pull_request:
8+
paths:
9+
- 'packages/auth/amplify_auth_cognito/**/*.yaml'
10+
- 'packages/auth/amplify_auth_cognito/ios/**/*'
11+
- 'packages/auth/amplify_auth_cognito/example/ios/unit_tests/**/*'
12+
- 'packages/auth/amplify_auth_cognito_ios/**/*'
13+
- '.github/workflows/flutter_ios.yaml'
14+
- '.github/workflows/amplify_auth_cognito.ios.yaml'
15+
schedule:
16+
- cron: "0 0 * * 0" # Every Sunday at 00:00
17+
defaults:
18+
run:
19+
shell: bash
20+
permissions: read-all
21+
22+
jobs:
23+
test:
24+
uses: ./.github/workflows/flutter_ios.yaml
25+
with:
26+
working-directory: packages/auth/amplify_auth_cognito_ios/example/ios
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: amplify_datastore iOS
2+
on:
3+
push:
4+
branches:
5+
- main
6+
- stable
7+
pull_request:
8+
paths:
9+
- 'packages/amplify_datastore/**/*.yaml'
10+
- 'packages/amplify_datastore/ios/**/*'
11+
- 'packages/amplify_datastore/example/ios/unit_tests/**/*'
12+
- '.github/workflows/flutter_ios.yaml'
13+
- '.github/workflows/amplify_datastore.ios.yaml'
14+
schedule:
15+
- cron: "0 0 * * 0" # Every Sunday at 00:00
16+
defaults:
17+
run:
18+
shell: bash
19+
permissions: read-all
20+
21+
jobs:
22+
test:
23+
uses: ./.github/workflows/flutter_ios.yaml
24+
with:
25+
working-directory: packages/amplify_datastore/example/ios
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: amplify_flutter iOS
2+
on:
3+
push:
4+
branches:
5+
- main
6+
- stable
7+
pull_request:
8+
paths:
9+
- 'packages/amplify/amplify_flutter/**/*.yaml'
10+
- 'packages/amplify/amplify_flutter/ios/**/*'
11+
- 'packages/amplify/amplify_flutter/example/ios/unit_tests/**/*'
12+
- 'packages/amplify/amplify_flutter_ios/**/*'
13+
- '.github/workflows/flutter_ios.yaml'
14+
- '.github/workflows/amplify_flutter.ios.yaml'
15+
schedule:
16+
- cron: "0 0 * * 0" # Every Sunday at 00:00
17+
defaults:
18+
run:
19+
shell: bash
20+
permissions: read-all
21+
22+
jobs:
23+
test:
24+
uses: ./.github/workflows/flutter_ios.yaml
25+
with:
26+
working-directory: packages/amplify/amplify_flutter_ios/example/ios

.github/workflows/flutter_ios.yaml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Flutter iOS
2+
on:
3+
workflow_call:
4+
inputs:
5+
working-directory:
6+
description: The working directory relative to the repo root
7+
required: true
8+
type: string
9+
10+
# Cancels in-progress job when there is another push to same ref.
11+
concurrency:
12+
group: ${{ github.workflow }}-${{ github.ref }}
13+
cancel-in-progress: true
14+
15+
jobs:
16+
test:
17+
name: Test
18+
runs-on: macos-latest
19+
timeout-minutes: 60
20+
steps:
21+
- name: Git Checkout
22+
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # 3.1.0
23+
24+
- name: Setup Flutter
25+
uses: subosito/flutter-action@dbf1fa04f4d2e52c33185153d06cdb5443aa189d # 2.8.0
26+
with:
27+
cache: true
28+
29+
- name: Install Melos and Bootstrap
30+
timeout-minutes: 20 # mac needs more time
31+
run: |
32+
flutter pub global activate melos 1.3.0
33+
melos bootstrap
34+
35+
- name: Run iOS unit tests
36+
run: |
37+
set -o pipefail
38+
flutter build ios --simulator
39+
XCODEBUILD_DESTINATION="platform=iOS Simulator,name=iPhone 14 Pro Max,OS=latest"
40+
xcodebuild test \
41+
-workspace Runner.xcworkspace \
42+
-scheme Runner \
43+
-destination "$XCODEBUILD_DESTINATION" | xcpretty
44+
working-directory: ${{ inputs.working-directory }}

0 commit comments

Comments
 (0)