From c20a1ce7dcf55a9e6b0b68fbbd7ed2eed5fb2bbd Mon Sep 17 00:00:00 2001 From: Oleg Koval Date: Sat, 12 Oct 2019 21:59:55 +0200 Subject: [PATCH 1/2] ci(coverage): add coverage reports --- .github/workflows/code-quality.yml | 35 +++++++++++++++++++++++++----- package.json | 5 +++-- 2 files changed, 32 insertions(+), 8 deletions(-) diff --git a/.github/workflows/code-quality.yml b/.github/workflows/code-quality.yml index 8100027..25f5a7e 100644 --- a/.github/workflows/code-quality.yml +++ b/.github/workflows/code-quality.yml @@ -16,17 +16,40 @@ jobs: CI: true run: npm ci - run: npm run lint - test: - runs-on: ubuntu-latest + # test: + # runs-on: ubuntu-latest + # steps: + # - uses: actions/checkout@v1 + # with: + # fetch-depth: 1 + # - uses: actions/setup-node@v1 + # with: + # node-version: 12 + # - env: + # CI: true + # # COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }} + # run: npm ci + # - run: npm test +test: + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest] + node: [8, 10, 12] steps: - uses: actions/checkout@v1 with: fetch-depth: 1 + - uses: actions/setup-node@v1 - with: - node-version: 12 + - env: CI: true - # COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }} run: npm ci - - run: npm test + - run: | + npm run nyc + npm run coverage + - name: Coveralls GitHub Action + uses: coverallsapp/github-action@master + with: + github-token: ${{ secrets.github_token }} diff --git a/package.json b/package.json index 9f1e467..0ec16a4 100644 --- a/package.json +++ b/package.json @@ -22,7 +22,7 @@ "semantic-release-npm-github-publish": "^1.3.4" }, "engines": { - "node": ">=8.0.0 <11.0.0" + "node": ">=8.0.0 <12.0.0" }, "files": [ "index.js", @@ -48,13 +48,14 @@ "repository": "https://github.com/oleg-koval/trembita", "scripts": { "clean": "rm -rf node_modules package-lock.json", + "coverage": "npx nyc report --reporter=lcov", "format": "prettier --check \"**/*.{js,json,md,ts,yml,yaml}\"", "format:fix": "prettier --write \"**/*.{js,json,md,ts,yml,yaml}\"", "lint": "npx goodparts index.js", "nyc": "nyc npm test && nyc report --reporter=text-lcov", "semantic-release": "semantic-release", "test": "mocha", - "test:coverage": "npm run nyc | coveralls" + "test:coverage": "npm run test:nyc" }, "version": "1.2.18" } From 05c6d7cbb8685e8fc5cbfa503a66c9baf5965a21 Mon Sep 17 00:00:00 2001 From: Oleg Koval Date: Sat, 12 Oct 2019 22:01:50 +0200 Subject: [PATCH 2/2] style: fix --- .github/workflows/code-quality.yml | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/.github/workflows/code-quality.yml b/.github/workflows/code-quality.yml index 25f5a7e..ce2a776 100644 --- a/.github/workflows/code-quality.yml +++ b/.github/workflows/code-quality.yml @@ -16,21 +16,7 @@ jobs: CI: true run: npm ci - run: npm run lint - # test: - # runs-on: ubuntu-latest - # steps: - # - uses: actions/checkout@v1 - # with: - # fetch-depth: 1 - # - uses: actions/setup-node@v1 - # with: - # node-version: 12 - # - env: - # CI: true - # # COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }} - # run: npm ci - # - run: npm test -test: + test: runs-on: ${{ matrix.os }} strategy: matrix: