You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by ti...@apache.org on 2020/11/26 14:04:34 UTC

[cordova-paramedic] branch feat/gh-actions updated (a5714b2 -> 6657551)

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

timbru31 pushed a change to branch feat/gh-actions
in repository https://gitbox.apache.org/repos/asf/cordova-paramedic.git.


 discard a5714b2  fix: adds chrome alias
 discard c40f6c4  fix: syntax
 discard ff1780a  fix: try npm i
 discard 32c0033  fix: try deb installation
 discard 3dc90b8  fix: use sudo for Chrome
 discard 738caf9  fix: use sudo for Chrome
 discard 8556069  fix: use sudo for Chrome
 discard 4a2bb55  fix: upgrade Xcode
 discard 2a9168b  feat: adds Chrome job
 discard f805433  fix: syntax
 discard d147413  fix: syntax
 discard ff00273  fix: syntax
 discard 9514a42  feat: try matrix
 discard 8c65c1c  feat: try matrix
 discard 2820001  fix: create emu
 discard a659e00  fix: adb
 discard 49be462  fix: lib issues
 discard dd9d81c  fix: android target
 discard 2749783  fix: install ios-deploy
 discard 2208a06  fix: android target
 discard 471e965  ci: enable GH Actions
     new 6657551  ci: enable GH Actions

This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version.  This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:

 * -- * -- B -- O -- O -- O   (a5714b2)
            \
             N -- N -- N   refs/heads/feat/gh-actions (6657551)

You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.

Any revisions marked "omit" are not gone; other references still
refer to them.  Any revisions marked "discard" are gone forever.

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .github/workflows/ios.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)


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


[cordova-paramedic] 01/01: ci: enable GH Actions

Posted by ti...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

timbru31 pushed a commit to branch feat/gh-actions
in repository https://gitbox.apache.org/repos/asf/cordova-paramedic.git

commit 6657551feae3840b9f4fa3a8fc23010515b5b87f
Author: Tim Brust <ti...@sinnerschrader.com>
AuthorDate: Thu Nov 26 14:59:18 2020 +0100

    ci: enable GH Actions
    
    This adds a working example for iOS
    The Chrome tests could work in theory.
    The Android testsuite currently times out for unknown reasons.
---
 .github/workflows/android.yml         | 59 +++++++++++++++++++++++++++++++++++
 .github/workflows/chrome.yml          | 50 +++++++++++++++++++++++++++++
 .github/workflows/ios.yml             | 53 +++++++++++++++++++++++++++++++
 conf/pr/local/android-5.1.config.json |  1 -
 conf/pr/local/ios-11.4.config.json    |  7 +++++
 lib/ParamedicTargetChooser.js         |  4 +--
 lib/paramedic.js                      |  2 +-
 lib/utils/utilities.js                | 11 +++++--
 8 files changed, 180 insertions(+), 7 deletions(-)

diff --git a/.github/workflows/android.yml b/.github/workflows/android.yml
new file mode 100644
index 0000000..cb58c4f
--- /dev/null
+++ b/.github/workflows/android.yml
@@ -0,0 +1,59 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+#  KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+name: Android Testsuite
+
+on: [push, pull_request]
+
+jobs:
+  test:
+    name: NodeJS ${{ matrix.node-version }} on ${{ matrix.os }}
+    runs-on: ${{ matrix.os }}
+    strategy:
+      matrix:
+        node-version: [12.x]
+        os: [ubuntu-latest]
+
+    steps:
+      - uses: actions/checkout@v2
+
+      - name: Set up JDK 1.8
+        uses: actions/setup-java@v1
+        with:
+          java-version: 1.8
+
+      - name: Use Node.js ${{ matrix.node-version }}
+        uses: actions/setup-node@v1
+        with:
+          node-version: ${{ matrix.node-version }}
+
+      - name: Environment Information
+        run: |
+          node --version
+          npm --version
+
+      - name: npm install
+        run: |
+          export PATH="/usr/local/lib/android/sdk/platform-tools":$PATH
+          npm i -g cordova
+          npm ci
+
+      - name: npm test
+        uses: reactivecircus/android-emulator-runner@v2
+        with:
+          api-level: 28
+          script: node main.js --config ./pr/local/android-5.1.config.json  --plugin ./spec/testable-plugin/
diff --git a/.github/workflows/chrome.yml b/.github/workflows/chrome.yml
new file mode 100644
index 0000000..d57525a
--- /dev/null
+++ b/.github/workflows/chrome.yml
@@ -0,0 +1,50 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+#  KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+name: Chrome Testsuite
+
+on: [push, pull_request]
+
+jobs:
+  test:
+    name: Chrome latest test
+    runs-on: ubuntu-latest
+
+    steps:
+      - uses: actions/checkout@v2
+
+      - name: Install Chrome
+        run: |
+          wget -q https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
+          sudo dpkg -i google-chrome-stable_current_amd64.deb
+          sudo alias chrome="google-chrome"
+
+      - name: Use Node.js 12
+        uses: actions/setup-node@v1
+        with:
+          node-version: 12
+
+      - name: Environment Information
+        run: |
+          node --version
+          npm --version
+
+      - name: npm install and test
+        run: |
+          npm i -g cordova
+          npm ci
+          node main.js --config ./pr/local/browser.config.json  --plugin ./spec/testable-plugin/
diff --git a/.github/workflows/ios.yml b/.github/workflows/ios.yml
new file mode 100644
index 0000000..771e61c
--- /dev/null
+++ b/.github/workflows/ios.yml
@@ -0,0 +1,53 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+#  KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+name: iOS Testsuite
+
+on: [push, pull_request]
+
+jobs:
+  test:
+    name: iOS ${{ matrix.versions.ios }}
+    runs-on: macos-latest
+    strategy:
+      matrix:
+        versions:
+          - ios: 13.6
+            xcode: 11.6
+
+    steps:
+      - uses: actions/checkout@v2
+
+      - uses: maxim-lobanov/setup-xcode@v1.1
+        with:
+          xcode-version: ${{ matrix.versions.xcode }}
+
+      - name: Use Node.js 12
+        uses: actions/setup-node@v1
+        with:
+          node-version: 12
+
+      - name: Environment Information
+        run: |
+          node --version
+          npm --version
+
+      - name: npm install and test
+        run: |
+          npm i -g cordova ios-deploy
+          npm ci
+          node main.js --config ./pr/local/ios-13.6.config.json  --plugin ./spec/testable-plugin/
diff --git a/conf/pr/local/android-5.1.config.json b/conf/pr/local/android-5.1.config.json
index 51ffab8..1bca536 100644
--- a/conf/pr/local/android-5.1.config.json
+++ b/conf/pr/local/android-5.1.config.json
@@ -2,6 +2,5 @@
     "platform": "android@latest",
     "action": "run",
     "cleanUpAfterRun": true,
