Skip to content

Commit

Permalink
Add ios ui tests to the workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Robert-SD committed Dec 20, 2024
1 parent 5e0fe4b commit 765bf55
Show file tree
Hide file tree
Showing 3 changed files with 76 additions and 46 deletions.
56 changes: 13 additions & 43 deletions .github/workflows/ios_tests.yml
Original file line number Diff line number Diff line change
@@ -1,53 +1,23 @@
name: Swift unit tests
name: iOS tests

on:
workflow_call:
inputs:
flutter-version:
description: 'Flutter version'
required: true
default: '3.16.2'
default: '3.24.0'
type: string

jobs:
ios_tests:
runs-on: macos-13
defaults:
run:
working-directory: example/ios
timeout-minutes: 30

steps:
- uses: actions/checkout@v4

- uses: subosito/flutter-action@v2
with:
flutter-version: ${{ inputs.flutter-version }}
channel: 'stable'
cache: true

- run: flutter doctor -v
- run: flutter clean
- run: flutter pub get

- name: Pod install
run: pod install

- name: Lint check
working-directory: ios
run: swiftlint --config .swiftlint.yml --output "swiftLintReport.json"

- name: Cache iOS reports
uses: actions/cache/save@v4
id: save-iOS-reports
with:
path: ios/
key: ios-reports

- name: Run ios unit tests
run: |
xcodebuild test \
-workspace Runner.xcworkspace \
-scheme Runner \
-destination "platform=iOS Simulator,name=iPhone 14" \
-enableCodeCoverage YES | xcpretty --utf --color && exit ${PIPESTATUS[0]}
ios_unit_tests:
name: iOS unit tests
uses: ./.github/workflows/ios_unit_tests.yml
with:
flutter-version: ${{ needs.preparation.outputs.FLUTTER_VERSION }}
android_ui_tests:
name: iOS ui tests
uses: ./.github/workflows/ios_ui_tests.yml
with:
flutter-version: ${{ needs.preparation.outputs.FLUTTER_VERSION }}
secrets: inherit
13 changes: 10 additions & 3 deletions .github/workflows/ios_ui_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ name: iOS ui tests
on:
workflow_dispatch:
workflow_call:
inputs:
flutter-version:
description: 'Flutter version'
required: true
default: '3.24.0'
type: string

jobs:
ios_ui_tests:
Expand All @@ -19,12 +25,13 @@ jobs:

- uses: subosito/flutter-action@v2
with:
flutter-version: '3.24.0'
flutter-version: ${{ inputs.flutter-version }}
channel: 'stable'
cache: true
cache-key: ${{ env.FLUTTER_VERSION }}

- run: flutter pub get
- run: dart pub global activate patrol_cli
- run: patrol doctor
- run: open -a Simulator && xcrun simctl boot 'iPhone 15'
# TODO Add github environment values
# - run: patrol test -t example/integration_test/drop_in_test/open_drop_in_test.dart -d 'iPhone 15'
- run: patrol test -t example/integration_test/drop_in_test/open_drop_in_test.dart --dart-define=CLIENT_KEY='${{ secrets.ADYEN_TEST_CLIENT_KEY }}' --dart-define=X_API_KEY='${{ secrets.ADYEN_TEST_X_API_KEY }}' -d 'iPhone 15'
53 changes: 53 additions & 0 deletions .github/workflows/ios_unit_tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: iOS unit tests

on:
workflow_call:
inputs:
flutter-version:
description: 'Flutter version'
required: true
default: '3.24.0'
type: string

jobs:
ios_tests:
runs-on: macos-13
defaults:
run:
working-directory: example/ios
timeout-minutes: 30

steps:
- uses: actions/checkout@v4

- uses: subosito/flutter-action@v2
with:
flutter-version: ${{ inputs.flutter-version }}
channel: 'stable'
cache: true

- run: flutter doctor -v
- run: flutter clean
- run: flutter pub get

- name: Pod install
run: pod install

- name: Lint check
working-directory: ios
run: swiftlint --config .swiftlint.yml --output "swiftLintReport.json"

- name: Cache iOS reports
uses: actions/cache/save@v4
id: save-iOS-reports
with:
path: ios/
key: ios-reports

- name: Run ios unit tests
run: |
xcodebuild test \
-workspace Runner.xcworkspace \
-scheme Runner \
-destination "platform=iOS Simulator,name=iPhone 14" \
-enableCodeCoverage YES | xcpretty --utf --color && exit ${PIPESTATUS[0]}

0 comments on commit 765bf55

Please sign in to comment.