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 2020/05/27 07:12:32 UTC

[cordova-ios] branch master updated: ci: use github actions (#852)

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-ios.git


The following commit(s) were added to refs/heads/master by this push:
     new 7460737  ci: use github actions (#852)
7460737 is described below

commit 7460737463c91f221287e1d7837d69392cb900ae
Author: エリス <er...@users.noreply.github.com>
AuthorDate: Wed May 27 16:12:22 2020 +0900

    ci: use github actions (#852)
    
    * dropped travis ci
    * dropped appveyor
    * updated coverage to include e2e tests
    * updated test scripts
---
 .github/workflows/ci.yml              | 86 +++++++++++++++++++++++++++++++++++
 .ratignore                            |  1 -
 .travis.yml                           | 30 ------------
 appveyor.yml                          | 16 -------
 package.json                          |  6 +--
 tests/spec/component/versions.spec.js | 10 ++--
 tests/spec/coverage.json              |  3 +-
 tests/spec/unit/prepare.spec.js       |  6 +--
 8 files changed, 99 insertions(+), 59 deletions(-)

diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
new file mode 100644
index 0000000..539b96a
--- /dev/null
+++ b/.github/workflows/ci.yml
@@ -0,0 +1,86 @@
+# 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: Node CI
+
+on: [push, pull_request]
+
+jobs:
+  darwin:
+    name: NodeJS ${{ matrix.node-version }} on ${{ matrix.os }}
+    runs-on: ${{ matrix.os }}
+    strategy:
+      matrix:
+        node-version: [10.x, 12.x]
+        os: [macos-latest]
+
+    steps:
+      - uses: actions/checkout@v2
+
+      - 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 and test
+        run: |
+          npm i -g ios-deploy
+          npm cit
+        env:
+          CI: true
+
+      - uses: codecov/codecov-action@v1
+        with:
+          fail_ci_if_error: true
+
+  non-darwin:
+    name: NodeJS ${{ matrix.node-version }} on ${{ matrix.os }}
+    runs-on: ${{ matrix.os }}
+    strategy:
+      matrix:
+        node-version: [10.x, 12.x]
+        os: [ubuntu-latest, windows-latest]
+
+    steps:
+      - uses: actions/checkout@v2
+
+      - 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 and test
+        run: |
+          npm ci
+          npm run lint
+          npm run unit-tests
+        env:
+          CI: true
+
+      - uses: codecov/codecov-action@v1
+        with:
+          fail_ci_if_error: true
diff --git a/.ratignore b/.ratignore
index e65b4c0..196b120 100644
--- a/.ratignore
+++ b/.ratignore
@@ -8,5 +8,4 @@ NSData+Base64.m
 Contents.json
 jasmine.json
 fixtures
-appveyor.yml
 i386
diff --git a/.travis.yml b/.travis.yml
deleted file mode 100644
index eac5e67..0000000
--- a/.travis.yml
+++ /dev/null
@@ -1,30 +0,0 @@
-language: objective-c
-sudo: false
-
-matrix:
-  include:
-    - osx_image: xcode11
-      env: TRAVIS_NODE_VERSION=10
-    - osx_image: xcode11
-      env: TRAVIS_NODE_VERSION=12
-
-before_install:
-  - nvm install $TRAVIS_NODE_VERSION
-
-install:
-  - npm install
-  - npm install ios-deploy
-  - npm install -g codecov
-
-script:
-  - node --version
-  - npm --version
-  - npm run lint
-  - npm run unit-tests
-  - npm run test:component
-  - npm run e2e-tests
-  - npm run objc-tests
-  - npm run cover
-
-after_script:
-  - codecov
diff --git a/appveyor.yml b/appveyor.yml
deleted file mode 100644
index 9e7c6ac..0000000
--- a/appveyor.yml
+++ /dev/null
@@ -1,16 +0,0 @@
-environment:
-  matrix:
-  - nodejs_version: 10
-  - nodejs_version: 12
-
-install:
-  - ps: Install-Product node $env:nodejs_version
-  - npm install
-
-build: off
-
-test_script:
-  - node --version
-  - npm --version
-  - npm run lint
-  - npm run unit-tests
diff --git a/package.json b/package.json
index c5489a6..2cb9e0c 100644
--- a/package.json
+++ b/package.json
@@ -18,10 +18,10 @@
     "cordova:platform"
   ],
   "scripts": {
-    "test": "npm run unit-tests && npm run test:component && npm run objc-tests && npm run e2e-tests",
+    "pretest": "npm run lint",
+    "test": "npm run coverage && npm run objc-tests",
     "test:component": "jasmine --config=tests/spec/component.json",
-    "posttest": "npm run lint",
-    "cover": "nyc jasmine --config=tests/spec/coverage.json",
+    "coverage": "nyc jasmine --config=tests/spec/coverage.json",
     "e2e-tests": "jasmine tests/spec/create.spec.js",
     "objc-tests": "npm run objc-tests-lib && npm run objc-tests-framework",
     "objc-tests-lib": "npm run xcodebuild -- -scheme CordovaLibTests",
diff --git a/tests/spec/component/versions.spec.js b/tests/spec/component/versions.spec.js
index 5f9e32c..58ffbb2 100644
--- a/tests/spec/component/versions.spec.js
+++ b/tests/spec/component/versions.spec.js
@@ -29,31 +29,31 @@ if (process.platform === 'darwin') {
                     () => fail('expected promise rejection'),
                     error => expect(error.message).toContain('is not valid tool name')
                 );
-            });
+            }, 10000);
 
             it('should find xcodebuild version.', () => {
                 return versions.get_tool_version('xcodebuild').then((version) => {
                     expect(version).not.toBe(undefined);
                 });
-            });
+            }, 10000);
 
             it('should find ios-sim version.', () => {
                 return versions.get_tool_version('ios-sim').then((version) => {
                     expect(version).not.toBe(undefined);
                 });
-            });
+            }, 10000);
 
             it('should find ios-deploy version.', () => {
                 return versions.get_tool_version('ios-deploy').then((version) => {
                     expect(version).not.toBe(undefined);
                 });
-            });
+            }, 10000);
 
             it('should find pod version.', () => {
                 return versions.get_tool_version('pod').then((version) => {
                     expect(version).not.toBe(undefined);
                 });
-            });
+            }, 10000);
         });
     });
 }
