Skip to content

Commit

Permalink
Added ui tests to CI
Browse files Browse the repository at this point in the history
  • Loading branch information
Robert-SD committed Oct 7, 2024
1 parent 37bf005 commit 466922d
Show file tree
Hide file tree
Showing 4 changed files with 84 additions and 49 deletions.
57 changes: 11 additions & 46 deletions .github/workflows/android_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,52 +6,17 @@ on:
flutter-version:
description: 'Flutter version'
required: true
default: '3.16.2'
default: '3.24.0'
type: string

jobs:
android_tests:
runs-on: ubuntu-22.04
defaults:
run:
working-directory: example/android
timeout-minutes: 30

steps:
- uses: actions/checkout@v4

- uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: 18

- 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: Setup Gradle
uses: gradle/gradle-build-action@v2
with:
gradle-version: wrapper

- name: Init gradle wrapper
run: gradle wrapper

- name: Lint check
run: ./gradlew ktlintCheck lintReportDebug

- name: Unit tests with code coverage reporting
run: ./gradlew jacocoTestReport

- name: Cache android reports
uses: actions/cache/save@v4
id: save-android-reports
with:
path: example/build/adyen_checkout/reports
key: android-reports
android_unit_tests:
name: Android unit tests
uses: ./.github/workflows/android_unit_tests.yml
with:
flutter-version: ${{ needs.preparation.outputs.FLUTTER_VERSION }}
android_ui_tests:
name: Android ui tests
uses: ./.github/workflows/android_ui_tests.yml
with:
flutter-version: ${{ needs.preparation.outputs.FLUTTER_VERSION }}
11 changes: 9 additions & 2 deletions .github/workflows/android_ui_tests.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
name: Android ui tests

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

jobs:
android_ui_tests:
Expand Down Expand Up @@ -32,8 +37,10 @@ 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 3.1.1
Expand Down
58 changes: 58 additions & 0 deletions .github/workflows/android_unit_tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Android unit tests

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

jobs:
android_tests:
runs-on: ubuntu-22.04
defaults:
run:
working-directory: example/android
timeout-minutes: 30

steps:
- uses: actions/checkout@v4

- uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: 18

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

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

- name: Setup Gradle
uses: gradle/gradle-build-action@v2
with:
gradle-version: wrapper

- name: Init gradle wrapper
run: gradle wrapper

- name: Lint check
run: ./gradlew ktlintCheck lintReportDebug

- name: Unit tests with code coverage reporting
run: ./gradlew jacocoTestReport

- name: Cache android reports
uses: actions/cache/save@v4
id: save-android-reports
with:
path: example/build/adyen_checkout/reports
key: android-reports
7 changes: 6 additions & 1 deletion .github/workflows/check_pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,12 @@ jobs:
outputs:
FLUTTER_VERSION: ${{ env.FLUTTER_VERSION }}
steps:
- run: echo ""
- uses: subosito/flutter-action@v2
with:
flutter-version: ${{ env.FLUTTER_VERSION }}
channel: 'stable'
cache: true
cache-key: ${{ env.FLUTTER_VERSION }}

test_flutter:
name: Flutter tests
Expand Down

0 comments on commit 466922d

Please sign in to comment.