From 08ea6a8488fba0eda2dba117cca2b0727fffc834 Mon Sep 17 00:00:00 2001 From: Rodion Abdurakhimov Date: Fri, 18 Dec 2020 00:57:23 +0200 Subject: [PATCH 1/5] Setup CI --- .github/workflows/ci.yaml | 43 +++++++++++++++++++++++++++++++++++++++ README.md | 2 +- package.json | 5 ++++- 3 files changed, 48 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/ci.yaml diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 0000000..5144fb4 --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,43 @@ +name: Node.js CI + +on: + schedule: + - cron: '23 4 * * *' # Once, nightly + push: + branches: + - main + pull_request: + +jobs: + + test: + + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [ 15, 14, 12, 10 ] + + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node-version }} + - run: npm install + - run: npm run tests-only + + lint: + + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [ 14 ] + + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node-version }} + - run: npm install + - run: npm run lint diff --git a/README.md b/README.md index db31644..a890bff 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [![NPM Version](https://img.shields.io/npm/v/create-pkg.svg)](https://npmjs.org/package/create-pkg) [![NPM Downloads](https://img.shields.io/npm/dm/create-pkg.svg)](https://npmjs.org/package/create-pkg) -[![test](https://github.com/pkgjs/create/workflows/Test/badge.svg)](https://github.com/pkgjs/create/actions?query=workflow%3ATest) +[![test](https://github.com/pkgjs/create/workflows/Node.js%20CI/badge.svg)](https://github.com/pkgjs/create/actions?query=workflow%3A%22Node.js+CI%22) [![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg)](https://github.com/standard/standard) ## Usage diff --git a/package.json b/package.json index 0758fff..1542738 100644 --- a/package.json +++ b/package.json @@ -23,7 +23,10 @@ "create-package": "bin/create-package" }, "scripts": { - "test": "standard && mocha --timeout=60000", + "lint": "standard", + "pretest": "npm run lint", + "test": "npm run tests-only", + "tests-only": "mocha --timeout=60000", "test:debug": "mocha --inspect --inspect-brk --timeout=0", "release": "npm t && standard-version && npm publish", "postpublish": "git push origin && git push origin --tags" From 4b5b5f09b46673ed9eb9af0e162e8394c46918b2 Mon Sep 17 00:00:00 2001 From: Rodion Abdurakhimov Date: Fri, 18 Dec 2020 01:33:29 +0200 Subject: [PATCH 2/5] Fix author field on CI --- test/index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/index.js b/test/index.js index a160941..952ab3a 100644 --- a/test/index.js +++ b/test/index.js @@ -33,7 +33,8 @@ suite(pkg.name, () => { cwd: fix.TMP, push: false, silent: true, - githubRepo: '__tmp' + githubRepo: '__tmp', + author: 'Unit test' }, barePrompt) }) }) From 5dab0523e14cdbafb445cb68bf79d72c0c874f86 Mon Sep 17 00:00:00 2001 From: Rodion Abdurakhimov Date: Mon, 21 Dec 2020 23:32:49 +0200 Subject: [PATCH 3/5] Fix Node.js v10 support --- package.json | 1 + test/index.js | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 1542738..caf595e 100644 --- a/package.json +++ b/package.json @@ -36,6 +36,7 @@ "create-git": "^1.0.0-2", "create-package-json": "^1.0.0-2", "loggerr": "^3.0.0-3", + "object.fromentries": "^2.0.3", "opta": "0.0.6", "semver": "^7.3.2" }, diff --git a/test/index.js b/test/index.js index 952ab3a..558561a 100644 --- a/test/index.js +++ b/test/index.js @@ -3,6 +3,7 @@ const { suite, test, before } = require('mocha') const pkg = require('../package.json') const fixtures = require('fs-test-fixtures') const createPackage = require('..') +const fromEntries = require('object.fromentries') const barePrompt = { promptor: () => async (prompts) => { @@ -17,7 +18,8 @@ const barePrompt = { } return [p.name, ret] })) - return Object.fromEntries(out) + + return fromEntries(out) } } From 3038f883512039230410fa780d7f8d27ca34ff7b Mon Sep 17 00:00:00 2001 From: Rodion Abdurakhimov Date: Mon, 21 Dec 2020 23:33:16 +0200 Subject: [PATCH 4/5] Remove night scheduler --- .github/workflows/ci.yaml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 5144fb4..170c626 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -1,8 +1,6 @@ name: Node.js CI on: - schedule: - - cron: '23 4 * * *' # Once, nightly push: branches: - main From 955c1f80e04ecf9dbd449ca551498af2d0eee28e Mon Sep 17 00:00:00 2001 From: Rodion Abdurakhimov Date: Sat, 17 Jul 2021 21:00:06 +0300 Subject: [PATCH 5/5] Remove v15, add v16 --- .github/workflows/ci.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 170c626..831e5f4 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -14,7 +14,7 @@ jobs: strategy: matrix: - node-version: [ 15, 14, 12, 10 ] + node-version: [ 16, 14, 12, 10 ] steps: - uses: actions/checkout@v2 @@ -30,7 +30,7 @@ jobs: strategy: matrix: - node-version: [ 14 ] + node-version: [ 16 ] steps: - uses: actions/checkout@v2