Skip to content

Commit

Permalink
Update deps, move to Github Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
davedoesdev committed Dec 7, 2021
1 parent 51ff7ee commit bf3ba8a
Show file tree
Hide file tree
Showing 7 changed files with 6,583 additions and 6,272 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: ci

on: [push, pull_request]

jobs:
test:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [17]

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Use Node.js
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}

- name: Install packages
run: npm install

- name: Lint
run: npx grunt lint

- name: Coverage
run: npx grunt coverage

- name: Coveralls
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
7 changes: 0 additions & 7 deletions .travis.yml

This file was deleted.

42 changes: 13 additions & 29 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
"use strict";

const c8 = "npx c8 -x Gruntfile.js -x 'test/**'";

module.exports = function (grunt)
{
grunt.initConfig(
Expand All @@ -12,14 +14,6 @@ module.exports = function (grunt)
}
},

mochaTest: {
src: ['test/*.js'],
options: {
timeout: 10000,
bail: true
}
},

apidox: {
input: ['index.js', 'events_doc.js'],
output: 'README.md',
Expand All @@ -28,36 +22,26 @@ module.exports = function (grunt)
doxOptions: { skipSingleStar: true }
},

shell: {
cover: {
command: "./node_modules/.bin/nyc -x Gruntfile.js -x 'test/**' ./node_modules/.bin/grunt test"
},
exec: Object.fromEntries(Object.entries({
test: 'mocha --bail --timeout 10000',

cover_report: {
command: './node_modules/.bin/nyc report -r lcov'
},
cover: `${c8} npx grunt test`,

cover_check: {
command: './node_modules/.bin/nyc check-coverage --statements 100 --branches 100 --functions 100 --lines 100'
},
cover_report: `${c8} report -r lcov`,

coveralls: {
command: 'cat coverage/lcov.info | coveralls'
}
}
cover_check: `${c8} check-coverage --statements 100 --branches 100 --functions 100 --lines 100`,
}).map(([k, cmd]) => [k, { cmd, stdio: 'inherit' }]))
});

grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-mocha-test');
grunt.loadNpmTasks('grunt-apidox');
grunt.loadNpmTasks('grunt-shell');
grunt.loadNpmTasks('grunt-exec');

grunt.registerTask('lint', 'jshint');
grunt.registerTask('test', 'mochaTest');
grunt.registerTask('test', 'exec:test');
grunt.registerTask('docs', 'apidox');
grunt.registerTask('coverage', ['shell:cover',
'shell:cover_report',
'shell:cover_check']);
grunt.registerTask('coveralls', 'shell:coveralls');
grunt.registerTask('coverage', ['exec:cover',
'exec:cover_report',
'exec:cover_check']);
grunt.registerTask('default', ['lint', 'test']);
};
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ grunt test
grunt coverage
```

[Istanbul](http://gotwarlost.github.io/istanbul/) results are available [here](http://rawgit.davedoesdev.com/davedoesdev/fastest-writable/master/coverage/lcov-report/index.html).
[c8](https://github.com/bcoe/c8) results are available [here](http://rawgit.davedoesdev.com/davedoesdev/fastest-writable/master/coverage/lcov-report/index.html).

Coveralls page is [here](https://coveralls.io/r/davedoesdev/fastest-writable).

Expand Down Expand Up @@ -91,6 +91,8 @@ Inherits from [`stream.Writable`](http://nodejs.org/docs/v0.11.13/api/stream.htm
- `{Object} [options]` Configuration options. This is passed onto `Writable`'s constructor and can contain the following extra property:
- `{Boolean} [end_peers_on_finish]` Whether to call [`writable.end`](http://nodejs.org/docs/v0.11.13/api/stream.html#stream_writable_end_chunk_encoding_callback) on all peers when this `FastestWritable` object emits a [`finish`](http://nodejs.org/docs/v0.11.13/api/stream.html#stream_event_finish) event. Defaults to `true`.

- `{Boolean} [destroy_peers_on_destroy]` Whether to call [`writable.destroy`](https://nodejs.org/dist/latest-v14.x/docs/api/stream.html#stream_writable_destroy_error) on all peers when this `FastestWritable` is destroyed. Defaults to `true`.

- `{Boolean} [emit_laggard]` Whether to emit an event named `laggard` on any peers which can't keep up _instead of_ ending them. Defaults to `false`.

<sub>Go: [TOC](#tableofcontents)</sub>
Expand Down
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ grunt test
grunt coverage
```
[Istanbul](http://gotwarlost.github.io/istanbul/) results are available [here](http://rawgit.davedoesdev.com/davedoesdev/fastest-writable/master/coverage/lcov-report/index.html).
[c8](https://github.com/bcoe/c8) results are available [here](http://rawgit.davedoesdev.com/davedoesdev/fastest-writable/master/coverage/lcov-report/index.html).
Coveralls page is [here](https://coveralls.io/r/davedoesdev/fastest-writable).
Expand Down
Loading

0 comments on commit bf3ba8a

Please sign in to comment.