diff --git a/tests/spec/coverage.json b/tests/spec/coverage.json
index 2ec72bb..f709b70 100644
--- a/tests/spec/coverage.json
+++ b/tests/spec/coverage.json
@@ -2,7 +2,8 @@
   "spec_dir": "tests/spec",
   "spec_files": [
       "unit/**/*[sS]pec.js",
-      "component/**/*[sS]pec.js"
+      "component/**/*[sS]pec.js",
+      "create.spec.js"
   ],
   "stopSpecOnExpectationFailure": false,
   "random": false
diff --git a/tests/spec/unit/prepare.spec.js b/tests/spec/unit/prepare.spec.js
index ea24eed..3aa601e 100644
--- a/tests/spec/unit/prepare.spec.js
+++ b/tests/spec/unit/prepare.spec.js
@@ -21,7 +21,6 @@
 const fs = require('fs-extra');
 
 const EventEmitter = require('events');
-const os = require('os');
 const path = require('path');
 const plist = require('plist');
 const xcode = require('xcode');
@@ -30,10 +29,11 @@ const prepare = rewire('../../../bin/templates/scripts/cordova/lib/prepare');
 const projectFile = require('../../../bin/templates/scripts/cordova/lib/projectFile');
 const FileUpdater = require('cordova-common').FileUpdater;
 
+const tmpDir = path.join(__dirname, '../../../tmp');
 const FIXTURES = path.join(__dirname, 'fixtures');
 
 const iosProjectFixture = path.join(FIXTURES, 'ios-config-xml');
-const iosProject = path.join(os.tmpdir(), 'prepare');
+const iosProject = path.join(tmpDir, 'prepare');
 const iosPlatform = path.join(iosProject, 'platforms/ios');
 
 const ConfigParser = require('cordova-common').ConfigParser;
@@ -50,7 +50,7 @@ describe('prepare', () => {
     });
 
     afterEach(() => {
-        fs.removeSync(iosPlatform);
+        fs.removeSync(tmpDir);
     });
 
     describe('launch storyboard feature (CB-9762)', () => {


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