From 466922dec3eb8eed6090b534626aa77ac4acde1f Mon Sep 17 00:00:00 2001 From: Robert Schulze Dieckhoff Date: Mon, 7 Oct 2024 17:21:14 +0200 Subject: [PATCH] Added ui tests to CI --- .github/workflows/android_tests.yml | 57 +++++------------------ .github/workflows/android_ui_tests.yml | 11 ++++- .github/workflows/android_unit_tests.yml | 58 ++++++++++++++++++++++++ .github/workflows/check_pr.yml | 7 ++- 4 files changed, 84 insertions(+), 49 deletions(-) create mode 100644 .github/workflows/android_unit_tests.yml diff --git a/.github/workflows/android_tests.yml b/.github/workflows/android_tests.yml index b20e89a0..bb972693 100644 --- a/.github/workflows/android_tests.yml +++ b/.github/workflows/android_tests.yml @@ -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 \ No newline at end of file + 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 }} \ No newline at end of file diff --git a/.github/workflows/android_ui_tests.yml b/.github/workflows/android_ui_tests.yml index c6c444c6..0df9dd27 100644 --- a/.github/workflows/android_ui_tests.yml +++ b/.github/workflows/android_ui_tests.yml @@ -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: @@ -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 diff --git a/.github/workflows/android_unit_tests.yml b/.github/workflows/android_unit_tests.yml new file mode 100644 index 00000000..73aa03fe --- /dev/null +++ b/.github/workflows/android_unit_tests.yml @@ -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 \ No newline at end of file diff --git a/.github/workflows/check_pr.yml b/.github/workflows/check_pr.yml index 6be9eba3..00ab7f96 100644 --- a/.github/workflows/check_pr.yml +++ b/.github/workflows/check_pr.yml @@ -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