diff --git a/.dependabot/config.yml b/.dependabot/config.yml deleted file mode 100644 index 6f5b070..0000000 --- a/.dependabot/config.yml +++ /dev/null @@ -1,12 +0,0 @@ -version: 1 -update_configs: - - package_manager: 'javascript' - directory: '/' - update_schedule: 'weekly' - automerged_updates: - - match: - dependency_type: "development" - update_type: "all" - - match: - dependency_type: "production" - update_type: "semver:patch" diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..60efe5d --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,8 @@ +version: 2 +updates: +- package-ecosystem: npm + directory: "/" + schedule: + interval: weekly + time: "11:00" + open-pull-requests-limit: 10 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..a448f9d --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,96 @@ +name: CI + +on: + push: + branches: + - main + pull_request: + branches: + - main + +jobs: + install: + name: Install + runs-on: ubuntu-18.04 + + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 + - name: Use Node.js + uses: actions/setup-node@v2 + with: + node-version: 14 + - name: Cache node modules + uses: actions/cache@v2 + with: + path: node_modules + key: ${{ runner.os }}-node--${{ hashFiles('package.json') }} + restore-keys: | + ${{ runner.os }}-node- + - name: Install Dependencies + run: npm i + + + validate: + name: Validate - Node v${{ matrix.node }} + runs-on: ubuntu-18.04 + needs: install + strategy: + matrix: + node: [ 10, 11, 12, 14 ] + + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 + - name: Use Node.js + uses: actions/setup-node@v2 + with: + node-version: ${{ matrix.node }} + - name: Restore node modules + uses: actions/cache@v2 + with: + path: node_modules + key: ${{ runner.os }}-node--${{ hashFiles('package.json') }} + restore-keys: | + ${{ runner.os }}-node- + - name: Linting + run: npm start lint + - name: Run Tests + run: npm start test + - name: Coveralls + uses: coverallsapp/github-action@master + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + + release: + name: Release + runs-on: ubuntu-18.04 + needs: [validate] + if: github.ref == 'refs/heads/main' + + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 + - name: Use Node.js + uses: actions/setup-node@v2 + with: + node-version: 14 + - name: Restore node modules + uses: actions/cache@v2 + with: + path: node_modules + key: ${{ runner.os }}-node--${{ hashFiles('package.json') }} + restore-keys: | + ${{ runner.os }}-node- + # Release the Codes!! + - name: Release! + env: + GH_TOKEN: ${{ secrets.GH_TOKEN }} + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} + run: npm start semantic-release diff --git a/.husky/.gitignore b/.husky/.gitignore new file mode 100644 index 0000000..31354ec --- /dev/null +++ b/.husky/.gitignore @@ -0,0 +1 @@ +_ diff --git a/.husky/pre-commit b/.husky/pre-commit new file mode 100755 index 0000000..974e268 --- /dev/null +++ b/.husky/pre-commit @@ -0,0 +1,4 @@ +#!/bin/sh +. "$(dirname "$0")/_/husky.sh" + +npx remove-lockfiles diff --git a/.releaserc.yml b/.releaserc.yml new file mode 100644 index 0000000..d6e12ef --- /dev/null +++ b/.releaserc.yml @@ -0,0 +1 @@ +branches: main diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index a0179b9..0000000 --- a/.travis.yml +++ /dev/null @@ -1,19 +0,0 @@ -sudo: false -language: node_js -node_js: - - 8 - - 10 - - 12 -cache: npm -branches: - only: - - master - - /^greenkeeper/.*$/ -script: - - npm start lint - - npm start test -after_success: - - npm start report-coverage - - npm start semantic-release -notifications: - email: change diff --git a/README.md b/README.md index c58cdf6..fd02c24 100644 --- a/README.md +++ b/README.md @@ -2,11 +2,10 @@ [![NPM Version][npm-version-image]][npm-url] [![NPM Downloads][npm-downloads-image]][npm-url] -[![Travis][travis-ci-image]][travis-ci-url] +[![CI Build][github-actions-image]][github-actions-url] [![Coveralls][coveralls-image]][coveralls-url] [![semantic-release][semantic-release-image]][semantic-release-url] -[![Greenkeeper badge][greenkeeper-image]][greenkeeper-url] A simple tool for parsing JavaScript objects to avoid repetition. @@ -133,17 +132,11 @@ THE SOFTWARE. [npm-downloads-image]: http://img.shields.io/npm/dm/dry-parser.svg?style=flat [npm-url]: https://npmjs.org/package/dry-parser -[travis-ci-image]: https://img.shields.io/travis/com/salte-io/dry-parser.svg?style=flat -[travis-ci-url]: https://travis-ci.com/salte-io/dry-parser +[github-actions-image]: https://github.com/salte-io/dry-parser/actions/workflows/ci.yml/badge.svg?branch=main +[github-actions-url]: https://github.com/salte-io/dry-parser/actions/workflows/ci.yml -[coveralls-image]: https://img.shields.io/coveralls/salte-io/dry-parser/master.svg +[coveralls-image]: https://img.shields.io/coveralls/salte-io/dry-parser/main.svg [coveralls-url]: https://coveralls.io/github/salte-io/dry-parser -[commitizen-image]: https://img.shields.io/badge/commitizen-friendly-brightgreen.svg -[commitizen-url]: http://commitizen.github.io/cz-cli/ - [semantic-release-url]: https://github.com/semantic-release/semantic-release [semantic-release-image]: https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg - -[greenkeeper-image]: https://badges.greenkeeper.io/salte-io/dry-parser.svg -[greenkeeper-url]: https://greenkeeper.io diff --git a/package.json b/package.json index 401a45f..6903943 100644 --- a/package.json +++ b/package.json @@ -24,22 +24,23 @@ "url": "https://github.com/salte-io/dry-parser.git" }, "scripts": { - "start": "nps" + "start": "nps", + "prepare": "husky install" }, "license": "MIT", "devDependencies": { "chai": "^4.2.0", "coveralls": "^3.0.2", - "eslint": "^6.0.0", + "eslint": "^7.0.0", "eslint-config-google": "^0.14.0", - "eslint-plugin-mocha": "^6.0.0", - "husky": "^4.0.2", - "mocha": "^7.0.1", + "eslint-plugin-mocha": "^10.0.4", + "husky": "^7.0.0", + "mocha": "^9.0.1", "nps": "^5.9.3", "nyc": "^15.0.0", "remove-lockfiles": "^2.1.3", "semantic-release": "^17.0.0", - "sinon": "^9.0.0" + "sinon": "^11.1.1" }, "husky": { "hooks": {