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"