From f0778f565e97aebca75301ba56ab2adb1fd70abe Mon Sep 17 00:00:00 2001 From: Jacek W Date: Wed, 19 Jun 2024 15:56:46 +0200 Subject: [PATCH] build: add `coveralls` action --- .github/workflows/coveralls.yml | 26 ++++++++++++++++++++++++++ package.json | 1 + 2 files changed, 27 insertions(+) create mode 100644 .github/workflows/coveralls.yml diff --git a/.github/workflows/coveralls.yml b/.github/workflows/coveralls.yml new file mode 100644 index 0000000..2130510 --- /dev/null +++ b/.github/workflows/coveralls.yml @@ -0,0 +1,26 @@ +name: Build + +on: + push: + branches: + - main + +jobs: + coveralls: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - uses: actions/setup-node@v4 + with: + node-version: "20" + - name: Install dependencies + run: npm install --no-optional + - name: Generate coverage + run: npm run coverage-lcov + - name: Coveralls + uses: coverallsapp/github-action@v2.3.0 + with: + github-token: ${{ github.token }} + file: ./coverage/lcov.info diff --git a/package.json b/package.json index 582b2da..5d09781 100644 --- a/package.json +++ b/package.json @@ -26,6 +26,7 @@ "license": "MIT", "scripts": { "coverage": "c8 npm test", + "coverage-lcov": "c8 npm test && c8 report --reporter=lcovonly", "coveralls": "c8 npm test && c8 report --reporter=text-lcov | coveralls", "lint": "eslint -c config/eslint.config.js src/**.*js", "pretest": "npm run lint",