From 23176047d56bc8957e5fe5f53f9b69ffa890ef13 Mon Sep 17 00:00:00 2001 From: Daniel Chiquito Date: Fri, 20 May 2022 10:57:34 -0400 Subject: [PATCH 1/3] Run tests in GitHub Actions --- .github/workflows/ci.yml | 19 +++++++++++++++++++ 1 file changed, 19 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 0000000..b81fe03 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,19 @@ +name: CI +on: + pull_request: + push: + branches: + - master +jobs: + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - uses: actions/setup-node@v3 + + - name: Install client + run: npm install + + - name: Run tests + run: npm run test From acb81b8ddc7c8850da3613684cb930b18efa69b3 Mon Sep 17 00:00:00 2001 From: Daniel Chiquito Date: Fri, 20 May 2022 11:03:47 -0400 Subject: [PATCH 2/3] Pin node==14 in CI --- .github/workflows/ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b81fe03..67ad24d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,6 +11,8 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-node@v3 + with: + node-version: 14 - name: Install client run: npm install From e34f91e10acdb063c7c3a88055fdd1be32c46cb7 Mon Sep 17 00:00:00 2001 From: Daniel Chiquito Date: Fri, 20 May 2022 11:18:15 -0400 Subject: [PATCH 3/3] Add nyc for test coverage --- .gitignore | 2 ++ package.json | 2 ++ 2 files changed, 4 insertions(+) diff --git a/.gitignore b/.gitignore index 25866c0..83e382f 100644 --- a/.gitignore +++ b/.gitignore @@ -223,6 +223,8 @@ pip-log.txt # Unit test / coverage reports .coverage .tox +coverage +.nyc_output #Translations *.mo diff --git a/package.json b/package.json index b06fcbb..2536419 100644 --- a/package.json +++ b/package.json @@ -15,6 +15,7 @@ }, "scripts": { "test": "tape test/*.js", + "cover": "nyc --reporter=lcov --reporter=text-summary npm run test", "lint": "standard", "doc": "jsdoc2md --files src/client.js src/cabal-details.js --param-list-format list --separators --partial doc-gen/scope.hbs --helper doc-gen/helpers.js > api.md", "build": "browserify index.js --standalone CabalClient > bundle.js", @@ -46,6 +47,7 @@ "browserify": "^17.0.0", "hallmark": "^3.1.0", "jsdoc-to-markdown": "^5.0.2", + "nyc": "^15.1.0", "rimraf": "^3.0.2", "standard": "~12.0.0", "tape": "~4.9.1",