You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by er...@apache.org on 2021/09/03 17:36:10 UTC

[cordova-paramedic] branch master updated: ci(gh-actions): add test strategy matrix (#216)

This is an automated email from the ASF dual-hosted git repository.

erisu pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cordova-paramedic.git


The following commit(s) were added to refs/heads/master by this push:
     new bd12619  ci(gh-actions): add test strategy matrix (#216)
bd12619 is described below

commit bd1261972c842f61ae32d5447df39697f7c9b323
Author: エリス <er...@users.noreply.github.com>
AuthorDate: Sat Sep 4 02:36:07 2021 +0900

    ci(gh-actions): add test strategy matrix (#216)
---
 .github/workflows/android.yml                      | 89 ++++++++++++++++++----
 .github/workflows/chrome.yml                       | 30 ++++++--
 .github/workflows/ios.yml                          | 53 +++++++++----
 ...droid-11.config.json => android-10.config.json} |  2 +-
 conf/pr/local/android-11.config.json               |  2 +-
 conf/pr/local/android-5.1.config.json              |  3 +-
 ...ndroid-11.config.json => android-6.config.json} |  2 +-
 ...roid-11.config.json => android-7.1.config.json} |  2 +-
 ...ndroid-11.config.json => android-7.config.json} |  2 +-
 ...roid-11.config.json => android-8.1.config.json} |  2 +-
 ...ndroid-11.config.json => android-8.config.json} |  2 +-
 ...ndroid-11.config.json => android-9.config.json} |  2 +-
 ...ndroid-5.1.config.json => ios-12.x.config.json} |  3 +-
 ...ndroid-5.1.config.json => ios-13.x.config.json} |  3 +-
 ...ndroid-5.1.config.json => ios-14.x.config.json} |  3 +-
 paramedic-plugin/package-lock.json                 | 63 +++++++++++++++
 16 files changed, 215 insertions(+), 48 deletions(-)

diff --git a/.github/workflows/android.yml b/.github/workflows/android.yml
index f3a6bb1..d72b098 100644
--- a/.github/workflows/android.yml
+++ b/.github/workflows/android.yml
@@ -21,18 +21,58 @@ on: [push, pull_request]
 
 jobs:
   test:
-    name: Android Latest Test
+    name: Android ${{ matrix.versions.android }} Test
     runs-on: macos-latest
 
     # hoist configurations to top that are expected to be updated
     env:
+      # Storing a copy of the repo
+      repo: ${{ github.event.pull_request.head.repo.full_name || github.repository }}
+
       node-version: 16
-      java-version: 11
-      java-distro: 'adopt'
-      android-api: 30
 
-      # E.g. android-11 from the file: ./pr/local/android-11.config.json
-      target-test: android-11
+      # These are the default Java configurations used by most tests.
+      # To customize these options, add "java-distro" or "java-version" to the strategy matrix with its overriding value.
+      default_java-distro: adopt
+      default_java-version: 8
+
+      # These are the default Android System Image configurations used by most tests.
+      # To customize these options, add "system-image-arch" or "system-image-target" to the strategy matrix with its overriding value.
+      default_system-image-arch: x86_64
+      default_system-image-target: google_apis # Most system images have a google_api option. Set this as default.
+
+    # configurations for each testing strategy (test matrix)
+    strategy:
+      matrix:
+        versions:
+          - android: 5.1
+            android-api: 22
+
+          - android: 6
+            android-api: 23
+
+          - android: 7
+            android-api: 24
+
+          - android: 7.1
+            android-api: 25
+
+          - android: 8
+            android-api: 26
+
+          - android: 8.1
+            android-api: 27
+            system-image-target: default
+
+          - android: 9
+            android-api: 28
+
+          - android: 10
+            android-api: 29
+
+          - android: 11
+            android-api: 30
+            java-version: 11
 
     timeout-minutes: 60
 
@@ -42,6 +82,9 @@ jobs:
         with:
           node-version: ${{ env.node-version }}
       - uses: actions/setup-java@v2
+        env:
+          java-version: ${{ matrix.versions.java-version == '' && env.default_java-version || matrix.versions.java-version }}
+          java-distro: ${{ matrix.versions.java-distro == '' && env.default_java-distro || matrix.versions.java-distro }}
         with:
           distribution: ${{ env.java-distro }}
           java-version: ${{ env.java-version }}
