From 04d950d2ec86d32f71b4a8920cff1540625450ec Mon Sep 17 00:00:00 2001 From: Erisu Date: Mon, 29 Jun 2020 15:43:40 +0900 Subject: [PATCH 1/3] ci(gh-actions): add workflow --- .github/workflows/ci.yml | 53 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 000000000..d38ad9aac --- /dev/null +++ b/.github/workflows/ci.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: Node CI + +on: [push, pull_request] + +jobs: + test: + 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, 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 cit + env: + CI: true + + - uses: codecov/codecov-action@v1 + with: + fail_ci_if_error: true From 5fc520e7533906d7ea6f55d75a121f9b04d1cb1d Mon Sep 17 00:00:00 2001 From: Erisu Date: Mon, 29 Jun 2020 16:01:10 +0900 Subject: [PATCH 2/3] ci: refactor for action & remove old CI --- .npmignore | 1 - .ratignore | 1 - .travis.yml | 17 ----------------- appveyor.yml | 22 ---------------------- package.json | 21 ++++++++++++++++----- 5 files changed, 16 insertions(+), 46 deletions(-) delete mode 100644 .travis.yml delete mode 100644 appveyor.yml diff --git a/.npmignore b/.npmignore index d980319bc..dc8456098 100644 --- a/.npmignore +++ b/.npmignore @@ -1,5 +1,4 @@ .* -appveyor.yml spec integration-tests coverage diff --git a/.ratignore b/.ratignore index 6a94741a0..b4e37f31c 100644 --- a/.ratignore +++ b/.ratignore @@ -4,4 +4,3 @@ platformsConfig.json help.txt jasmine.json coverage -appveyor.yml diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index e8c15dfee..000000000 --- a/.travis.yml +++ /dev/null @@ -1,17 +0,0 @@ -language: node_js -sudo: false -git: - depth: 10 - -node_js: - - 10 - - 12 - -install: - - npm install - -script: - - npm run cover - -after_success: - - npm run report-coverage diff --git a/appveyor.yml b/appveyor.yml deleted file mode 100644 index 6a3305887..000000000 --- a/appveyor.yml +++ /dev/null @@ -1,22 +0,0 @@ -# appveyor file -# http://www.appveyor.com/docs/appveyor-yml - -shallow_clone: true - -environment: - matrix: - - nodejs_version: 10 - - nodejs_version: 12 - -install: - - ps: Install-Product node $env:nodejs_version - - npm install - -build: off - -test_script: - # Workaround for https://github.com/appveyor/ci/issues/2420 - - set "PATH=%PATH%;C:\Program Files\Git\mingw64\libexec\git-core" - - node --version - - npm --version - - npm test diff --git a/package.json b/package.json index 5d767edd7..5fbc26622 100644 --- a/package.json +++ b/package.json @@ -41,12 +41,23 @@ "rewire": "^4.0.1" }, "scripts": { - "test": "npm run lint && npm run unit-tests && npm run e2e-tests", "lint": "eslint .", - "unit-tests": "jasmine \"spec/**/*.spec.js\"", - "cover": "nyc -x spec/ -x integration-tests/ npm test", - "report-coverage": "nyc report -r text-lcov > coverage.lcov && codecov", - "e2e-tests": "jasmine \"integration-tests/**/*.spec.js\"" + "test": "npm run lint && npm run test:coverage", + "test:all": "npm run test:unit && npm run test:e2e", + "test:coverage": "nyc npm run test:all", + "test:e2e": "jasmine \"integration-tests/**/*.spec.js\"", + "test:unit": "jasmine \"spec/**/*.spec.js\"" + }, + "nyc": { + "all": true, + "exclude": [ + "spec/", + "integration-tests/" + ], + "reporter": [ + "lcov", + "text" + ] }, "contributors": [ { From 118d671d1fbbf27404b3b920ac7770302d6fa69b Mon Sep 17 00:00:00 2001 From: Erisu Date: Tue, 30 Jun 2020 09:50:56 +0900 Subject: [PATCH 3/3] chore: change temp dir --- spec/helpers.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/spec/helpers.js b/spec/helpers.js index 7d29f108a..99abe6f9b 100644 --- a/spec/helpers.js +++ b/spec/helpers.js @@ -19,7 +19,6 @@ var path = require('path'); var fs = require('fs-extra'); -var os = require('os'); var ConfigParser = require('cordova-common').ConfigParser; const fixtureHelper = require('./fixture-helper'); @@ -36,8 +35,8 @@ function getConfigPath (dir) { } module.exports.tmpDir = function (suffix = 'test') { - const dir = path.join(os.tmpdir(), `cordova-lib-${suffix}-`); - return fs.realpathSync(fs.mkdtempSync(dir)); + const dir = path.join(__dirname, `../temp/cordova-lib-${suffix}-`); + return fs.realpathSync(fs.mkdirpSync(dir)); }; /**