From bd33c5f690c54609bf50365c646810dd19921f40 Mon Sep 17 00:00:00 2001 From: Matt Simerson Date: Tue, 14 Jun 2022 14:01:00 -0700 Subject: [PATCH] switch to GitHub Actions (#83) * Switch to GitHub Actions * chore(ci): switch to GitHub Actions * chore(ci): switch reporter from nyc to c8 * chore(nyc): remove dependency * move .eslintrc to .eslintrc.yaml (be explicit) * noop: ws Co-authored-by: silverwind --- .eslintrc | 9 ------ .eslintrc.yaml | 8 ++++++ .github/workflows/ci.yml | 60 ++++++++++++++++++++++++++++++++++++++++ .travis.yml | 14 ---------- README.md | 2 +- package.json | 1 - 6 files changed, 69 insertions(+), 25 deletions(-) delete mode 100644 .eslintrc create mode 100644 .eslintrc.yaml create mode 100644 .github/workflows/ci.yml delete mode 100644 .travis.yml diff --git a/.eslintrc b/.eslintrc deleted file mode 100644 index d3ed05c..0000000 --- a/.eslintrc +++ /dev/null @@ -1,9 +0,0 @@ -root: true - -parserOptions: - ecmaVersion: 2015 - -env: - node: true - -extends: standard diff --git a/.eslintrc.yaml b/.eslintrc.yaml new file mode 100644 index 0000000..b9dec6c --- /dev/null +++ b/.eslintrc.yaml @@ -0,0 +1,8 @@ +root: true + +# https://eslint.org/docs/user-guide/configuring/language-options#specifying-environments +env: + node: true + es6: true + +extends: standard diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..56e12c7 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,60 @@ +name: ci + +on: + push: + branches: + - master + pull_request: + +env: + CI: true + node-version: 16 + +jobs: + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/setup-node@v3 + name: Node ${{ env.node-version }} + with: + node-version: ${{ env.node-version }} + - uses: actions/checkout@v3 + - run: npm install + - run: npm run lint + + test: + needs: lint + strategy: + fail-fast: false + matrix: + os: [ ubuntu-latest ] + node: [ 6, 8, 10, 12, 14, 16 ] + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node }} + - run: npm install + - run: npm test + + coverage: + needs: test + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node }} + - run: npm install + - run: npx -y c8 --reporter=lcov npm test + env: + NODE_ENV: cov + + - name: codecov + uses: codecov/codecov-action@v2 + + - name: Coveralls + uses: coverallsapp/github-action@master + with: + github-token: ${{ secrets.github_token }} diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index a3fdc7f..0000000 --- a/.travis.yml +++ /dev/null @@ -1,14 +0,0 @@ -language: node_js -node_js: - - node - - lts/* -install: -- npm install -- npm install coveralls -script: -- npm run coverage -after_success: -- npx nyc report --reporter=text-lcov | npx coveralls -branches: - only: - - master diff --git a/README.md b/README.md index 2a729b3..2c05f7b 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # dns-packet -[![](https://img.shields.io/npm/v/dns-packet.svg?style=flat)](https://www.npmjs.org/package/dns-packet) [![](https://img.shields.io/npm/dm/dns-packet.svg)](https://www.npmjs.org/package/dns-packet) [![](https://api.travis-ci.org/mafintosh/dns-packet.svg?style=flat)](https://travis-ci.org/mafintosh/dns-packet) [![Coverage Status](https://coveralls.io/repos/github/mafintosh/dns-packet/badge.svg?branch=master)](https://coveralls.io/github/mafintosh/dns-packet?branch=master) +[![](https://img.shields.io/npm/v/dns-packet.svg?style=flat)](https://www.npmjs.org/package/dns-packet) [![](https://img.shields.io/npm/dm/dns-packet.svg)](https://www.npmjs.org/package/dns-packet) [![](https://github.com/github/mafintosh/dns-packet/workflows/ci.yml/badge.svg)](https://github.com/github/mafintosh/dns-packet/workflows/ci.yml) [![Coverage Status](https://coveralls.io/repos/github/mafintosh/dns-packet/badge.svg?branch=master)](https://coveralls.io/github/mafintosh/dns-packet?branch=master) An [abstract-encoding](https://github.com/mafintosh/abstract-encoding) compliant module for encoding / decoding DNS packets. Lifted out of [multicast-dns](https://github.com/mafintosh/multicast-dns) as a separate module. diff --git a/package.json b/package.json index e9207db..f7e5536 100644 --- a/package.json +++ b/package.json @@ -26,7 +26,6 @@ "eslint-plugin-node": "^8.0.1", "eslint-plugin-promise": "^4.0.1", "eslint-plugin-standard": "^4.0.0", - "nyc": "^13.3.0", "tape": "^4.10.1" }, "keywords": [