@@ -56,26 +99,40 @@ jobs:
         run: |
           export PATH="/usr/local/lib/android/sdk/platform-tools":$PATH
           export JAVA_HOME=$JAVA_HOME_11_X64
-          npm i -g cordova
+          npm i -g cordova@latest
           npm ci
 
-      - uses: reactivecircus/android-emulator-runner@v2
+      - name: Run paramedic install
+        if: ${{ endswith(env.repo, '/cordova-paramedic') != true }}
+        run: npm i -g github:apache/cordova-paramedic
+
+      - uses: reactivecircus/android-emulator-runner@5de26e4bd23bf523e8a4b7f077df8bfb8e52b50e
+        env:
+          system-image-arch: ${{ matrix.versions.system-image-arch == '' && env.default_system-image-arch || matrix.versions.system-image-arch }}
+          system-image-target: ${{ matrix.versions.system-image-target == '' && env.default_system-image-target || matrix.versions.system-image-target }}
         with:
-          api-level: ${{ env.android-api }}
-          target: google_apis
-          arch: x86_64
+          api-level: ${{ matrix.versions.android-api }}
+          target: ${{ env.system-image-target }}
+          arch: ${{ env.system-image-arch }}
           force-avd-creation: false
           disable-animations: false
           emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim
           script: echo "Pregenerate the AVD before running Paramedic"
 
       - name: Run paramedic tests
-        uses: reactivecircus/android-emulator-runner@v2
+        uses: reactivecircus/android-emulator-runner@5de26e4bd23bf523e8a4b7f077df8bfb8e52b50e
+        env:
+          system-image-arch: ${{ matrix.versions.system-image-arch == '' && env.default_system-image-arch || matrix.versions.system-image-arch }}
+          system-image-target: ${{ matrix.versions.system-image-target == '' && env.default_system-image-target || matrix.versions.system-image-target }}
+          test_config: 'android-${{ matrix.versions.android }}.config.json'
+          # Generally, this should automatically work for cordova-paramedic & plugins. If the path is unique, this can be manually changed.
+          test_plugin_path: ${{ endswith(env.repo, '/cordova-paramedic') && './spec/testable-plugin/' || './' }}
+          paramedic: ${{ endswith(env.repo, '/cordova-paramedic') && 'node main.js' || 'cordova-paramedic' }}
         with:
-          api-level: ${{ env.android-api }}
-          target: google_apis
-          arch: x86_64
+          api-level: ${{ matrix.versions.android-api }}
+          target: ${{ env.system-image-target }}
+          arch: ${{ env.system-image-arch }}
           force-avd-creation: false
           disable-animations: false
           emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim
-          script: node main.js --config ./pr/local/${{ env.target-test }}.config.json  --plugin ./spec/testable-plugin/
+          script: ${{ env.paramedic }} --config ./pr/local/${{ env.test_config }} --plugin ${{ env.test_plugin_path }}
diff --git a/.github/workflows/chrome.yml b/.github/workflows/chrome.yml
index f19e498..7788410 100644
--- a/.github/workflows/chrome.yml
+++ b/.github/workflows/chrome.yml
@@ -24,22 +24,40 @@ jobs:
     name: Chrome Latest Test
     runs-on: ubuntu-latest
 
+    # hoist configurations to top that are expected to be updated
+    env:
+      # Storing a copy of the repo
+      repo: ${{ github.event.pull_request.head.repo.full_name || github.repository }}
+
+      node-version: 16
+
     steps:
       - uses: actions/checkout@v2
       - uses: actions/setup-node@v2
         with:
-          node-version: 16
+          node-version: ${{ env.node-version }}
 
-      - name: Install xvfb
+      - name: Run install xvfb
         run: sudo apt-get install xvfb
 
-      - name: Environment Information
+      - name: Run Environment Information
         run: |
           node --version
           npm --version
 
-      - name: npm install and test
+      - name: Run npm install
         run: |
-          npm i -g cordova
+          npm i -g cordova@latest
           npm ci
