From dce141c25be600e70d658e0ac2c6bc19e0624684 Mon Sep 17 00:00:00 2001 From: codepushr <1425202+codepushr@users.noreply.github.com> Date: Mon, 23 Sep 2024 15:12:44 +0200 Subject: [PATCH 01/11] build: add or edit github actions --- .github/workflows/cache.yml | 27 +------ .github/workflows/lint.yml | 15 +--- .github/workflows/npm.yml | 29 ++++++++ .github/workflows/semantic-pr.yml | 21 ------ .github/workflows/semantic.yml | 14 ++++ .github/workflows/test.yml | 118 ++++++++++++++++++++++++++++++ 6 files changed, 167 insertions(+), 57 deletions(-) create mode 100644 .github/workflows/npm.yml delete mode 100644 .github/workflows/semantic-pr.yml create mode 100644 .github/workflows/semantic.yml create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/cache.yml b/.github/workflows/cache.yml index 2bc621a..73f1c2e 100644 --- a/.github/workflows/cache.yml +++ b/.github/workflows/cache.yml @@ -1,28 +1,9 @@ -name: Cache +name: cache on: pull_request: types: - closed jobs: - clear: - runs-on: ubuntu-latest - steps: - - name: Execute - run: | - gh extension install actions/gh-actions-cache - - echo "Fetching list of cache key" - cacheKeysForPR=$(gh actions-cache list -R $REPO -B $BRANCH -L 100 | cut -f 1 ) - - ## Setting this to not fail the workflow while deleting cache keys. - set +e - echo "Deleting caches..." - for cacheKey in $cacheKeysForPR - do - gh actions-cache delete $cacheKey -R $REPO -B $BRANCH --confirm - done - echo "Done" - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - REPO: ${{ github.repository }} - BRANCH: refs/pull/${{ github.event.pull_request.number }}/merge + cache_cleanup: + name: Clean up cache + uses: evva-sfw/workflows/workflows/cache.yml@main diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 2326087..de9a3a1 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -1,4 +1,4 @@ -name: Lint +name: lint on: push: branches: [ 'main' ] @@ -8,7 +8,7 @@ permissions: id-token: write attestations: write jobs: - All: + lint_all: runs-on: macos-latest permissions: id-token: write @@ -29,15 +29,4 @@ jobs: node_modules key: node-modules - run: npm i - - run: cd test-app && npm i - run: npm run lint - - run: npm pack - - name: Upload Artifact - uses: actions/upload-artifact@v4 - with: - name: package - path: '${{ github.workspace }}/*.tgz' - - name: Attest - uses: actions/attest-build-provenance@v1 - with: - subject-path: '${{ github.workspace }}/*.tgz' diff --git a/.github/workflows/npm.yml b/.github/workflows/npm.yml new file mode 100644 index 0000000..708fe66 --- /dev/null +++ b/.github/workflows/npm.yml @@ -0,0 +1,29 @@ +name: npm +on: + push: + branches: [ 'main' ] + pull_request: + branches: [ 'main' ] +jobs: + npm_check-package-sync: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Install Node.js + uses: actions/setup-node@v4 + with: + node-version: lts/* + - name: Cache node_modules + id: node-modules + uses: actions/cache@v4 + with: + path: | + node_modules + test-app/node_modules + key: node-modules + - name: NPM Install + run: npm i + - name: Check if git is clean + uses: CatChen/check-git-status-action@v1 + with: + fail-if-not-clean: true diff --git a/.github/workflows/semantic-pr.yml b/.github/workflows/semantic-pr.yml deleted file mode 100644 index c2e8afb..0000000 --- a/.github/workflows/semantic-pr.yml +++ /dev/null @@ -1,21 +0,0 @@ -name: 'Semantic PR Title' - -on: - pull_request_target: - types: - - opened - - edited - - synchronize - - reopened - -permissions: - pull-requests: read - -jobs: - main: - name: Validate PR title - runs-on: ubuntu-latest - steps: - - uses: amannn/action-semantic-pull-request@v5 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/semantic.yml b/.github/workflows/semantic.yml new file mode 100644 index 0000000..9d0a14b --- /dev/null +++ b/.github/workflows/semantic.yml @@ -0,0 +1,14 @@ +name: semantic +on: + pull_request_target: + types: + - opened + - edited + - synchronize + - reopened +permissions: + pull-requests: read +jobs: + semantic_pr-name: + name: semantic_pr-name + uses: evva-sfw/workflows/workflows/semantic.yml@main diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..04cd20f --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,118 @@ +name: test +on: + push: + branches: [ 'main' ] + pull_request: + branches: [ 'main' ] +jobs: + test_ios: + runs-on: macos-latest + steps: + - uses: actions/checkout@v4 + - uses: ruby/setup-ruby@v1 + with: + ruby-version: '3.3' + bundler-cache: true + - uses: SwiftyLab/setup-swift@latest + with: + swift-version: '5.10.0' + - name: Get Swift Version + run: swift --version + - name: Get Xcode version + env: + DEVELOPER_DIR: /Applications/Xcode_15.4.app + run: xcodebuild -version + - name: Cache Pods + id: pods + uses: actions/cache@v4 + with: + path: example/ios/Pods + key: pods-cache--${{ hashFiles('example/ios/podfile.lock') }} + - name: Cache Xcode DerivedData + uses: irgaly/xcode-cache@v1.7.2 + with: + key: xcode-deriveddata + - name: Install Node.js + uses: actions/setup-node@v4 + with: + node-version: lts/* + - name: Cache node_modules + id: node-modules + uses: actions/cache@v4 + with: + path: | + node_modules + key: node-modules + - name: Pod Install + run: cd ios; pod install; cd - + - name: NPM Install + run: npm i + - name: Test iOS + env: + DEVELOPER_DIR: /Applications/Xcode_15.4.app + run: | + cd ios + xcodebuild \ + -quiet \ + -workspace Plugin.xcworkspace \ + -scheme Plugin \ + -sdk iphonesimulator \ + -destination 'platform=iOS Simulator,name=iPhone 15,OS=17.4' \ + test || exit 1 + test_android: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Set up JDK 17 + uses: actions/setup-java@v3 + with: + java-version: '17' + distribution: 'temurin' + - name: Install Android SDK + uses: android-actions/setup-android@v3 + - name: Cache Gradle + uses: actions/cache@v4 + with: + path: | + android/.gradle + test-app/android/.gradle + ~/.gradle/caches + key: gradle + - name: Cache Android SDK + id: aandroid-sdk + uses: actions/cache@v4 + with: + path: ~/Android/Sdk + key: android-sdk + - name: Enable KVM + run: | + echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules + sudo udevadm control --reload-rules + sudo udevadm trigger --name-match=kvm + - name: Cache AVD + uses: actions/cache@v4 + id: avd-cache + with: + path: | + ~/.android/avd/* + ~/.android/adb* + key: avd-29 + - name: Install Node.js + uses: actions/setup-node@v4 + with: + node-version: lts/* + - name: Cache node_modules + id: node-modules + uses: actions/cache@v4 + with: + path: | + node_modules + key: node-modules + - name: NPM Install + run: npm i + - name: Test Android + uses: reactivecircus/android-emulator-runner@v2 + with: + api-level: 29 + working-directory: android/ + script: ./gradlew clean build test connectedAndroidTest From b9444f6270bf1710c363d6e32570c0c10c5c6b1a Mon Sep 17 00:00:00 2001 From: axi92 Date: Tue, 24 Sep 2024 09:30:15 +0200 Subject: [PATCH 02/11] ci: fix resuable workflow path --- .github/workflows/cache.yml | 2 +- .github/workflows/semantic.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cache.yml b/.github/workflows/cache.yml index 73f1c2e..3d58830 100644 --- a/.github/workflows/cache.yml +++ b/.github/workflows/cache.yml @@ -6,4 +6,4 @@ on: jobs: cache_cleanup: name: Clean up cache - uses: evva-sfw/workflows/workflows/cache.yml@main + uses: evva-sfw/workflows/.github/workflows/cache.yml@main diff --git a/.github/workflows/semantic.yml b/.github/workflows/semantic.yml index 9d0a14b..bbda34b 100644 --- a/.github/workflows/semantic.yml +++ b/.github/workflows/semantic.yml @@ -11,4 +11,4 @@ permissions: jobs: semantic_pr-name: name: semantic_pr-name - uses: evva-sfw/workflows/workflows/semantic.yml@main + uses: evva-sfw/workflows/.github/workflows/semantic.yml@main From 11cc278ccee60ca6c39cd96da34705a01e5cfdf6 Mon Sep 17 00:00:00 2001 From: codepushr <1425202+codepushr@users.noreply.github.com> Date: Wed, 25 Sep 2024 16:29:43 +0200 Subject: [PATCH 03/11] chore: update android gradle settings --- android/build.gradle | 12 +++++++++--- android/variables.gradle | 19 +++++++++++++++++++ test-app/android/variables.gradle | 18 +++++++++--------- test-app/package-lock.json | 12 ++++++------ 4 files changed, 43 insertions(+), 18 deletions(-) create mode 100644 android/variables.gradle diff --git a/android/build.gradle b/android/build.gradle index 8548b7c..d574649 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -1,8 +1,8 @@ ext { junitVersion = project.hasProperty('junitVersion') ? rootProject.ext.junitVersion : '4.13.2' androidxAppCompatVersion = project.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.6.1' - androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.1.5' - androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.5.1' + androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.2.1' + androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.6.1' } buildscript { @@ -48,6 +48,12 @@ android { sourceCompatibility JavaVersion.VERSION_17 targetCompatibility JavaVersion.VERSION_17 } + kotlinOptions { + jvmTarget = JavaVersion.VERSION_17 + } + packagingOptions { + resources.excludes.add("META-INF/*") + } } repositories { @@ -64,7 +70,7 @@ dependencies { implementation "androidx.appcompat:appcompat:$androidxAppCompatVersion" implementation "androidx.core:core-ktx:$coreKtx" - implementation group: "com.evva.xesar", name: "abrevva-sdk-android", version: "1.0.19" + implementation group: "com.evva.xesar", name: "abrevva-sdk-android", version: "1.0.20" testImplementation "junit:junit:$junitVersion" diff --git a/android/variables.gradle b/android/variables.gradle new file mode 100644 index 0000000..92bccc8 --- /dev/null +++ b/android/variables.gradle @@ -0,0 +1,19 @@ +ext { + minSdkVersion = 29 + compileSdkVersion = 34 + targetSdkVersion = 34 + + androidxActivityVersion = '1.8.0' + androidxAppCompatVersion = '1.6.1' + androidxCoordinatorLayoutVersion = '1.2.0' + androidxCoreVersion = '1.12.0' + androidxFragmentVersion = '1.6.2' + androidxJunitVersion = '1.2.1' + androidxWebkitVersion = '1.9.0' + + coreSplashScreenVersion = '1.0.1' + + junitVersion = '4.13.2' + androidxEspressoCoreVersion = '3.6.1' + cordovaAndroidVersion = '10.1.1' +} diff --git a/test-app/android/variables.gradle b/test-app/android/variables.gradle index 0e77071..92bccc8 100644 --- a/test-app/android/variables.gradle +++ b/test-app/android/variables.gradle @@ -3,17 +3,17 @@ ext { compileSdkVersion = 34 targetSdkVersion = 34 - androidxActivityVersion = '1.7.0' - androidxAppCompatVersion = '1.7.0' + androidxActivityVersion = '1.8.0' + androidxAppCompatVersion = '1.6.1' androidxCoordinatorLayoutVersion = '1.2.0' - androidxFragmentVersion = '1.5.6' - androidxCoreVersion = '1.10.0' - androidxEspressoCoreVersion = '3.6.1' + androidxCoreVersion = '1.12.0' + androidxFragmentVersion = '1.6.2' androidxJunitVersion = '1.2.1' - androidxWebkitVersion = '1.6.1' + androidxWebkitVersion = '1.9.0' - cordovaAndroidVersion = '10.1.1' - coreSplashScreenVersion = '1.0.0' + coreSplashScreenVersion = '1.0.1' junitVersion = '4.13.2' -} \ No newline at end of file + androidxEspressoCoreVersion = '3.6.1' + cordovaAndroidVersion = '10.1.1' +} diff --git a/test-app/package-lock.json b/test-app/package-lock.json index 6ecc2e5..aee3045 100644 --- a/test-app/package-lock.json +++ b/test-app/package-lock.json @@ -71,11 +71,11 @@ "devDependencies": { "@babel/eslint-parser": "^7.25.1", "@babel/preset-env": "^7.25.4", - "@capacitor/android": "5.0.5", - "@capacitor/cli": "5.0.5", - "@capacitor/core": "5.0.5", - "@capacitor/docgen": "0.2.1", - "@capacitor/ios": "5.0.5", + "@capacitor/android": "^5.7.8", + "@capacitor/cli": "^5.7.8", + "@capacitor/core": "^5.7.8", + "@capacitor/docgen": "^0.2.2", + "@capacitor/ios": "^5.7.8", "@ionic/swiftlint-config": "^1.1.2", "@types/jest": "^29.5.13", "@typescript-eslint/eslint-plugin": "^6.21.0", @@ -86,7 +86,7 @@ "jest": "^29.7.0", "prettier": "^3.3.3", "prettier-plugin-java": "^2.6.4", - "rimraf": "^5.0.10", + "rimraf": "^6.0.1", "rollup": "^3.29.4", "swiftlint": "^1.0.2", "typescript": "~5.3.3" From 648e5b399a447ffcae60edce3ab29db4fe5aae2c Mon Sep 17 00:00:00 2001 From: codepushr <1425202+codepushr@users.noreply.github.com> Date: Thu, 26 Sep 2024 10:13:53 +0200 Subject: [PATCH 04/11] build: fix ios test setup for actions --- ios/Plugin.xcodeproj/project.pbxproj | 126 ++++++++++-------- .../xcshareddata/IDEWorkspaceChecks.plist | 8 -- ios/PluginTests/AbrevvaTests.swift | 5 +- ios/Podfile | 2 + 4 files changed, 78 insertions(+), 63 deletions(-) delete mode 100644 ios/Plugin.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist diff --git a/ios/Plugin.xcodeproj/project.pbxproj b/ios/Plugin.xcodeproj/project.pbxproj index f57208d..f04d89e 100644 --- a/ios/Plugin.xcodeproj/project.pbxproj +++ b/ios/Plugin.xcodeproj/project.pbxproj @@ -11,14 +11,14 @@ 07C03F2D2B4EE3A70095BC1A /* AbrevvaPluginCrypto.h in Headers */ = {isa = PBXBuildFile; fileRef = 07C03F2A2B4EE3A70095BC1A /* AbrevvaPluginCrypto.h */; settings = {ATTRIBUTES = (Public, ); }; }; 07C03F2E2B4EE3A70095BC1A /* AbrevvaPluginCrypto.swift in Sources */ = {isa = PBXBuildFile; fileRef = 07C03F2B2B4EE3A70095BC1A /* AbrevvaPluginCrypto.swift */; }; 07C03F2F2B4EE3A70095BC1A /* AbrevvaPluginCrypto.m in Sources */ = {isa = PBXBuildFile; fileRef = 07C03F2C2B4EE3A70095BC1A /* AbrevvaPluginCrypto.m */; }; - 0A8057F9DE1FC33B9CCB842E /* Pods_PluginTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BB89FCE0CDDEFE5D12469B61 /* Pods_PluginTests.framework */; }; + 39215DE05972E348690FD2E8 /* Pods_Plugin.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 36AAFE69F1EE46F704AC5B65 /* Pods_Plugin.framework */; }; 50ADFF92201F53D600D50D53 /* Plugin.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 50ADFF88201F53D600D50D53 /* Plugin.framework */; }; 50ADFF97201F53D600D50D53 /* AbrevvaTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 50ADFF96201F53D600D50D53 /* AbrevvaTests.swift */; }; 50ADFF99201F53D600D50D53 /* AbrevvaPluginBLE.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ADFF8B201F53D600D50D53 /* AbrevvaPluginBLE.h */; settings = {ATTRIBUTES = (Public, ); }; }; 50ADFFA42020D75100D50D53 /* Capacitor.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 50ADFFA52020D75100D50D53 /* Capacitor.framework */; }; 50ADFFA82020EE4F00D50D53 /* AbrevvaPluginBLE.m in Sources */ = {isa = PBXBuildFile; fileRef = 50ADFFA72020EE4F00D50D53 /* AbrevvaPluginBLE.m */; }; 50E1A94820377CB70090CE1A /* AbrevvaPluginBLE.swift in Sources */ = {isa = PBXBuildFile; fileRef = 50E1A94720377CB70090CE1A /* AbrevvaPluginBLE.swift */; }; - 91233627B367DDCF954A59BD /* Pods_Plugin.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = EA56ABF69C2A6DA5FFEF9CF1 /* Pods_Plugin.framework */; }; + A396A99536BCE6029D88F969 /* Pods_PluginTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 39CF867CF652175DD6EE32D1 /* Pods_PluginTests.framework */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -39,7 +39,8 @@ 07C03F2A2B4EE3A70095BC1A /* AbrevvaPluginCrypto.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AbrevvaPluginCrypto.h; sourceTree = ""; }; 07C03F2B2B4EE3A70095BC1A /* AbrevvaPluginCrypto.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AbrevvaPluginCrypto.swift; sourceTree = ""; }; 07C03F2C2B4EE3A70095BC1A /* AbrevvaPluginCrypto.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AbrevvaPluginCrypto.m; sourceTree = ""; }; - 2A32260820B1DA05173AA883 /* Pods-Plugin.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Plugin.debug.xcconfig"; path = "Target Support Files/Pods-Plugin/Pods-Plugin.debug.xcconfig"; sourceTree = ""; }; + 36AAFE69F1EE46F704AC5B65 /* Pods_Plugin.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Plugin.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 39CF867CF652175DD6EE32D1 /* Pods_PluginTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_PluginTests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 50ADFF88201F53D600D50D53 /* Plugin.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Plugin.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 50ADFF8B201F53D600D50D53 /* AbrevvaPluginBLE.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AbrevvaPluginBLE.h; sourceTree = ""; }; 50ADFF8C201F53D600D50D53 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; @@ -49,11 +50,10 @@ 50ADFFA52020D75100D50D53 /* Capacitor.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = Capacitor.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 50ADFFA72020EE4F00D50D53 /* AbrevvaPluginBLE.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AbrevvaPluginBLE.m; sourceTree = ""; }; 50E1A94720377CB70090CE1A /* AbrevvaPluginBLE.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AbrevvaPluginBLE.swift; sourceTree = ""; }; - 735F69DB1F8E84FD8D358E5D /* Pods-Plugin.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Plugin.release.xcconfig"; path = "Target Support Files/Pods-Plugin/Pods-Plugin.release.xcconfig"; sourceTree = ""; }; - 8FD5BB63FAF711B29C79DCBB /* Pods-PluginTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-PluginTests.debug.xcconfig"; path = "Target Support Files/Pods-PluginTests/Pods-PluginTests.debug.xcconfig"; sourceTree = ""; }; - BB89FCE0CDDEFE5D12469B61 /* Pods_PluginTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_PluginTests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - D415DFF8BA0EFCC9BE3B911B /* Pods-PluginTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-PluginTests.release.xcconfig"; path = "Target Support Files/Pods-PluginTests/Pods-PluginTests.release.xcconfig"; sourceTree = ""; }; - EA56ABF69C2A6DA5FFEF9CF1 /* Pods_Plugin.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Plugin.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 65AEDAD8DFBE6870B4EAFCE4 /* Pods-Plugin.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Plugin.debug.xcconfig"; path = "Target Support Files/Pods-Plugin/Pods-Plugin.debug.xcconfig"; sourceTree = ""; }; + 6A9D34E29D572394BEDD9850 /* Pods-PluginTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-PluginTests.debug.xcconfig"; path = "Target Support Files/Pods-PluginTests/Pods-PluginTests.debug.xcconfig"; sourceTree = ""; }; + 9DA7E0F87A8A9B1C453BA78D /* Pods-Plugin.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Plugin.release.xcconfig"; path = "Target Support Files/Pods-Plugin/Pods-Plugin.release.xcconfig"; sourceTree = ""; }; + C4181DB783D4E7CC707EB3EA /* Pods-PluginTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-PluginTests.release.xcconfig"; path = "Target Support Files/Pods-PluginTests/Pods-PluginTests.release.xcconfig"; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -62,7 +62,7 @@ buildActionMask = 2147483647; files = ( 50ADFFA42020D75100D50D53 /* Capacitor.framework in Frameworks */, - 91233627B367DDCF954A59BD /* Pods_Plugin.framework in Frameworks */, + 39215DE05972E348690FD2E8 /* Pods_Plugin.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -71,7 +71,7 @@ buildActionMask = 2147483647; files = ( 50ADFF92201F53D600D50D53 /* Plugin.framework in Frameworks */, - 0A8057F9DE1FC33B9CCB842E /* Pods_PluginTests.framework in Frameworks */, + A396A99536BCE6029D88F969 /* Pods_PluginTests.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -109,10 +109,10 @@ 187358A3D2584FA77C48359B /* Pods */ = { isa = PBXGroup; children = ( - 2A32260820B1DA05173AA883 /* Pods-Plugin.debug.xcconfig */, - 735F69DB1F8E84FD8D358E5D /* Pods-Plugin.release.xcconfig */, - 8FD5BB63FAF711B29C79DCBB /* Pods-PluginTests.debug.xcconfig */, - D415DFF8BA0EFCC9BE3B911B /* Pods-PluginTests.release.xcconfig */, + 65AEDAD8DFBE6870B4EAFCE4 /* Pods-Plugin.debug.xcconfig */, + 9DA7E0F87A8A9B1C453BA78D /* Pods-Plugin.release.xcconfig */, + 6A9D34E29D572394BEDD9850 /* Pods-PluginTests.debug.xcconfig */, + C4181DB783D4E7CC707EB3EA /* Pods-PluginTests.release.xcconfig */, ); path = Pods; sourceTree = ""; @@ -164,8 +164,8 @@ 072C8F802B5AAEA2009DC850 /* abrevva_ios_sdk.framework */, 072C8F7B2B5AA6CF009DC850 /* abrevva-ios-sdk.xcframework */, 50ADFFA52020D75100D50D53 /* Capacitor.framework */, - EA56ABF69C2A6DA5FFEF9CF1 /* Pods_Plugin.framework */, - BB89FCE0CDDEFE5D12469B61 /* Pods_PluginTests.framework */, + 36AAFE69F1EE46F704AC5B65 /* Pods_Plugin.framework */, + 39CF867CF652175DD6EE32D1 /* Pods_PluginTests.framework */, ); name = Frameworks; sourceTree = ""; @@ -189,7 +189,7 @@ isa = PBXNativeTarget; buildConfigurationList = 50ADFF9C201F53D600D50D53 /* Build configuration list for PBXNativeTarget "Plugin" */; buildPhases = ( - 28AF6F798B86912A884ADCA3 /* [CP] Check Pods Manifest.lock */, + AC93C5E55A32269E5E541DDA /* [CP] Check Pods Manifest.lock */, 50ADFF83201F53D600D50D53 /* Sources */, 50ADFF84201F53D600D50D53 /* Frameworks */, 50ADFF85201F53D600D50D53 /* Headers */, @@ -208,11 +208,11 @@ isa = PBXNativeTarget; buildConfigurationList = 50ADFF9F201F53D600D50D53 /* Build configuration list for PBXNativeTarget "PluginTests" */; buildPhases = ( - EB5F255553ACA19896D0E6F3 /* [CP] Check Pods Manifest.lock */, + B1BF91BF70DA07D44F2686DE /* [CP] Check Pods Manifest.lock */, 50ADFF8D201F53D600D50D53 /* Sources */, 50ADFF8E201F53D600D50D53 /* Frameworks */, 50ADFF8F201F53D600D50D53 /* Resources */, - B3040DDF032794F1D2BFBE88 /* [CP] Embed Pods Frameworks */, + 66EF9455F486E0F2A0F30052 /* [CP] Embed Pods Frameworks */, ); buildRules = ( ); @@ -230,7 +230,7 @@ 50ADFF7F201F53D600D50D53 /* Project object */ = { isa = PBXProject; attributes = { - LastSwiftUpdateCheck = 0920; + LastSwiftUpdateCheck = 1600; LastUpgradeCheck = 1160; ORGANIZATIONNAME = "Max Lynch"; TargetAttributes = { @@ -283,29 +283,7 @@ /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ - 28AF6F798B86912A884ADCA3 /* [CP] Check Pods Manifest.lock */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - ); - inputPaths = ( - "${PODS_PODFILE_DIR_PATH}/Podfile.lock", - "${PODS_ROOT}/Manifest.lock", - ); - name = "[CP] Check Pods Manifest.lock"; - outputFileListPaths = ( - ); - outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-Plugin-checkManifestLockResult.txt", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; - showEnvVarsInLog = 0; - }; - B3040DDF032794F1D2BFBE88 /* [CP] Embed Pods Frameworks */ = { + 66EF9455F486E0F2A0F30052 /* [CP] Embed Pods Frameworks */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( @@ -333,7 +311,29 @@ shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-PluginTests/Pods-PluginTests-frameworks.sh\"\n"; showEnvVarsInLog = 0; }; - EB5F255553ACA19896D0E6F3 /* [CP] Check Pods Manifest.lock */ = { + AC93C5E55A32269E5E541DDA /* [CP] Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; + outputFileListPaths = ( + ); + outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-Plugin-checkManifestLockResult.txt", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; + showEnvVarsInLog = 0; + }; + B1BF91BF70DA07D44F2686DE /* [CP] Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( @@ -516,12 +516,13 @@ }; 50ADFF9D201F53D600D50D53 /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 2A32260820B1DA05173AA883 /* Pods-Plugin.debug.xcconfig */; + baseConfigurationReference = 65AEDAD8DFBE6870B4EAFCE4 /* Pods-Plugin.debug.xcconfig */; buildSettings = { CLANG_ENABLE_MODULES = YES; - CODE_SIGN_IDENTITY = ""; + CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; DEFINES_MODULE = YES; + DEVELOPMENT_TEAM = 47Z5RC7U2C; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; @@ -542,21 +543,25 @@ PRODUCT_BUNDLE_IDENTIFIER = com.getcapacitor.Plugin; PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; SKIP_INSTALL = YES; + SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; SUPPORTS_MACCATALYST = NO; + SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO; + SUPPORTS_XR_DESIGNED_FOR_IPHONE_IPAD = NO; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_VERSION = 5.0; - TARGETED_DEVICE_FAMILY = "1,2"; + TARGETED_DEVICE_FAMILY = 1; }; name = Debug; }; 50ADFF9E201F53D600D50D53 /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 735F69DB1F8E84FD8D358E5D /* Pods-Plugin.release.xcconfig */; + baseConfigurationReference = 9DA7E0F87A8A9B1C453BA78D /* Pods-Plugin.release.xcconfig */; buildSettings = { CLANG_ENABLE_MODULES = YES; - CODE_SIGN_IDENTITY = ""; + CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; DEFINES_MODULE = YES; + DEVELOPMENT_TEAM = 47Z5RC7U2C; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; @@ -577,37 +582,50 @@ PRODUCT_BUNDLE_IDENTIFIER = com.getcapacitor.Plugin; PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; SKIP_INSTALL = YES; + SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; SUPPORTS_MACCATALYST = NO; + SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO; + SUPPORTS_XR_DESIGNED_FOR_IPHONE_IPAD = NO; SWIFT_VERSION = 5.0; - TARGETED_DEVICE_FAMILY = "1,2"; + TARGETED_DEVICE_FAMILY = 1; }; name = Release; }; 50ADFFA0201F53D600D50D53 /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 8FD5BB63FAF711B29C79DCBB /* Pods-PluginTests.debug.xcconfig */; + baseConfigurationReference = 6A9D34E29D572394BEDD9850 /* Pods-PluginTests.debug.xcconfig */; buildSettings = { CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = 47Z5RC7U2C; INFOPLIST_FILE = PluginTests/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.getcapacitor.PluginTests; PRODUCT_NAME = "$(TARGET_NAME)"; + SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; + SUPPORTS_MACCATALYST = NO; + SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO; + SUPPORTS_XR_DESIGNED_FOR_IPHONE_IPAD = NO; SWIFT_VERSION = 5.0; - TARGETED_DEVICE_FAMILY = "1,2"; + TARGETED_DEVICE_FAMILY = 1; }; name = Debug; }; 50ADFFA1201F53D600D50D53 /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = D415DFF8BA0EFCC9BE3B911B /* Pods-PluginTests.release.xcconfig */; + baseConfigurationReference = C4181DB783D4E7CC707EB3EA /* Pods-PluginTests.release.xcconfig */; buildSettings = { CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = 47Z5RC7U2C; INFOPLIST_FILE = PluginTests/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.getcapacitor.PluginTests; PRODUCT_NAME = "$(TARGET_NAME)"; + SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; + SUPPORTS_MACCATALYST = NO; + SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO; + SUPPORTS_XR_DESIGNED_FOR_IPHONE_IPAD = NO; SWIFT_VERSION = 5.0; - TARGETED_DEVICE_FAMILY = "1,2"; + TARGETED_DEVICE_FAMILY = 1; }; name = Release; }; diff --git a/ios/Plugin.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/ios/Plugin.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist deleted file mode 100644 index 18d9810..0000000 --- a/ios/Plugin.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +++ /dev/null @@ -1,8 +0,0 @@ - - - - - IDEDidComputeMac32BitWarning - - - diff --git a/ios/PluginTests/AbrevvaTests.swift b/ios/PluginTests/AbrevvaTests.swift index bcff4cc..97e577a 100644 --- a/ios/PluginTests/AbrevvaTests.swift +++ b/ios/PluginTests/AbrevvaTests.swift @@ -1,6 +1,9 @@ -@testable import Plugin +import Capacitor +import AbrevvaSDK import XCTest +@testable import Plugin + class AbrevvaTests: XCTestCase { func testEcho() { diff --git a/ios/Podfile b/ios/Podfile index f0f32b2..8552ffd 100644 --- a/ios/Podfile +++ b/ios/Podfile @@ -25,6 +25,8 @@ post_install do |installer| installer.pods_project.targets.each do |target| target.build_configurations.each do |config| config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = $deploymentTargetVersion + # https://github.com/CocoaPods/CocoaPods/issues/11079#issuecomment-984670700 + config.build_settings['BUILD_LIBRARY_FOR_DISTRIBUTION'] = 'YES' end end end From 502d2b39a87f31e39443111c1bcd1f46c8ac1965 Mon Sep 17 00:00:00 2001 From: codepushr <1425202+codepushr@users.noreply.github.com> Date: Thu, 26 Sep 2024 10:46:11 +0200 Subject: [PATCH 05/11] build: update actions --- .github/workflows/build.yml | 27 ++++++++++++ .github/workflows/test.yml | 87 ++++++++++++++++++------------------- 2 files changed, 69 insertions(+), 45 deletions(-) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..a1da0ef --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,27 @@ +name: build +on: + push: + branches: [ 'main' ] + pull_request: + branches: [ 'main' ] +jobs: + build_web: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Install Node.js + uses: actions/setup-node@v4 + with: + node-version: lts/* + - name: Cache node_modules + id: node-modules + uses: actions/cache@v4 + with: + path: | + node_modules + key: node-modules + - name: Npm Install + run: npm i + - name: Run Build + run: npm run verify:web + diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 04cd20f..f4b4612 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -9,33 +9,19 @@ jobs: runs-on: macos-latest steps: - uses: actions/checkout@v4 - - uses: ruby/setup-ruby@v1 + - name: Install Node.js + uses: actions/setup-node@v4 + with: + node-version: lts/* + - name: Install Ruby + uses: ruby/setup-ruby@v1 with: ruby-version: '3.3' bundler-cache: true - - uses: SwiftyLab/setup-swift@latest + - name: Install Swift + uses: SwiftyLab/setup-swift@latest with: swift-version: '5.10.0' - - name: Get Swift Version - run: swift --version - - name: Get Xcode version - env: - DEVELOPER_DIR: /Applications/Xcode_15.4.app - run: xcodebuild -version - - name: Cache Pods - id: pods - uses: actions/cache@v4 - with: - path: example/ios/Pods - key: pods-cache--${{ hashFiles('example/ios/podfile.lock') }} - - name: Cache Xcode DerivedData - uses: irgaly/xcode-cache@v1.7.2 - with: - key: xcode-deriveddata - - name: Install Node.js - uses: actions/setup-node@v4 - with: - node-version: lts/* - name: Cache node_modules id: node-modules uses: actions/cache@v4 @@ -43,11 +29,23 @@ jobs: path: | node_modules key: node-modules + - name: Cache Pods + id: pods + uses: actions/cache@v4 + with: + path: | + ios/Pods + key: pods + - name: Cache Xcode + uses: irgaly/xcode-cache@v1.7.2 + with: + key: xcode-deriveddata + restore-keys: xcode-deriveddata + - name: Npm Install + run: npm i - name: Pod Install run: cd ios; pod install; cd - - - name: NPM Install - run: npm i - - name: Test iOS + - name: Run Tests env: DEVELOPER_DIR: /Applications/Xcode_15.4.app run: | @@ -63,19 +61,34 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - name: Set up JDK 17 + - name: Install Node.js + uses: actions/setup-node@v4 + with: + node-version: lts/* + - name: Install JDK uses: actions/setup-java@v3 with: java-version: '17' distribution: 'temurin' - name: Install Android SDK uses: android-actions/setup-android@v3 + - name: Enable KVM + run: | + echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules + sudo udevadm control --reload-rules + sudo udevadm trigger --name-match=kvm + - name: Cache node_modules + id: node-modules + uses: actions/cache@v4 + with: + path: | + node_modules + key: node-modules - name: Cache Gradle uses: actions/cache@v4 with: path: | android/.gradle - test-app/android/.gradle ~/.gradle/caches key: gradle - name: Cache Android SDK @@ -84,11 +97,6 @@ jobs: with: path: ~/Android/Sdk key: android-sdk - - name: Enable KVM - run: | - echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules - sudo udevadm control --reload-rules - sudo udevadm trigger --name-match=kvm - name: Cache AVD uses: actions/cache@v4 id: avd-cache @@ -97,20 +105,9 @@ jobs: ~/.android/avd/* ~/.android/adb* key: avd-29 - - name: Install Node.js - uses: actions/setup-node@v4 - with: - node-version: lts/* - - name: Cache node_modules - id: node-modules - uses: actions/cache@v4 - with: - path: | - node_modules - key: node-modules - - name: NPM Install + - name: Npm Install run: npm i - - name: Test Android + - name: Run Tests uses: reactivecircus/android-emulator-runner@v2 with: api-level: 29 From a7e7a2f36a36026d0e47f057cb9b4c3533468c00 Mon Sep 17 00:00:00 2001 From: codepushr <1425202+codepushr@users.noreply.github.com> Date: Thu, 26 Sep 2024 11:05:42 +0200 Subject: [PATCH 06/11] build: add build step for ios --- .github/workflows/build.yml | 43 ++++++++++++++++++++++++++++++++++++- 1 file changed, 42 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a1da0ef..bd391bb 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -24,4 +24,45 @@ jobs: run: npm i - name: Run Build run: npm run verify:web - + build_ios: + runs-on: macos-latest + steps: + - uses: actions/checkout@v4 + - name: Install Node.js + uses: actions/setup-node@v4 + with: + node-version: lts/* + - name: Install Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: '3.3' + bundler-cache: true + - name: Install Swift + uses: SwiftyLab/setup-swift@latest + with: + swift-version: '5.10.0' + - name: Cache node_modules + id: node-modules + uses: actions/cache@v4 + with: + path: | + node_modules + key: node-modules + - name: Cache Pods + id: pods + uses: actions/cache@v4 + with: + path: | + ios/Pods + key: pods + - name: Cache Xcode + uses: irgaly/xcode-cache@v1.7.2 + with: + key: xcode-deriveddata + restore-keys: xcode-deriveddata + - name: Npm Install + run: npm i + - name: Run Build + env: + DEVELOPER_DIR: /Applications/Xcode_15.4.app + run: npm run verify:ios From ed1366975d3aebfea44261daa2b663c120702e60 Mon Sep 17 00:00:00 2001 From: codepushr <1425202+codepushr@users.noreply.github.com> Date: Thu, 26 Sep 2024 11:14:49 +0200 Subject: [PATCH 07/11] build: use simulator for build --- .github/workflows/build.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index bd391bb..b8d920a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -62,7 +62,15 @@ jobs: restore-keys: xcode-deriveddata - name: Npm Install run: npm i + - name: Pod Install + run: cd ios; pod install; cd - - name: Run Build env: DEVELOPER_DIR: /Applications/Xcode_15.4.app - run: npm run verify:ios + run: | + cd ios + xcodebuild \ + -quiet \ + -workspace Plugin.xcworkspace \ + -scheme Plugin \ + -destination 'platform=iOS Simulator,name=iPhone 15,OS=17.4' From e4d5981563121e878de35cc650036b2a9f323831 Mon Sep 17 00:00:00 2001 From: codepushr <1425202+codepushr@users.noreply.github.com> Date: Thu, 26 Sep 2024 13:06:01 +0200 Subject: [PATCH 08/11] build: add android build stage --- .github/workflows/build.yml | 39 +++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b8d920a..eb13994 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -74,3 +74,42 @@ jobs: -workspace Plugin.xcworkspace \ -scheme Plugin \ -destination 'platform=iOS Simulator,name=iPhone 15,OS=17.4' + test_android: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Install Node.js + uses: actions/setup-node@v4 + with: + node-version: lts/* + - name: Install JDK + uses: actions/setup-java@v3 + with: + java-version: '17' + distribution: 'temurin' + - name: Install Android SDK + uses: android-actions/setup-android@v3 + - name: Cache node_modules + id: node-modules + uses: actions/cache@v4 + with: + path: | + node_modules + key: node-modules + - name: Cache Gradle + uses: actions/cache@v4 + with: + path: | + android/.gradle + ~/.gradle/caches + key: gradle + - name: Cache Android SDK + id: aandroid-sdk + uses: actions/cache@v4 + with: + path: ~/Android/Sdk + key: android-sdk + - name: Npm Install + run: npm i + - name: Run Build + run: npm run verify:android From 786ef9a55b9508ec164c7ef675f9850e4dc1f5a2 Mon Sep 17 00:00:00 2001 From: codepushr <1425202+codepushr@users.noreply.github.com> Date: Thu, 26 Sep 2024 13:32:16 +0200 Subject: [PATCH 09/11] build: streamline actions into setup scripts --- .../capacitor-setup-android/action.yml | 51 +++++++++++ .../actions/capacitor-setup-ios/action.yml | 43 +++++++++ .../actions/capacitor-setup-web/action.yml | 18 ++++ .github/workflows/build.yml | 88 ++----------------- .github/workflows/test.yml | 86 +----------------- 5 files changed, 122 insertions(+), 164 deletions(-) create mode 100644 .github/actions/capacitor-setup-android/action.yml create mode 100644 .github/actions/capacitor-setup-ios/action.yml create mode 100644 .github/actions/capacitor-setup-web/action.yml diff --git a/.github/actions/capacitor-setup-android/action.yml b/.github/actions/capacitor-setup-android/action.yml new file mode 100644 index 0000000..5f6c431 --- /dev/null +++ b/.github/actions/capacitor-setup-android/action.yml @@ -0,0 +1,51 @@ +name: 'capacitor-setup-android' +description: '' +runs: + using: 'composite' + steps: + - name: Install Node.js + uses: actions/setup-node@v4 + with: + node-version: lts/* + - name: Install JDK + uses: actions/setup-java@v3 + with: + java-version: '17' + distribution: 'temurin' + - name: Install Android SDK + uses: android-actions/setup-android@v3 + - name: Enable KVM + run: | + echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules + sudo udevadm control --reload-rules + sudo udevadm trigger --name-match=kvm + - name: Cache node_modules + id: node-modules + uses: actions/cache@v4 + with: + path: | + node_modules + key: node-modules + - name: Cache Gradle + uses: actions/cache@v4 + with: + path: | + android/.gradle + ~/.gradle/caches + key: gradle + - name: Cache Android SDK + id: aandroid-sdk + uses: actions/cache@v4 + with: + path: ~/Android/Sdk + key: android-sdk + - name: Cache AVD + uses: actions/cache@v4 + id: avd-cache + with: + path: | + ~/.android/avd/* + ~/.android/adb* + key: avd-29 + - name: Npm Install + run: npm i diff --git a/.github/actions/capacitor-setup-ios/action.yml b/.github/actions/capacitor-setup-ios/action.yml new file mode 100644 index 0000000..53e8194 --- /dev/null +++ b/.github/actions/capacitor-setup-ios/action.yml @@ -0,0 +1,43 @@ +name: 'capacitor-setup-ios' +description: '' +runs: + using: 'composite' + steps: + - name: Install Node.js + uses: actions/setup-node@v4 + with: + node-version: lts/* + - name: Install Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: '3.3' + bundler-cache: true + - name: Install Swift + uses: SwiftyLab/setup-swift@latest + with: + swift-version: '5.10.0' + - name: Cache node_modules + id: node-modules + uses: actions/cache@v4 + with: + path: | + node_modules + key: node-modules + - name: Cache Pods + id: pods + uses: actions/cache@v4 + with: + path: | + ios/Pods + key: pods + - name: Cache Xcode + uses: irgaly/xcode-cache@v1.7.2 + with: + key: xcode-deriveddata + restore-keys: xcode-deriveddata + - name: Npm Install + shell: bash + run: npm i + - name: Pod Install + shell: bash + run: cd ios; pod install; cd - diff --git a/.github/actions/capacitor-setup-web/action.yml b/.github/actions/capacitor-setup-web/action.yml new file mode 100644 index 0000000..2e32fbf --- /dev/null +++ b/.github/actions/capacitor-setup-web/action.yml @@ -0,0 +1,18 @@ +name: 'capacitor-setup-web' +description: '' +runs: + using: 'composite' + steps: + - name: Install Node.js + uses: actions/setup-node@v4 + with: + node-version: lts/* + - name: Cache node_modules + id: node-modules + uses: actions/cache@v4 + with: + path: | + node_modules + key: node-modules + - name: Npm Install + run: npm i diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index eb13994..d7128b6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -9,61 +9,16 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - name: Install Node.js - uses: actions/setup-node@v4 - with: - node-version: lts/* - - name: Cache node_modules - id: node-modules - uses: actions/cache@v4 - with: - path: | - node_modules - key: node-modules - - name: Npm Install - run: npm i + - name: Setup Capacitor iOS + uses: ./.github/actions/capacitor-setup-web - name: Run Build run: npm run verify:web build_ios: runs-on: macos-latest steps: - uses: actions/checkout@v4 - - name: Install Node.js - uses: actions/setup-node@v4 - with: - node-version: lts/* - - name: Install Ruby - uses: ruby/setup-ruby@v1 - with: - ruby-version: '3.3' - bundler-cache: true - - name: Install Swift - uses: SwiftyLab/setup-swift@latest - with: - swift-version: '5.10.0' - - name: Cache node_modules - id: node-modules - uses: actions/cache@v4 - with: - path: | - node_modules - key: node-modules - - name: Cache Pods - id: pods - uses: actions/cache@v4 - with: - path: | - ios/Pods - key: pods - - name: Cache Xcode - uses: irgaly/xcode-cache@v1.7.2 - with: - key: xcode-deriveddata - restore-keys: xcode-deriveddata - - name: Npm Install - run: npm i - - name: Pod Install - run: cd ios; pod install; cd - + - name: Setup Capacitor iOS + uses: ./.github/actions/capacitor-setup-ios - name: Run Build env: DEVELOPER_DIR: /Applications/Xcode_15.4.app @@ -78,38 +33,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - name: Install Node.js - uses: actions/setup-node@v4 - with: - node-version: lts/* - - name: Install JDK - uses: actions/setup-java@v3 - with: - java-version: '17' - distribution: 'temurin' - - name: Install Android SDK - uses: android-actions/setup-android@v3 - - name: Cache node_modules - id: node-modules - uses: actions/cache@v4 - with: - path: | - node_modules - key: node-modules - - name: Cache Gradle - uses: actions/cache@v4 - with: - path: | - android/.gradle - ~/.gradle/caches - key: gradle - - name: Cache Android SDK - id: aandroid-sdk - uses: actions/cache@v4 - with: - path: ~/Android/Sdk - key: android-sdk - - name: Npm Install - run: npm i + - name: Setup Capacitor Android + uses: ./.github/actions/capacitor-setup-android - name: Run Build run: npm run verify:android diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f4b4612..74796ba 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -9,42 +9,8 @@ jobs: runs-on: macos-latest steps: - uses: actions/checkout@v4 - - name: Install Node.js - uses: actions/setup-node@v4 - with: - node-version: lts/* - - name: Install Ruby - uses: ruby/setup-ruby@v1 - with: - ruby-version: '3.3' - bundler-cache: true - - name: Install Swift - uses: SwiftyLab/setup-swift@latest - with: - swift-version: '5.10.0' - - name: Cache node_modules - id: node-modules - uses: actions/cache@v4 - with: - path: | - node_modules - key: node-modules - - name: Cache Pods - id: pods - uses: actions/cache@v4 - with: - path: | - ios/Pods - key: pods - - name: Cache Xcode - uses: irgaly/xcode-cache@v1.7.2 - with: - key: xcode-deriveddata - restore-keys: xcode-deriveddata - - name: Npm Install - run: npm i - - name: Pod Install - run: cd ios; pod install; cd - + - name: Setup Capacitor iOS + uses: ./.github/actions/capacitor-setup-ios - name: Run Tests env: DEVELOPER_DIR: /Applications/Xcode_15.4.app @@ -61,52 +27,8 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - name: Install Node.js - uses: actions/setup-node@v4 - with: - node-version: lts/* - - name: Install JDK - uses: actions/setup-java@v3 - with: - java-version: '17' - distribution: 'temurin' - - name: Install Android SDK - uses: android-actions/setup-android@v3 - - name: Enable KVM - run: | - echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules - sudo udevadm control --reload-rules - sudo udevadm trigger --name-match=kvm - - name: Cache node_modules - id: node-modules - uses: actions/cache@v4 - with: - path: | - node_modules - key: node-modules - - name: Cache Gradle - uses: actions/cache@v4 - with: - path: | - android/.gradle - ~/.gradle/caches - key: gradle - - name: Cache Android SDK - id: aandroid-sdk - uses: actions/cache@v4 - with: - path: ~/Android/Sdk - key: android-sdk - - name: Cache AVD - uses: actions/cache@v4 - id: avd-cache - with: - path: | - ~/.android/avd/* - ~/.android/adb* - key: avd-29 - - name: Npm Install - run: npm i + - name: Setup Capacitor Android + uses: ./.github/actions/capacitor-setup-android - name: Run Tests uses: reactivecircus/android-emulator-runner@v2 with: From ea2994571745b4eb032909ca2ad11a8b6e146467 Mon Sep 17 00:00:00 2001 From: codepushr <1425202+codepushr@users.noreply.github.com> Date: Thu, 26 Sep 2024 13:45:25 +0200 Subject: [PATCH 10/11] build: add missing shell property --- .github/actions/capacitor-setup-android/action.yml | 1 + .github/actions/capacitor-setup-web/action.yml | 1 + 2 files changed, 2 insertions(+) diff --git a/.github/actions/capacitor-setup-android/action.yml b/.github/actions/capacitor-setup-android/action.yml index 5f6c431..b397e24 100644 --- a/.github/actions/capacitor-setup-android/action.yml +++ b/.github/actions/capacitor-setup-android/action.yml @@ -48,4 +48,5 @@ runs: ~/.android/adb* key: avd-29 - name: Npm Install + shell: bash run: npm i diff --git a/.github/actions/capacitor-setup-web/action.yml b/.github/actions/capacitor-setup-web/action.yml index 2e32fbf..932830a 100644 --- a/.github/actions/capacitor-setup-web/action.yml +++ b/.github/actions/capacitor-setup-web/action.yml @@ -15,4 +15,5 @@ runs: node_modules key: node-modules - name: Npm Install + shell: bash run: npm i From 41c1d577b355db58d8b3574f45b2e72d68d0d72f Mon Sep 17 00:00:00 2001 From: codepushr <1425202+codepushr@users.noreply.github.com> Date: Thu, 26 Sep 2024 13:51:55 +0200 Subject: [PATCH 11/11] build: fix naming and missing shell property --- .github/actions/capacitor-setup-android/action.yml | 3 ++- .github/workflows/build.yml | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/actions/capacitor-setup-android/action.yml b/.github/actions/capacitor-setup-android/action.yml index b397e24..0549a89 100644 --- a/.github/actions/capacitor-setup-android/action.yml +++ b/.github/actions/capacitor-setup-android/action.yml @@ -15,6 +15,7 @@ runs: - name: Install Android SDK uses: android-actions/setup-android@v3 - name: Enable KVM + shell: bash run: | echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules sudo udevadm control --reload-rules @@ -34,7 +35,7 @@ runs: ~/.gradle/caches key: gradle - name: Cache Android SDK - id: aandroid-sdk + id: android-sdk uses: actions/cache@v4 with: path: ~/Android/Sdk diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d7128b6..f44fc54 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -29,7 +29,7 @@ jobs: -workspace Plugin.xcworkspace \ -scheme Plugin \ -destination 'platform=iOS Simulator,name=iPhone 15,OS=17.4' - test_android: + build_android: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4