Skip to content

Commit 5c468c4

Browse files
committed
chore: nyc test cov; fmt; @actions ci
Signed-off-by: Charlike Mike Reagent <[email protected]>
1 parent 7c8e9e0 commit 5c468c4

File tree

7 files changed

+764
-28
lines changed

7 files changed

+764
-28
lines changed

.github/workflows/nodejs.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: nodejs
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- master
7+
push:
8+
branches:
9+
- master
10+
11+
jobs:
12+
test:
13+
env:
14+
CI: true
15+
CODECOV_TOKEN: ${{secrets.CODECOV_TOKEN}}
16+
strategy:
17+
matrix:
18+
os: [ubuntu-latest, macos-latest]
19+
node: [10.x, 12.x]
20+
runs-on: ${{ matrix.os }}
21+
steps:
22+
- uses: actions/checkout@v1
23+
- uses: actions/cache@v1
24+
id: nodejs-cache
25+
name: Cache node modules
26+
with:
27+
path: node_modules
28+
key: ${{ matrix.os }}-nodejs-${{ matrix.node }}-${{ hashFiles('yarn.lock') }}
29+
restore-keys: |
30+
${{ matrix.os }}-nodejs-${{ matrix.node }}-
31+
${{ matrix.os }}-nodejs-
32+
${{ matrix.os }}-
33+
# - name: "Use Node.js ${{ matrix.node }}"
34+
# uses: actions/setup-node@v1
35+
# with:
36+
# node: ${{ matrix.node }}
37+
- name: Installing dependencies
38+
if: steps.nodejs-cache.outputs.cache-hit != 'true'
39+
run: yarn --frozen-lockfile
40+
- name: Linting codebase with ESLint & Prettier
41+
run: yarn lint && yarn fmt
42+
- name: Testing all packages
43+
run: yarn test:ci
44+
- name: Sending test coverage to CodeCov
45+
if: matrix.os == 'ubuntu-latest' && matrix.node == '12.x'
46+
run: echo ${{ matrix.node }} && bash <(curl -s https://codecov.io/bash)

.prettierrc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
'use strict';
22

3-
module.exports = require( '@tunnckocore/prettier-config');
3+
module.exports = require('@tunnckocore/prettier-config');

CODE_OF_CONDUCT.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,21 +14,21 @@ orientation.
1414
Examples of behavior that contributes to creating a positive environment
1515
include:
1616

17-
* Using welcoming and inclusive language
18-
* Being respectful of differing viewpoints and experiences
19-
* Gracefully accepting constructive criticism
20-
* Focusing on what is best for the community
21-
* Showing empathy towards other community members
17+
- Using welcoming and inclusive language
18+
- Being respectful of differing viewpoints and experiences
19+
- Gracefully accepting constructive criticism
20+
- Focusing on what is best for the community
21+
- Showing empathy towards other community members
2222

2323
Examples of unacceptable behavior by participants include:
2424

25-
* The use of sexualized language or imagery and unwelcome sexual attention or
26-
advances
27-
* Trolling, insulting/derogatory comments, and personal or political attacks
28-
* Public or private harassment
29-
* Publishing others' private information, such as a physical or electronic
25+
- The use of sexualized language or imagery and unwelcome sexual attention or
26+
advances
27+
- Trolling, insulting/derogatory comments, and personal or political attacks
28+
- Public or private harassment
29+
- Publishing others' private information, such as a physical or electronic
3030
address, without explicit permission
31-
* Other conduct which could reasonably be considered inappropriate in a
31+
- Other conduct which could reasonably be considered inappropriate in a
3232
professional setting
3333

3434
## Our Responsibilities

nyc.config.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
'use strict';
2+
3+
module.exports = {
4+
statements: 85,
5+
branches: 78,
6+
functions: 85,
7+
lines: 85,
8+
9+
'check-coverage': true,
10+
exclude: ['test'],
11+
include: ['src'],
12+
reporter: ['text', 'text-summary', 'lcov', 'clover'],
13+
};

package.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,12 @@
1616
},
1717
"scripts": {
1818
"cleanup": "rm -rf test/tmp",
19+
"fmt": "prettier '**/*.{md,js,json}' --write",
1920
"lint": "eslint . --cache --fix --quiet --format codeframe",
20-
"pretest": "yarn run cleanup",
21-
"test": "mkdir test/tmp && node test/run.js"
21+
"pretest": "yarn run cleanup && mkdir test/tmp",
22+
"test": "node test/run.js",
23+
"pretest:ci": "yarn pretest",
24+
"test:ci": "nyc node test/run.js"
2225
},
2326
"devDependencies": {
2427
"@tunnckocore/prettier-config": "^1.2.0",
@@ -27,6 +30,7 @@
2730
"eslint-config-prettier": "^6.10.0",
2831
"eslint-plugin-import": "^2.20.0",
2932
"eslint-plugin-prettier": "^3.1.2",
33+
"nyc": "^15.0.0",
3034
"prettier": "^1.19.1",
3135
"prettier-plugin-pkgjson": "^0.2.0",
3236
"request": "^2.88.0",

test-legacy/README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
1-
21
These tests were deleted due to failures when removing the gently lib.
3-
previously in `test/legacy`
2+
previously in `test/legacy`

0 commit comments

Comments
 (0)