-          xvfb-run --auto-servernum node main.js --config ./pr/local/browser.config.json  --plugin ./spec/testable-plugin/
+
+      - name: Run paramedic install
+        if: ${{ endswith(env.repo, '/cordova-paramedic') != true }}
+        run: npm i -g github:apache/cordova-paramedic
+
+      - name: Run paramedic tests
+        env:
+          test_config: 'browser.config.json'
+          # Generally, this should automatically work for cordova-paramedic & plugins. If the path is unique, this can be manually changed.
+          test_plugin_path: ${{ endswith(env.repo, '/cordova-paramedic') && './spec/testable-plugin/' || './' }}
+          paramedic: ${{ endswith(env.repo, '/cordova-paramedic') && 'node main.js' || 'cordova-paramedic' }}
+        run: xvfb-run --auto-servernum ${{ env.paramedic }} --config ./pr/local/${{ env.test_config }} --plugin ${{ env.test_plugin_path }}
diff --git a/.github/workflows/ios.yml b/.github/workflows/ios.yml
index 771e61c..be4148b 100644
--- a/.github/workflows/ios.yml
+++ b/.github/workflows/ios.yml
@@ -21,33 +21,58 @@ on: [push, pull_request]
 
 jobs:
   test:
-    name: iOS ${{ matrix.versions.ios }}
+    name: iOS ${{ matrix.versions.ios-version }} Test
     runs-on: macos-latest
+
+    # hoist configurations to top that are expected to be updated
+    env:
+      # Storing a copy of the repo
+      repo: ${{ github.event.pull_request.head.repo.full_name || github.repository }}
+
+      node-version: 16
+
+      # > Starting April 26, 2021, all iOS and iPadOS apps submitted to the App Store must be built with Xcode 12 and the iOS 14 SDK.
+      # Because of Apple's requirement, listed above, We will only be using the latest Xcode release for testing.
+      # To customize these options, add "xcode-version" to the strategy matrix with its overriding value.
+      default_xcode-version: latest-stable
+
     strategy:
       matrix:
         versions:
-          - ios: 13.6
-            xcode: 11.6
+          - ios-version: 12.x
+          - ios-version: 13.x
+          - ios-version: 14.x
 
     steps:
       - uses: actions/checkout@v2
-
-      - uses: maxim-lobanov/setup-xcode@v1.1
+      - uses: actions/setup-node@v2
         with:
-          xcode-version: ${{ matrix.versions.xcode }}
-
-      - name: Use Node.js 12
-        uses: actions/setup-node@v1
+          node-version: ${{ env.node-version }}
+      - uses: maxim-lobanov/setup-xcode@881be567d30efed8fb3f12b5099d68c3fb72aa3d
+        env:
+          xcode-version: ${{ matrix.versions.xcode-version == '' && env.default_xcode-version || matrix.versions.xcode-version }}
         with:
-          node-version: 12
+          xcode-version: ${{ env.xcode-version }}
 
-      - name: Environment Information
+      - name: Run Environment Information
         run: |
           node --version
           npm --version
+          xcodebuild -version
 
-      - name: npm install and test
+      - name: Run npm install
         run: |
-          npm i -g cordova ios-deploy
+          npm i -g cordova@latest ios-deploy@latest
           npm ci