-    "target": "api22",
     "verbose": true
 }
diff --git a/conf/pr/local/ios-11.4.config.json b/conf/pr/local/ios-11.4.config.json
new file mode 100644
index 0000000..27bbc9e
--- /dev/null
+++ b/conf/pr/local/ios-11.4.config.json
@@ -0,0 +1,7 @@
+{
+  "platform": "ios@latest",
+  "action": "run",
+  "cleanUpAfterRun": true,
+  "target": "iPhone-8, 11.4",
+  "verbose": true
+}
diff --git a/lib/ParamedicTargetChooser.js b/lib/ParamedicTargetChooser.js
index 8b4665b..6816c5c 100644
--- a/lib/ParamedicTargetChooser.js
+++ b/lib/ParamedicTargetChooser.js
@@ -32,7 +32,7 @@ class ParamedicTargetChooser {
     }
 
     chooseTarget (emulator, target) {
-        let targetObj = '';
+        let targetObj = Q();
 
         switch (this.platform) {
         case utilities.ANDROID:
@@ -59,7 +59,7 @@ class ParamedicTargetChooser {
 
         if (target) {
             logger.info('cordova-paramedic: Target defined as: ' + target);
-            return { target };
+            return Q({ target });
         }
 
         return this.startAnAndroidEmulator(target).then(emulatorId => ({ target: emulatorId }));
diff --git a/lib/paramedic.js b/lib/paramedic.js
index 677ccbb..1ca768d 100644
--- a/lib/paramedic.js
+++ b/lib/paramedic.js
@@ -424,7 +424,7 @@ class ParamedicRunner {
         }
 
         // For now we always trying to run test app on emulator
-        return (new ParamedicTargetChooser(this.tempFolder.name, this.config)).chooseTarget(
+        return new ParamedicTargetChooser(this.tempFolder.name, this.config).chooseTarget(
             true, // useEmulator
             this.config.getTarget() // preferredTarget
         ).then(targetObj => {
diff --git a/lib/utils/utilities.js b/lib/utils/utilities.js
index 72f63cd..3248cd2 100644
--- a/lib/utils/utilities.js
+++ b/lib/utils/utilities.js
@@ -88,9 +88,14 @@ function getSimulatorModelId (cli, target) {
     logger.info(`Filtering for Targeted Emulator: ${target}`);
 
     // Return the individual target that is filtered from the known simulators/emulators based on provided target name. (default: ^iPhone)
-    return result.stdout
-        .split('\n')
-        .filter(i => i.match(target))
+    const allSimulators = result.stdout
+        .split('\n');
+    const matchingSimulators = allSimulators.filter(i => i.match(target));
+    if (!matchingSimulators.length) {
+        logger.warn('Unable to find requested simulator, falling back to the first available!');
+        return allSimulators.filter(i => i.match(/^iPhone/))[0].trim();
+    }
+    return matchingSimulators
         .pop()
         .trim();
 }


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