From 124a3d0e6b9cea2c27a9782c04957543a9fbc832 Mon Sep 17 00:00:00 2001 From: corrado4eyes Date: Fri, 30 Jun 2023 13:12:05 +0200 Subject: [PATCH 01/33] Add yml for UI tests --- .github/workflows/ui-tests-check.yml | 43 ++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 .github/workflows/ui-tests-check.yml diff --git a/.github/workflows/ui-tests-check.yml b/.github/workflows/ui-tests-check.yml new file mode 100644 index 0000000..09186f1 --- /dev/null +++ b/.github/workflows/ui-tests-check.yml @@ -0,0 +1,43 @@ +name: ui-tests-check +env: + PR_NUMBER: ${{ github.event.number }} + ACTOR: ${{ github.actor }} +run-name: $ACTOR is running the UI tests check for PR $PR_NUMBER +on: + pull_request: + branches: + - main +jobs: + run-android-ui-tests: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Set up JDK 11 + uses: actions/setup-java@v3 + with: + java-version: '11' + distribution: 'adopt' + + - name: Run Android UI tests + run: ./gradlew :android:connectedCheck + + run-iOS-ui-tests: + env: + WORKING_DIRECTORY: ./ios + runs-on: macos-13 + steps: + - name: Set up JDK 17 + uses: actions/setup-java@v3 + with: + java-version: 17 + distribution: 'adopt' + + - name: Run iOS UI tests + working-directory: $WORKING_DIRECTORY + run: xcodebuild \ + -workspace ios.xcworkspace \ + -scheme ios \ + -sdk iphonesimulator \ + -destination 'platform=iOS Simulator,name=iPhone 12,OS=16.0' \ + test + From 7d92fb026c0697b0e62ba7d1a151edac383075fb Mon Sep 17 00:00:00 2001 From: corrado4eyes Date: Fri, 30 Jun 2023 13:14:27 +0200 Subject: [PATCH 02/33] Fix env variable usage --- .github/workflows/ui-tests-check.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ui-tests-check.yml b/.github/workflows/ui-tests-check.yml index 09186f1..c62c185 100644 --- a/.github/workflows/ui-tests-check.yml +++ b/.github/workflows/ui-tests-check.yml @@ -33,7 +33,7 @@ jobs: distribution: 'adopt' - name: Run iOS UI tests - working-directory: $WORKING_DIRECTORY + working-directory: ${{env.WORKING_DIRECTORY}} run: xcodebuild \ -workspace ios.xcworkspace \ -scheme ios \ From 615a45a2b8ddde17ef290f807e3cdab5f177cfc4 Mon Sep 17 00:00:00 2001 From: corrado4eyes Date: Fri, 30 Jun 2023 13:15:49 +0200 Subject: [PATCH 03/33] Use java 17 --- .github/workflows/ui-tests-check.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ui-tests-check.yml b/.github/workflows/ui-tests-check.yml index c62c185..ff4aec9 100644 --- a/.github/workflows/ui-tests-check.yml +++ b/.github/workflows/ui-tests-check.yml @@ -12,10 +12,10 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - name: Set up JDK 11 + - name: Set up JDK 17 uses: actions/setup-java@v3 with: - java-version: '11' + java-version: '17' distribution: 'adopt' - name: Run Android UI tests From b7f5a7425c886ae1306debaac9b850e68752e802 Mon Sep 17 00:00:00 2001 From: corrado4eyes Date: Fri, 30 Jun 2023 13:16:38 +0200 Subject: [PATCH 04/33] Correct usage of env variable --- .github/workflows/ui-tests-check.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ui-tests-check.yml b/.github/workflows/ui-tests-check.yml index ff4aec9..5fdf075 100644 --- a/.github/workflows/ui-tests-check.yml +++ b/.github/workflows/ui-tests-check.yml @@ -2,7 +2,7 @@ name: ui-tests-check env: PR_NUMBER: ${{ github.event.number }} ACTOR: ${{ github.actor }} -run-name: $ACTOR is running the UI tests check for PR $PR_NUMBER +run-name: ${{ env.ACTOR }} is running the UI tests check for PR ${{env.PR_NUMBER}} on: pull_request: branches: From fae598dd464bf8fb149267927ee6ca1f1ab126ca Mon Sep 17 00:00:00 2001 From: corrado4eyes Date: Fri, 30 Jun 2023 13:21:38 +0200 Subject: [PATCH 05/33] Wrap variable inside string --- .github/workflows/ui-tests-check.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ui-tests-check.yml b/.github/workflows/ui-tests-check.yml index 5fdf075..2f4d0dc 100644 --- a/.github/workflows/ui-tests-check.yml +++ b/.github/workflows/ui-tests-check.yml @@ -2,7 +2,7 @@ name: ui-tests-check env: PR_NUMBER: ${{ github.event.number }} ACTOR: ${{ github.actor }} -run-name: ${{ env.ACTOR }} is running the UI tests check for PR ${{env.PR_NUMBER}} +run-name: "$ACTOR is running the UI tests check for PR $PR_NUMBER" on: pull_request: branches: @@ -33,7 +33,7 @@ jobs: distribution: 'adopt' - name: Run iOS UI tests - working-directory: ${{env.WORKING_DIRECTORY}} + working-directory: "$WORKING_DIRECTORY" run: xcodebuild \ -workspace ios.xcworkspace \ -scheme ios \ From da79ec8f3da245cdd83f9c6fc6eaa6a642bb85bd Mon Sep 17 00:00:00 2001 From: corrado4eyes Date: Fri, 30 Jun 2023 13:25:36 +0200 Subject: [PATCH 06/33] Add common steps --- .github/workflows/ui-tests-check.yml | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/.github/workflows/ui-tests-check.yml b/.github/workflows/ui-tests-check.yml index 2f4d0dc..81e2c96 100644 --- a/.github/workflows/ui-tests-check.yml +++ b/.github/workflows/ui-tests-check.yml @@ -1,23 +1,26 @@ name: ui-tests-check -env: - PR_NUMBER: ${{ github.event.number }} - ACTOR: ${{ github.actor }} -run-name: "$ACTOR is running the UI tests check for PR $PR_NUMBER" +run-name: ${{ github.actor }} is running the UI tests check for PR ${{ github.event.number }} on: pull_request: branches: - main jobs: - run-android-ui-tests: - runs-on: ubuntu-latest + uses-checkout: steps: - uses: actions/checkout@v3 + + install-java-17: + steps: - name: Set up JDK 17 uses: actions/setup-java@v3 with: - java-version: '17' + java-version: 17 distribution: 'adopt' + run-android-ui-tests: + runs-on: ubuntu-latest + needs: [uses-checkout, install-java-17] + steps: - name: Run Android UI tests run: ./gradlew :android:connectedCheck @@ -25,15 +28,10 @@ jobs: env: WORKING_DIRECTORY: ./ios runs-on: macos-13 + needs: [uses-checkout, install-java-17] steps: - - name: Set up JDK 17 - uses: actions/setup-java@v3 - with: - java-version: 17 - distribution: 'adopt' - - name: Run iOS UI tests - working-directory: "$WORKING_DIRECTORY" + working-directory: ${{env.WORKING_DIRECTORY}} run: xcodebuild \ -workspace ios.xcworkspace \ -scheme ios \ From b502a9cb207076f58ff5908a413e5a9aa12db42a Mon Sep 17 00:00:00 2001 From: corrado4eyes Date: Fri, 30 Jun 2023 13:27:51 +0200 Subject: [PATCH 07/33] Remove common steps --- .github/workflows/ui-tests-check.yml | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ui-tests-check.yml b/.github/workflows/ui-tests-check.yml index 81e2c96..a7920d8 100644 --- a/.github/workflows/ui-tests-check.yml +++ b/.github/workflows/ui-tests-check.yml @@ -5,22 +5,18 @@ on: branches: - main jobs: - uses-checkout: + run-android-ui-tests: + runs-on: ubuntu-latest + needs: [uses-checkout, install-java-17] steps: - uses: actions/checkout@v3 - install-java-17: - steps: - name: Set up JDK 17 uses: actions/setup-java@v3 with: java-version: 17 distribution: 'adopt' - run-android-ui-tests: - runs-on: ubuntu-latest - needs: [uses-checkout, install-java-17] - steps: - name: Run Android UI tests run: ./gradlew :android:connectedCheck @@ -30,6 +26,14 @@ jobs: runs-on: macos-13 needs: [uses-checkout, install-java-17] steps: + - uses: actions/checkout@v3 + + - name: Set up JDK 17 + uses: actions/setup-java@v3 + with: + java-version: 17 + distribution: 'adopt' + - name: Run iOS UI tests working-directory: ${{env.WORKING_DIRECTORY}} run: xcodebuild \ From 1903434bec739394beca8e6f2746ddc10e6759fa Mon Sep 17 00:00:00 2001 From: corrado4eyes Date: Fri, 30 Jun 2023 13:28:38 +0200 Subject: [PATCH 08/33] Remove `needs` --- .github/workflows/ui-tests-check.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/ui-tests-check.yml b/.github/workflows/ui-tests-check.yml index a7920d8..a2df53c 100644 --- a/.github/workflows/ui-tests-check.yml +++ b/.github/workflows/ui-tests-check.yml @@ -7,7 +7,6 @@ on: jobs: run-android-ui-tests: runs-on: ubuntu-latest - needs: [uses-checkout, install-java-17] steps: - uses: actions/checkout@v3 @@ -24,7 +23,6 @@ jobs: env: WORKING_DIRECTORY: ./ios runs-on: macos-13 - needs: [uses-checkout, install-java-17] steps: - uses: actions/checkout@v3 From 5b3e97e0a5dc1cd2db33b051a3fc9d7df3c04534 Mon Sep 17 00:00:00 2001 From: corrado4eyes Date: Fri, 30 Jun 2023 13:31:17 +0200 Subject: [PATCH 09/33] Inline ios script --- .github/workflows/ui-tests-check.yml | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/.github/workflows/ui-tests-check.yml b/.github/workflows/ui-tests-check.yml index a2df53c..996c5e2 100644 --- a/.github/workflows/ui-tests-check.yml +++ b/.github/workflows/ui-tests-check.yml @@ -34,10 +34,5 @@ jobs: - name: Run iOS UI tests working-directory: ${{env.WORKING_DIRECTORY}} - run: xcodebuild \ - -workspace ios.xcworkspace \ - -scheme ios \ - -sdk iphonesimulator \ - -destination 'platform=iOS Simulator,name=iPhone 12,OS=16.0' \ - test + run: xcodebuild -workspace ios.xcworkspace -scheme ios -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 12,OS=16.0' test From 1045afec015ec26f03055079a98b6c1914f9e08c Mon Sep 17 00:00:00 2001 From: corrado4eyes Date: Fri, 30 Jun 2023 13:36:51 +0200 Subject: [PATCH 10/33] Add android emulator runner --- .github/workflows/ui-tests-check.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/.github/workflows/ui-tests-check.yml b/.github/workflows/ui-tests-check.yml index 996c5e2..e61d7b0 100644 --- a/.github/workflows/ui-tests-check.yml +++ b/.github/workflows/ui-tests-check.yml @@ -16,6 +16,22 @@ jobs: java-version: 17 distribution: 'adopt' + - name: Run Android Emulator + uses: reactivecircus/android-emulator-runner@v2 + with: + api-level: ${{ matrix.api-level }} + target: google_apis + force-avd-creation: false + emulator-options: -no-window -gpu swiftshader_indirect -no-snapshot-save -noaudio -no-boot-anim -camera-back none + disable-animations: true + arch: x86_64 + disk-size: 3G + ram-size: 3G + heap-size: 1500M + profile: 3.4in WQVGA + channel: canary + cores: 6 + - name: Run Android UI tests run: ./gradlew :android:connectedCheck From bbb5aa39ef3149eb9bf1f8eae2c7e0798ceb0876 Mon Sep 17 00:00:00 2001 From: corrado4eyes Date: Fri, 30 Jun 2023 13:38:32 +0200 Subject: [PATCH 11/33] Change iOS device --- .github/workflows/ui-tests-check.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ui-tests-check.yml b/.github/workflows/ui-tests-check.yml index e61d7b0..0674e56 100644 --- a/.github/workflows/ui-tests-check.yml +++ b/.github/workflows/ui-tests-check.yml @@ -50,5 +50,5 @@ jobs: - name: Run iOS UI tests working-directory: ${{env.WORKING_DIRECTORY}} - run: xcodebuild -workspace ios.xcworkspace -scheme ios -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 12,OS=16.0' test + run: xcodebuild -workspace ios.xcworkspace -scheme ios -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 14,OS=16.2' test From 1aa8c2114c6f02fef38b6bba403a8b78c29e4fb8 Mon Sep 17 00:00:00 2001 From: corrado4eyes Date: Fri, 30 Jun 2023 13:39:55 +0200 Subject: [PATCH 12/33] Add android api level --- .github/workflows/ui-tests-check.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ui-tests-check.yml b/.github/workflows/ui-tests-check.yml index 0674e56..28e357c 100644 --- a/.github/workflows/ui-tests-check.yml +++ b/.github/workflows/ui-tests-check.yml @@ -19,7 +19,7 @@ jobs: - name: Run Android Emulator uses: reactivecircus/android-emulator-runner@v2 with: - api-level: ${{ matrix.api-level }} + api-level: 29 target: google_apis force-avd-creation: false emulator-options: -no-window -gpu swiftshader_indirect -no-snapshot-save -noaudio -no-boot-anim -camera-back none From 391e9e72b3fd0e7505bfa3564a78c84aa481ced4 Mon Sep 17 00:00:00 2001 From: corrado4eyes Date: Fri, 30 Jun 2023 13:43:43 +0200 Subject: [PATCH 13/33] Update emulator step --- .github/workflows/ui-tests-check.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ui-tests-check.yml b/.github/workflows/ui-tests-check.yml index 28e357c..b2beae5 100644 --- a/.github/workflows/ui-tests-check.yml +++ b/.github/workflows/ui-tests-check.yml @@ -16,7 +16,7 @@ jobs: java-version: 17 distribution: 'adopt' - - name: Run Android Emulator + - name: Run Android Emulator and execute tests uses: reactivecircus/android-emulator-runner@v2 with: api-level: 29 @@ -31,9 +31,8 @@ jobs: profile: 3.4in WQVGA channel: canary cores: 6 - - - name: Run Android UI tests - run: ./gradlew :android:connectedCheck + script: + ./gradlew :android:connectedCheck run-iOS-ui-tests: env: From 0c6668781ed9e3a828c3ad3301b69cbf36deb9eb Mon Sep 17 00:00:00 2001 From: corrado4eyes Date: Fri, 30 Jun 2023 13:59:59 +0200 Subject: [PATCH 14/33] Add `matrix` for api-level --- .github/workflows/ui-tests-check.yml | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ui-tests-check.yml b/.github/workflows/ui-tests-check.yml index b2beae5..4581d35 100644 --- a/.github/workflows/ui-tests-check.yml +++ b/.github/workflows/ui-tests-check.yml @@ -7,6 +7,8 @@ on: jobs: run-android-ui-tests: runs-on: ubuntu-latest + strategy: + api-level: [29, 30, 31] steps: - uses: actions/checkout@v3 @@ -16,10 +18,22 @@ jobs: java-version: 17 distribution: 'adopt' + - name: Gradle cache + uses: gradle/gradle-build-action@v2 + + - name: AVD cache + uses: actions/cache@v3 + id: avd-cache + with: + path: | + ~/.android/avd/* + ~/.android/adb* + key: avd-${{ matrix.api-level }} + - name: Run Android Emulator and execute tests uses: reactivecircus/android-emulator-runner@v2 with: - api-level: 29 + api-level: ${{ matrix.api-level }} target: google_apis force-avd-creation: false emulator-options: -no-window -gpu swiftshader_indirect -no-snapshot-save -noaudio -no-boot-anim -camera-back none From 0fe3653d271d71d6a9adcc95cb178e6766f842bb Mon Sep 17 00:00:00 2001 From: corrado4eyes Date: Fri, 30 Jun 2023 14:12:27 +0200 Subject: [PATCH 15/33] Compile modules --- .github/workflows/ui-tests-check.yml | 87 ++++++++++++++-------------- 1 file changed, 45 insertions(+), 42 deletions(-) diff --git a/.github/workflows/ui-tests-check.yml b/.github/workflows/ui-tests-check.yml index 4581d35..3a23026 100644 --- a/.github/workflows/ui-tests-check.yml +++ b/.github/workflows/ui-tests-check.yml @@ -5,48 +5,48 @@ on: branches: - main jobs: - run-android-ui-tests: - runs-on: ubuntu-latest - strategy: - api-level: [29, 30, 31] - steps: - - uses: actions/checkout@v3 - - - name: Set up JDK 17 - uses: actions/setup-java@v3 - with: - java-version: 17 - distribution: 'adopt' - - - name: Gradle cache - uses: gradle/gradle-build-action@v2 - - - name: AVD cache - uses: actions/cache@v3 - id: avd-cache - with: - path: | - ~/.android/avd/* - ~/.android/adb* - key: avd-${{ matrix.api-level }} - - - name: Run Android Emulator and execute tests - uses: reactivecircus/android-emulator-runner@v2 - with: - api-level: ${{ matrix.api-level }} - target: google_apis - force-avd-creation: false - emulator-options: -no-window -gpu swiftshader_indirect -no-snapshot-save -noaudio -no-boot-anim -camera-back none - disable-animations: true - arch: x86_64 - disk-size: 3G - ram-size: 3G - heap-size: 1500M - profile: 3.4in WQVGA - channel: canary - cores: 6 - script: - ./gradlew :android:connectedCheck +# run-android-ui-tests: +# runs-on: ubuntu-latest +# strategy: +# api-level: [29, 30, 31] +# steps: +# - uses: actions/checkout@v3 +# +# - name: Set up JDK 17 +# uses: actions/setup-java@v3 +# with: +# java-version: 17 +# distribution: 'adopt' +# +# - name: Gradle cache +# uses: gradle/gradle-build-action@v2 +# +# - name: AVD cache +# uses: actions/cache@v3 +# id: avd-cache +# with: +# path: | +# ~/.android/avd/* +# ~/.android/adb* +# key: avd-${{ matrix.api-level }} +# +# - name: Run Android Emulator and execute tests +# uses: reactivecircus/android-emulator-runner@v2 +# with: +# api-level: ${{ matrix.api-level }} +# target: google_apis +# force-avd-creation: false +# emulator-options: -no-window -gpu swiftshader_indirect -no-snapshot-save -noaudio -no-boot-anim -camera-back none +# disable-animations: true +# arch: x86_64 +# disk-size: 3G +# ram-size: 3G +# heap-size: 1500M +# profile: 3.4in WQVGA +# channel: canary +# cores: 6 +# script: +# ./gradlew :android:connectedCheck run-iOS-ui-tests: env: @@ -61,6 +61,9 @@ jobs: java-version: 17 distribution: 'adopt' + - name: Compile modules + run: ./gradlew compileKotlinIosX64 + - name: Run iOS UI tests working-directory: ${{env.WORKING_DIRECTORY}} run: xcodebuild -workspace ios.xcworkspace -scheme ios -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 14,OS=16.2' test From 491531f7646a6ef5790e7226940cb82da01a6c8e Mon Sep 17 00:00:00 2001 From: corrado4eyes Date: Fri, 30 Jun 2023 14:56:56 +0200 Subject: [PATCH 16/33] Add cocoapods-action step --- .github/workflows/ui-tests-check.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/ui-tests-check.yml b/.github/workflows/ui-tests-check.yml index 3a23026..7153328 100644 --- a/.github/workflows/ui-tests-check.yml +++ b/.github/workflows/ui-tests-check.yml @@ -64,6 +64,10 @@ jobs: - name: Compile modules run: ./gradlew compileKotlinIosX64 + - name: Run pod install + working-directory: ${{env.WORKING_DIRECTORY}} + uses: ty0x2333/cocoapods-action@master + - name: Run iOS UI tests working-directory: ${{env.WORKING_DIRECTORY}} run: xcodebuild -workspace ios.xcworkspace -scheme ios -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 14,OS=16.2' test From 080554fb5c03fbcf55a52817ee15731765f0feae Mon Sep 17 00:00:00 2001 From: corrado4eyes Date: Fri, 30 Jun 2023 15:21:25 +0200 Subject: [PATCH 17/33] Add steps to configure and build ios project --- .github/workflows/ui-tests-check.yml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ui-tests-check.yml b/.github/workflows/ui-tests-check.yml index 7153328..d9e9c55 100644 --- a/.github/workflows/ui-tests-check.yml +++ b/.github/workflows/ui-tests-check.yml @@ -54,6 +54,8 @@ jobs: runs-on: macos-13 steps: - uses: actions/checkout@v3 + with: + submodules: recursive - name: Set up JDK 17 uses: actions/setup-java@v3 @@ -61,12 +63,16 @@ jobs: java-version: 17 distribution: 'adopt' - - name: Compile modules - run: ./gradlew compileKotlinIosX64 + - name: Install sourcery + run: brew install sourcery + + - name: Configure sourcery + working-directory: ${{env.WORKING_DIRECTORY}} + run: sourcery --config kaluga.sourcery.yml - name: Run pod install working-directory: ${{env.WORKING_DIRECTORY}} - uses: ty0x2333/cocoapods-action@master + run: pod install - name: Run iOS UI tests working-directory: ${{env.WORKING_DIRECTORY}} From 20a94f1674e06ff29d2715fd9cdc5a236d919109 Mon Sep 17 00:00:00 2001 From: corrado4eyes Date: Fri, 30 Jun 2023 16:18:02 +0200 Subject: [PATCH 18/33] Add transitiveExport flag --- shared/build.gradle.kts | 1 + 1 file changed, 1 insertion(+) diff --git a/shared/build.gradle.kts b/shared/build.gradle.kts index 616c0f0..8aefc73 100644 --- a/shared/build.gradle.kts +++ b/shared/build.gradle.kts @@ -16,6 +16,7 @@ kotlin { val target: org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTarget.() -> Unit = { binaries { framework { + transitiveExport = true baseName = "shared" export("com.splendo.kaluga:alerts:$kalugaVersion") From 4140935b800e6cb29d1b531f3dcec20d29c4cd2f Mon Sep 17 00:00:00 2001 From: corrado4eyes Date: Fri, 30 Jun 2023 16:18:52 +0200 Subject: [PATCH 19/33] Change submodule HEAD --- dependencies/kaluga-swiftui | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dependencies/kaluga-swiftui b/dependencies/kaluga-swiftui index 260db7b..b2c6a94 160000 --- a/dependencies/kaluga-swiftui +++ b/dependencies/kaluga-swiftui @@ -1 +1 @@ -Subproject commit 260db7bd1ec2552d407433d4ebd3ec1ab27cadb1 +Subproject commit b2c6a941f15fc8b183d4322def71a9816169d07d From 58e34daf96f7f4f2f167c2725b02fe8b7946fdc0 Mon Sep 17 00:00:00 2001 From: corrado4eyes Date: Fri, 30 Jun 2023 16:49:03 +0200 Subject: [PATCH 20/33] Forcing deployment target --- ios/Podfile | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/ios/Podfile b/ios/Podfile index 07525ae..73c2201 100644 --- a/ios/Podfile +++ b/ios/Podfile @@ -3,3 +3,11 @@ target 'CucumberTests' do platform :ios, '14.1' pod 'Cucumberish' end + +post_install do |installer| + installer.pods_project.targets.each do |target| + target.build_configurations.each do |config| + config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = Gem::Version.new('9.0') + end + end +end \ No newline at end of file From 2031b4a2593aa555fedc6d32cc40826349aa2dc1 Mon Sep 17 00:00:00 2001 From: corrado4eyes Date: Fri, 30 Jun 2023 16:52:28 +0200 Subject: [PATCH 21/33] Trigger CI From 4c987f9e4ccc9007d6a7cb39918ec3c5af5946de Mon Sep 17 00:00:00 2001 From: corrado4eyes Date: Fri, 30 Jun 2023 17:32:04 +0200 Subject: [PATCH 22/33] Add podImport task before running pod install and tests --- .github/workflows/ui-tests-check.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/ui-tests-check.yml b/.github/workflows/ui-tests-check.yml index d9e9c55..044e4a3 100644 --- a/.github/workflows/ui-tests-check.yml +++ b/.github/workflows/ui-tests-check.yml @@ -70,6 +70,9 @@ jobs: working-directory: ${{env.WORKING_DIRECTORY}} run: sourcery --config kaluga.sourcery.yml + - name: Run podImport + run: ./gradlew :cucumber:podImport + - name: Run pod install working-directory: ${{env.WORKING_DIRECTORY}} run: pod install From 31c76931f82ff0a8e5b7e0e7af42e9ea9922be5d Mon Sep 17 00:00:00 2001 From: corrado4eyes Date: Sat, 1 Jul 2023 15:46:22 +0200 Subject: [PATCH 23/33] Add prettifier --- .github/workflows/ui-tests-check.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ui-tests-check.yml b/.github/workflows/ui-tests-check.yml index 044e4a3..b58a3a8 100644 --- a/.github/workflows/ui-tests-check.yml +++ b/.github/workflows/ui-tests-check.yml @@ -79,5 +79,5 @@ jobs: - name: Run iOS UI tests working-directory: ${{env.WORKING_DIRECTORY}} - run: xcodebuild -workspace ios.xcworkspace -scheme ios -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 14,OS=16.2' test + run: xcodebuild -workspace ios.xcworkspace -scheme ios -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 14,OS=16.2' -resultBundlePath TestResults test | xcpretty From 81684b8dd92e32ea26235e9d01f3c0d445202f20 Mon Sep 17 00:00:00 2001 From: corrado4eyes Date: Sat, 1 Jul 2023 15:46:41 +0200 Subject: [PATCH 24/33] Remove ununsed configuration --- ios/CucumberTests/TestPlan.xctestplan | 6 ------ 1 file changed, 6 deletions(-) diff --git a/ios/CucumberTests/TestPlan.xctestplan b/ios/CucumberTests/TestPlan.xctestplan index 42ab4c5..5796d04 100644 --- a/ios/CucumberTests/TestPlan.xctestplan +++ b/ios/CucumberTests/TestPlan.xctestplan @@ -1,12 +1,6 @@ { "configurations" : [ - { - "id" : "437917A8-B65A-45A5-8D34-B8C13877CC13", - "name" : "Configuration 1", - "options" : { - } - } ], "defaultOptions" : { "repeatInNewRunnerProcess" : true, From 9f1bd9a6b0145eb548b92b08bd01ba6aad041123 Mon Sep 17 00:00:00 2001 From: corrado4eyes Date: Sat, 1 Jul 2023 16:09:46 +0200 Subject: [PATCH 25/33] Remove prettiefier --- .github/workflows/ui-tests-check.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ui-tests-check.yml b/.github/workflows/ui-tests-check.yml index b58a3a8..3b11229 100644 --- a/.github/workflows/ui-tests-check.yml +++ b/.github/workflows/ui-tests-check.yml @@ -79,5 +79,5 @@ jobs: - name: Run iOS UI tests working-directory: ${{env.WORKING_DIRECTORY}} - run: xcodebuild -workspace ios.xcworkspace -scheme ios -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 14,OS=16.2' -resultBundlePath TestResults test | xcpretty + run: xcodebuild -workspace ios.xcworkspace -scheme ios -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 14,OS=16.2' -resultBundlePath TestResults test From e45c3ac0dca21c933c0e09b8518923cedbbd794a Mon Sep 17 00:00:00 2001 From: corrado4eyes Date: Sat, 1 Jul 2023 16:13:49 +0200 Subject: [PATCH 26/33] Add task to upload test result artifacts --- .github/workflows/ui-tests-check.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/ui-tests-check.yml b/.github/workflows/ui-tests-check.yml index 3b11229..d4c8b49 100644 --- a/.github/workflows/ui-tests-check.yml +++ b/.github/workflows/ui-tests-check.yml @@ -81,3 +81,8 @@ jobs: working-directory: ${{env.WORKING_DIRECTORY}} run: xcodebuild -workspace ios.xcworkspace -scheme ios -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 14,OS=16.2' -resultBundlePath TestResults test + - name: Upload test result artifacts + uses: actions/upload-artifact@v3 + with: + name: dist-without-markdown + path: /TestResults* From f40a109b7286e9826017207e2a3ba281c651b944 Mon Sep 17 00:00:00 2001 From: corrado4eyes Date: Sat, 1 Jul 2023 17:55:18 +0200 Subject: [PATCH 27/33] Add `always` policy to run step even if previous step failed --- .github/workflows/ui-tests-check.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ui-tests-check.yml b/.github/workflows/ui-tests-check.yml index d4c8b49..bea7e68 100644 --- a/.github/workflows/ui-tests-check.yml +++ b/.github/workflows/ui-tests-check.yml @@ -82,6 +82,7 @@ jobs: run: xcodebuild -workspace ios.xcworkspace -scheme ios -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 14,OS=16.2' -resultBundlePath TestResults test - name: Upload test result artifacts + if: always() uses: actions/upload-artifact@v3 with: name: dist-without-markdown From 94463b407cb0ec7f9aaa9a6b10f505f9e1e4c7e4 Mon Sep 17 00:00:00 2001 From: corrado4eyes Date: Sat, 1 Jul 2023 20:22:45 +0200 Subject: [PATCH 28/33] Fix path --- .github/workflows/ui-tests-check.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ui-tests-check.yml b/.github/workflows/ui-tests-check.yml index bea7e68..bb011e3 100644 --- a/.github/workflows/ui-tests-check.yml +++ b/.github/workflows/ui-tests-check.yml @@ -86,4 +86,4 @@ jobs: uses: actions/upload-artifact@v3 with: name: dist-without-markdown - path: /TestResults* + path: ./TestResults* From 5274ef86ad36420bbc2f173f7bbd9fe24f9967bc Mon Sep 17 00:00:00 2001 From: corrado4eyes Date: Mon, 3 Jul 2023 10:11:22 +0200 Subject: [PATCH 29/33] Update artefacts folder --- .github/workflows/ui-tests-check.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ui-tests-check.yml b/.github/workflows/ui-tests-check.yml index bb011e3..bde17f2 100644 --- a/.github/workflows/ui-tests-check.yml +++ b/.github/workflows/ui-tests-check.yml @@ -86,4 +86,4 @@ jobs: uses: actions/upload-artifact@v3 with: name: dist-without-markdown - path: ./TestResults* + path: ./**/TestResults* From 86a41e70c0a3c93ef119f696b205ac0e06c7ccdc Mon Sep 17 00:00:00 2001 From: corrado4eyes Date: Fri, 8 Sep 2023 11:51:56 +0200 Subject: [PATCH 30/33] Add gradle task to update .def file --- cucumber/build.gradle.kts | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/cucumber/build.gradle.kts b/cucumber/build.gradle.kts index 86a3cf8..7ba7c09 100644 --- a/cucumber/build.gradle.kts +++ b/cucumber/build.gradle.kts @@ -1,4 +1,6 @@ + import org.jetbrains.kotlin.gradle.targets.native.tasks.PodGenTask +import org.jetbrains.kotlin.gradle.tasks.DefFileTask plugins { kotlin("multiplatform") @@ -14,6 +16,7 @@ kotlin { } } } + iosX64() iosArm64() iosSimulatorArm64() @@ -78,6 +81,22 @@ android { } } +tasks.named("generateDefCucumberish").configure { + doLast { + println("DefFileTask named: $name") + val file = project.buildDir.resolve("cocoapods/defs/Cucumberish.def") + val writer = file.bufferedWriter() + writer.use { + it.write(""" + language = Objective-C + modules = Cucumberish + linkerOpts = -framework Cucumberish + foreignExceptionMode = objc-wrap + """.trimIndent()) + } + } +} + /** * Custom gradle task since Cucumberish library targets iOS 8. User running on the latest macOS version will have errors when syncing since iOS 8 won't be a valid target anymore. * This script will override the target version to the given string. From 328d6f779dbd67198f5fab0ccbb835ec135ff89a Mon Sep 17 00:00:00 2001 From: corrado4eyes Date: Fri, 8 Sep 2023 11:52:39 +0200 Subject: [PATCH 31/33] Add Throws annotation to the wrappers --- .../kotlin/com/corrado4eyes/cucumber/DefaultGherkinRunner.kt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cucumber/src/iosMain/kotlin/com/corrado4eyes/cucumber/DefaultGherkinRunner.kt b/cucumber/src/iosMain/kotlin/com/corrado4eyes/cucumber/DefaultGherkinRunner.kt index 50eab50..a834450 100644 --- a/cucumber/src/iosMain/kotlin/com/corrado4eyes/cucumber/DefaultGherkinRunner.kt +++ b/cucumber/src/iosMain/kotlin/com/corrado4eyes/cucumber/DefaultGherkinRunner.kt @@ -4,6 +4,7 @@ import cocoapods.Cucumberish.CCIStepBody import cocoapods.Cucumberish.Given import cocoapods.Cucumberish.Then import cocoapods.Cucumberish.When +import kotlinx.cinterop.ForeignException actual val EXPECT_VALUE_STRING = "\\\"(.*)\\\"" @@ -31,14 +32,17 @@ actual fun given(regex: String, lambda: GherkinLambda2) { Given(regex, lambda) } +@Throws(ForeignException::class) actual fun then(regex: String, lambda: GherkinLambda0) { Then(regex, lambda) } +@Throws(ForeignException::class) actual fun then(regex: String, lambda: GherkinLambda1) { Then(regex, lambda) } +@Throws(ForeignException::class) actual fun then(regex: String, lambda: GherkinLambda2) { Then(regex, lambda) } From 4686084b7729608581d457d7cb1e0f8b8e7d89cb Mon Sep 17 00:00:00 2001 From: corrado4eyes Date: Fri, 8 Sep 2023 11:53:30 +0200 Subject: [PATCH 32/33] Update feature file so that tests fails --- ios/CucumberTests/Features/Login.feature | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ios/CucumberTests/Features/Login.feature b/ios/CucumberTests/Features/Login.feature index ec36c05..7d4a025 100644 --- a/ios/CucumberTests/Features/Login.feature +++ b/ios/CucumberTests/Features/Login.feature @@ -8,4 +8,4 @@ Feature: Login Then I see the "Login" button Then I press the login button Then I see the "Home" screen - Then I see "test@test.com" text + Then I see "test@test.com1" text From 741ea66e399f65ad79802d2ae136d08639d3e0da Mon Sep 17 00:00:00 2001 From: corrado4eyes Date: Fri, 8 Sep 2023 15:37:37 +0200 Subject: [PATCH 33/33] Add try/catch to wrapper methods --- .../cucumber/DefaultGherkinRunner.kt | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/cucumber/src/iosMain/kotlin/com/corrado4eyes/cucumber/DefaultGherkinRunner.kt b/cucumber/src/iosMain/kotlin/com/corrado4eyes/cucumber/DefaultGherkinRunner.kt index a834450..7dcaabb 100644 --- a/cucumber/src/iosMain/kotlin/com/corrado4eyes/cucumber/DefaultGherkinRunner.kt +++ b/cucumber/src/iosMain/kotlin/com/corrado4eyes/cucumber/DefaultGherkinRunner.kt @@ -34,17 +34,29 @@ actual fun given(regex: String, lambda: GherkinLambda2) { @Throws(ForeignException::class) actual fun then(regex: String, lambda: GherkinLambda0) { - Then(regex, lambda) + try { + Then(regex, lambda) + } catch(e: ForeignException) { + println("Exception is $e") + } } @Throws(ForeignException::class) actual fun then(regex: String, lambda: GherkinLambda1) { - Then(regex, lambda) + try { + Then(regex, lambda) + } catch(e: ForeignException) { + println("Exception is $e") + } } @Throws(ForeignException::class) actual fun then(regex: String, lambda: GherkinLambda2) { - Then(regex, lambda) + try { + Then(regex, lambda) + } catch(e: ForeignException) { + println("Exception is $e") + } } actual fun `when`(regex: String, lambda: GherkinLambda0) {