-          node main.js --config ./pr/local/ios-13.6.config.json  --plugin ./spec/testable-plugin/
+
+      - name: Run paramedic install
+        if: ${{ endswith(env.repo, '/cordova-paramedic') != true }}
+        run: npm i -g github:apache/cordova-paramedic
+
+      - name: Run paramedic tests
+        env:
+          test_config: 'ios-${{ matrix.versions.ios-version }}.config.json'
+          # Generally, this should automatically work for cordova-paramedic & plugins. If the path is unique, this can be manually changed.
+          test_plugin_path: ${{ endswith(env.repo, '/cordova-paramedic') && './spec/testable-plugin/' || './' }}
+          paramedic: ${{ endswith(env.repo, '/cordova-paramedic') && 'node main.js' || 'cordova-paramedic' }}
+        run: ${{ env.paramedic }} --config ./pr/local/${{ env.test_config }} --plugin ${{ env.test_plugin_path }}
diff --git a/conf/pr/local/android-11.config.json b/conf/pr/local/android-10.config.json
similarity index 74%
copy from conf/pr/local/android-11.config.json
copy to conf/pr/local/android-10.config.json
index 85b93ee..c3fecfa 100644
--- a/conf/pr/local/android-11.config.json
+++ b/conf/pr/local/android-10.config.json
@@ -1,5 +1,5 @@
 {
-    "platform": "android@nightly",
+    "platform": "android@latest",
     "action": "run",
     "cleanUpAfterRun": true,
     "verbose": true,
diff --git a/conf/pr/local/android-11.config.json b/conf/pr/local/android-11.config.json
index 85b93ee..c3fecfa 100644
--- a/conf/pr/local/android-11.config.json
+++ b/conf/pr/local/android-11.config.json
@@ -1,5 +1,5 @@
 {
-    "platform": "android@nightly",
+    "platform": "android@latest",
     "action": "run",
     "cleanUpAfterRun": true,
     "verbose": true,
diff --git a/conf/pr/local/android-5.1.config.json b/conf/pr/local/android-5.1.config.json
index 1bca536..c3fecfa 100644
--- a/conf/pr/local/android-5.1.config.json
+++ b/conf/pr/local/android-5.1.config.json
@@ -2,5 +2,6 @@
     "platform": "android@latest",
     "action": "run",
     "cleanUpAfterRun": true,
-    "verbose": true
+    "verbose": true,
+    "skipAppiumTests": true
 }
diff --git a/conf/pr/local/android-11.config.json b/conf/pr/local/android-6.config.json
similarity index 74%
copy from conf/pr/local/android-11.config.json
copy to conf/pr/local/android-6.config.json
index 85b93ee..c3fecfa 100644
--- a/conf/pr/local/android-11.config.json
+++ b/conf/pr/local/android-6.config.json
@@ -1,5 +1,5 @@
 {
-    "platform": "android@nightly",
+    "platform": "android@latest",
     "action": "run",
     "cleanUpAfterRun": true,
     "verbose": true,
diff --git a/conf/pr/local/android-11.config.json b/conf/pr/local/android-7.1.config.json
similarity index 74%
copy from conf/pr/local/android-11.config.json
copy to conf/pr/local/android-7.1.config.json
index 85b93ee..c3fecfa 100644
--- a/conf/pr/local/android-11.config.json
+++ b/conf/pr/local/android-7.1.config.json
@@ -1,5 +1,5 @@
 {
-    "platform": "android@nightly",
+    "platform": "android@latest",
     "action": "run",
     "cleanUpAfterRun": true,
     "verbose": true,
diff --git a/conf/pr/local/android-11.config.json b/conf/pr/local/android-7.config.json
similarity index 74%
copy from conf/pr/local/android-11.config.json
copy to conf/pr/local/android-7.config.json
index 85b93ee..c3fecfa 100644
--- a/conf/pr/local/android-11.config.json
+++ b/conf/pr/local/android-7.config.json
@@ -1,5 +1,5 @@
 {
-    "platform": "android@nightly",
+    "platform": "android@latest",
     "action": "run",
     "cleanUpAfterRun": true,
     "verbose": true,
diff --git a/conf/pr/local/android-11.config.json b/conf/pr/local/android-8.1.config.json
similarity index 74%
copy from conf/pr/local/android-11.config.json
copy to conf/pr/local/android-8.1.config.json
index 85b93ee..c3fecfa 100644
--- a/conf/pr/local/android-11.config.json
+++ b/conf/pr/local/android-8.1.config.json
@@ -1,5 +1,5 @@
 {
-    "platform": "android@nightly",
+    "platform": "android@latest",
     "action": "run",
     "cleanUpAfterRun": true,
     "verbose": true,
diff --git a/conf/pr/local/android-11.config.json b/conf/pr/local/android-8.config.json
similarity index 74%
copy from conf/pr/local/android-11.config.json
copy to conf/pr/local/android-8.config.json
index 85b93ee..c3fecfa 100644
--- a/conf/pr/local/android-11.config.json
+++ b/conf/pr/local/android-8.config.json
@@ -1,5 +1,5 @@
 {
-    "platform": "android@nightly",
+    "platform": "android@latest",
     "action": "run",
     "cleanUpAfterRun": true,
     "verbose": true,
diff --git a/conf/pr/local/android-11.config.json b/conf/pr/local/android-9.config.json
similarity index 74%
copy from conf/pr/local/android-11.config.json
copy to conf/pr/local/android-9.config.json
index 85b93ee..c3fecfa 100644
--- a/conf/pr/local/android-11.config.json
+++ b/conf/pr/local/android-9.config.json
@@ -1,5 +1,5 @@
 {
-    "platform": "android@nightly",
+    "platform": "android@latest",
     "action": "run",
     "cleanUpAfterRun": true,
     "verbose": true,
diff --git a/conf/pr/local/android-5.1.config.json b/conf/pr/local/ios-12.x.config.json
similarity index 53%
copy from conf/pr/local/android-5.1.config.json
copy to conf/pr/local/ios-12.x.config.json
index 1bca536..9365896 100644
--- a/conf/pr/local/android-5.1.config.json
+++ b/conf/pr/local/ios-12.x.config.json
@@ -1,6 +1,7 @@
 {
-    "platform": "android@latest",
+    "platform": "ios@latest",
     "action": "run",
     "cleanUpAfterRun": true,
+    "target": "iPhone-11, 12.5.4",
     "verbose": true
 }
diff --git a/conf/pr/local/android-5.1.config.json b/conf/pr/local/ios-13.x.config.json
similarity index 54%
copy from conf/pr/local/android-5.1.config.json
copy to conf/pr/local/ios-13.x.config.json
index 1bca536..8923907 100644
--- a/conf/pr/local/android-5.1.config.json
+++ b/conf/pr/local/ios-13.x.config.json
@@ -1,6 +1,7 @@
 {
-    "platform": "android@latest",
+    "platform": "ios@latest",
     "action": "run",
     "cleanUpAfterRun": true,
+    "target": "iPhone-11, 13.7",
     "verbose": true
 }
diff --git a/conf/pr/local/android-5.1.config.json b/conf/pr/local/ios-14.x.config.json
similarity index 53%
copy from conf/pr/local/android-5.1.config.json
copy to conf/pr/local/ios-14.x.config.json
index 1bca536..7467f9b 100644
--- a/conf/pr/local/android-5.1.config.json
+++ b/conf/pr/local/ios-14.x.config.json
@@ -1,6 +1,7 @@
 {
-    "platform": "android@latest",
+    "platform": "ios@latest",
     "action": "run",
     "cleanUpAfterRun": true,
+    "target": "iPhone-11, 14.7.1",
     "verbose": true
 }
diff --git a/paramedic-plugin/package-lock.json b/paramedic-plugin/package-lock.json
new file mode 100644
index 0000000..84766ff
--- /dev/null
+++ b/paramedic-plugin/package-lock.json
@@ -0,0 +1,63 @@
+{
+  "name": "cordova-paramedic-ci",
+  "version": "0.5.0",
+  "lockfileVersion": 1,
+  "requires": true,
+  "dependencies": {
+    "fs-extra": {
+      "version": "10.0.0",
+      "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.0.0.tgz",
+      "integrity": "sha512-C5owb14u9eJwizKGdchcDUQeFtlSHHthBk8pbX9Vc1PFZrLombudjDnNns88aYslCyF6IY5SUw3Roz6xShcEIQ==",
+      "dev": true,
+      "requires": {
+        "graceful-fs": "^4.2.0",
+        "jsonfile": "^6.0.1",
+        "universalify": "^2.0.0"
+      }
+    },
+    "graceful-fs": {
+      "version": "4.2.8",
+      "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.8.tgz",
+      "integrity": "sha512-qkIilPUYcNhJpd33n0GBXTB1MMPp14TxEsEs0pTrsSVucApsYzW5V+Q8Qxhik6KU3evy+qkAAowTByymK0avdg==",
+      "dev": true
+    },
+    "jsonfile": {
+      "version": "6.1.0",
+      "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz",
+      "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==",
+      "dev": true,
+      "requires": {
+        "graceful-fs": "^4.1.6",
+        "universalify": "^2.0.0"
+      }
+    },
+    "sax": {
+      "version": "1.2.4",
+      "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz",
+      "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==",
+      "dev": true
+    },
+    "universalify": {
+      "version": "2.0.0",
+      "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz",
+      "integrity": "sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==",
+      "dev": true
+    },
+    "xml2js": {
+      "version": "0.4.23",
+      "resolved": "https://registry.npmjs.org/xml2js/-/xml2js-0.4.23.tgz",
+      "integrity": "sha512-ySPiMjM0+pLDftHgXY4By0uswI3SPKLDw/i3UXbnO8M/p28zqexCUoPmQFrYD+/1BzhGJSs2i1ERWKJAtiLrug==",
+      "dev": true,
+      "requires": {
+        "sax": ">=0.6.0",
+        "xmlbuilder": "~11.0.0"
+      }
+    },
+    "xmlbuilder": {
+      "version": "11.0.1",
+      "resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-11.0.1.tgz",
+      "integrity": "sha512-fDlsI/kFEx7gLvbecc0/ohLG50fugQp8ryHzMTuW9vSa1GJ0XYWKnhsUx7oie3G98+r56aTQIUB4kht42R3JvA==",
+      "dev": true
+    }
+  }
+}

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org