Skip to content

Commit

Permalink
ci: add coveralls (#11)
Browse files Browse the repository at this point in the history
* ci: add coveralls
  • Loading branch information
zekth authored Nov 29, 2021
1 parent 05aed2d commit 6594b8d
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 6 deletions.
32 changes: 28 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,35 @@ jobs:
# Unit and lint tests
- name: Tests
id: test
run: npm test
run: npm run test:ci

- name: Typescript
id: typescript_test
run: npm run typescript --if-present
- name: Coveralls Parallel
id: coveralls-parallel
continue-on-error: true
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.github_token }}
parallel: true
flag-name: run-${{ matrix.node-version }}-${{ matrix.os }}

- name: Should Trigger coverallsapp/github-action@master
id: coveralls-trigger
# https://docs.github.com/en/actions/reference/context-and-expression-syntax-for-github-actions#steps-context
# when continue-on-error failed, outcome is failure and conclusion is success
if: steps.coveralls-parallel.conclusion == 'success' && steps.coveralls-parallel.outcome != 'success'
run: |
echo "::set-output name=COVERALLS_TRIGGER::failure"
coverage:
needs: test
runs-on: ubuntu-latest
if: needs.test.outputs.COVERALLS != 'failure'
steps:
- name: Coveralls Finished
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
parallel-finished: true

automerge:
needs: test
Expand Down
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# fast-uri

<div align="center">

[![CI](https://github.com/fastify/fastify/workflows/ci/badge.svg)](https://github.com/fastify/fast-uri/actions/workflows/ci.yml)
[![Coverage Status](https://coveralls.io/repos/github/fastify/fast-uri/badge.svg?branch=add_coveralls)](https://coveralls.io/github/fastify/fast-uri?branch=main)
[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat)](https://standardjs.com/)

</div>

Dependency free RFC 3986 URI toolbox.

## Benchmarks
Expand Down
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,13 @@
"test:lint": "standard | snazzy",
"test:typescript": "tsd",
"test:unit": "tap -J test/*.test.js",
"test:unit:dev" : "tap -J test/*.test.js --coverage-report=html",
"test": "npm run test:lint && npm run test:unit && npm run test:typescript"
"test:unit:dev": "tap -J test/*.test.js --coverage-report=html",
"test": "npm run test:lint && npm run test:unit && npm run test:typescript",
"test:ci": "npm run test:lint && npm run test:unit -- --cov --coverage-report=lcovonly && npm run test:typescript"
},
"devDependencies": {
"benchmark": "^2.1.4",
"coveralls": "^3.1.1",
"snazzy": "^9.0.0",
"standard": "^16.0.4",
"tap": "^15.0.10",
Expand Down

0 comments on commit 6594b8d

Please sign in to comment.