Skip to content

Commit abad05e

Browse files
authoredOct 21, 2024··
ci: Migrate from istanbul to nyc; add lint job to CI (#225)
1 parent 0e0d721 commit abad05e

File tree

7 files changed

+2688
-556
lines changed

7 files changed

+2688
-556
lines changed
 

‎.github/workflows/ci.yml

+44-18
Original file line numberDiff line numberDiff line change
@@ -7,27 +7,53 @@ on:
77
branches:
88
- '**'
99
jobs:
10-
test:
10+
lint:
11+
name: Lint
12+
timeout-minutes: 15
1113
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v4
16+
- name: Use Node.js
17+
uses: actions/setup-node@v4
18+
with:
19+
cache: npm
20+
- name: Install dependencies
21+
run: npm ci
22+
- name: Lint
23+
run: npm run lint
24+
test:
1225
strategy:
1326
matrix:
14-
node: [ '14', '16', '18' ]
15-
timeout-minutes: 30
16-
env:
17-
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
27+
include:
28+
- name: Node.js 14
29+
NODE_VERSION: 14
30+
- name: Node.js 16
31+
NODE_VERSION: 16
32+
- name: Node.js 18
33+
NODE_VERSION: 18
34+
fail-fast: false
35+
name: ${{ matrix.name }}
36+
timeout-minutes: 15
37+
runs-on: ubuntu-latest
1838
steps:
19-
- uses: actions/checkout@v2
20-
- name: Use Node.js
21-
uses: actions/setup-node@v2
39+
- uses: actions/checkout@v4
40+
- name: Use Node.js ${{ matrix.NODE_VERSION }}
41+
uses: actions/setup-node@v4
2242
with:
23-
node-version: ${{ matrix.node }}
24-
- name: Cache Node.js modules
25-
uses: actions/cache@v2
43+
node-version: ${{ matrix.NODE_VERSION }}
44+
cache: npm
45+
- name: Install dependencies
46+
run: npm ci
47+
- name: Run tests
48+
run: npm run test
49+
- name: Upload code coverage
50+
uses: codecov/codecov-action@v4
2651
with:
27-
path: ~/.npm
28-
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
29-
restore-keys: |
30-
${{ runner.os }}-node-
31-
- run: npm ci
32-
- run: npm run test
33-
- run: ./node_modules/.bin/codecov
52+
fail_ci_if_error: false
53+
token: ${{ secrets.CODECOV_TOKEN }}
54+
env:
55+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
56+
57+
concurrency:
58+
group: ${{ github.workflow }}-${{ github.ref }}
59+
cancel-in-progress: true

‎.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ pids
1212
lib-cov
1313

1414
# Coverage directory used by tools like istanbul
15+
.nyc_output
1516
coverage
1617

1718
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)

‎.nycrc

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"all": true,
3+
"reporter": [
4+
"lcov",
5+
"text-summary"
6+
],
7+
"include": [
8+
"src/**/*.js"
9+
],
10+
"exclude": [
11+
"**/spec/**"
12+
]
13+
}

‎config/default.json

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"accessKey": "accessKey",
3+
"secretKey": "secretKey",
4+
"insufficientOptions": {
5+
"accessKey": "accessKey",
6+
"secretKey": "secretKey"
7+
},
8+
"bucket": "bucket",
9+
"objectWithBucket": {
10+
"bucket": "bucket"
11+
},
12+
"emptyObject": {},
13+
"paramsObjectWBucket": {
14+
"params": {
15+
"Bucket": "bucket"
16+
}
17+
}
18+
}

‎package-lock.json

+2,610-518
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"main": "index.js",
66
"scripts": {
77
"pretest": "npm run lint",
8-
"test": "NODE_ENV=test NODE_CONFIG_DIR=./spec/config istanbul cover -x **/spec/** jasmine --captureExceptions",
8+
"test": "nyc jasmine",
99
"lint": "eslint --cache ./",
1010
"lint:fix": "eslint --fix --cache ./"
1111
},
@@ -39,7 +39,7 @@
3939
"eslint": "7.13.0",
4040
"eslint-config-airbnb-base": "14.2.1",
4141
"eslint-plugin-import": "2.22.1",
42-
"istanbul": "0.4.5",
42+
"nyc": "17.1.0",
4343
"jasmine": "3.5.0",
4444
"parse": "3.3.1",
4545
"parse-server-conformance-tests": "1.0.0",

‎spec/config/test.js

-18
This file was deleted.

0 commit comments

Comments
 (0)
Please sign in to comment.