Skip to content

Commit f7cc01d

Browse files
authored
Merge pull request #292 from derbyjs/dev-updates
Switch CI to GitHub actions, update devDependencies
2 parents 1c91277 + 3030f3c commit f7cc01d

File tree

6 files changed

+67
-23
lines changed

6 files changed

+67
-23
lines changed

.eslintrc.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
// The ESLint ecmaVersion argument is inconsistently used. Some rules will ignore it entirely, so if the rule has
22
// been set, it will still error even if it's not applicable to that version number. Since Google sets these
33
// rules, we have to turn them off ourselves.
4-
const DISABLED_ES6_OPTIONS = {
4+
var DISABLED_ES6_OPTIONS = {
55
'no-var': 'off',
66
'prefer-rest-params': 'off',
77
'prefer-spread': 'off',
88
// Not supported in ES3
99
'comma-dangle': ['error', 'never']
1010
};
1111

12-
const CUSTOM_RULES = {
12+
var CUSTOM_RULES = {
1313
'one-var': 'off',
1414
// We control our own objects and prototypes, so no need for this check
1515
'guard-for-in': 'off',
@@ -18,7 +18,7 @@ const CUSTOM_RULES = {
1818
'indent': ['error', 2, {'SwitchCase': 1}],
1919
// Less aggressive line length than Google, which is especially useful when we have a lot of callbacks in our code
2020
'max-len': ['error', {code: 120, tabWidth: 2, ignoreUrls: true}],
21-
// Google overrides the default ESLint behaviour here, which is slightly better for catching erroneously unused variables
21+
// Go back to default ESLint behaviour here, which is slightly better for catching erroneously unused variables
2222
'no-unused-vars': ['error', {vars: 'all', args: 'after-used'}],
2323
'require-jsdoc': 'off',
2424
'valid-jsdoc': 'off'
@@ -27,11 +27,11 @@ const CUSTOM_RULES = {
2727
module.exports = {
2828
extends: 'google',
2929
parserOptions: {
30-
ecmaVersion: 3
30+
ecmaVersion: 5
3131
},
3232
rules: Object.assign(
3333
{},
3434
DISABLED_ES6_OPTIONS,
3535
CUSTOM_RULES
36-
),
36+
)
3737
};

.github/workflows/test.yml

+51
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs-or-python
2+
3+
4+
name: Test
5+
6+
on:
7+
push:
8+
branches:
9+
- master
10+
pull_request:
11+
branches:
12+
- master
13+
14+
jobs:
15+
test:
16+
name: Node.js ${{ matrix.node }}
17+
runs-on: ubuntu-latest
18+
strategy:
19+
matrix:
20+
node:
21+
- 10
22+
- 12
23+
- 14
24+
- 16
25+
timeout-minutes: 5
26+
steps:
27+
- uses: actions/checkout@v2
28+
- uses: actions/setup-node@v2
29+
with:
30+
node-version: ${{ matrix.node }}
31+
- run: npm install
32+
- run: npm run lint
33+
if: ${{ matrix.node >= 12 }} # eslint@8 only supports Node >= 12
34+
- run: npm run test-cover
35+
# https://github.com/marketplace/actions/coveralls-github-action#complete-parallel-job-example
36+
- name: Coveralls
37+
uses: coverallsapp/github-action@master
38+
with:
39+
github-token: ${{ secrets.GITHUB_TOKEN }}
40+
flag-name: node-${{ matrix.node }}
41+
parallel: true
42+
43+
finish:
44+
needs: test
45+
runs-on: ubuntu-latest
46+
steps:
47+
- name: Submit coverage
48+
uses: coverallsapp/github-action@master
49+
with:
50+
github-token: ${{ secrets.GITHUB_TOKEN }}
51+
parallel-finished: true

.mocharc.yml

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
reporter: spec
2+
timeout: 1200
3+
check-leaks: true
4+
recursive: true

.travis.yml

-8
This file was deleted.

package.json

+7-6
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,9 @@
1010
"main": "./lib/index.js",
1111
"scripts": {
1212
"lint": "eslint --ignore-path .gitignore .",
13-
"test": "node_modules/.bin/mocha && npm run lint",
14-
"test-cover": "node_modules/nyc/bin/nyc.js --temp-dir=coverage -r text -r lcov node_modules/mocha/bin/_mocha && npm run lint"
13+
"test": "node_modules/.bin/mocha",
14+
"posttest": "npm run lint",
15+
"test-cover": "node_modules/nyc/bin/nyc.js --temp-dir=coverage -r text -r lcov node_modules/mocha/bin/_mocha"
1516
},
1617
"dependencies": {
1718
"arraydiff": "^0.1.1",
@@ -22,10 +23,10 @@
2223
"devDependencies": {
2324
"chai": "^4.2.0",
2425
"coveralls": "^3.0.5",
25-
"eslint": "^5.16.0",
26-
"eslint-config-google": "^0.13.0",
27-
"mocha": "^6.1.4",
28-
"nyc": "^14.1.1"
26+
"eslint": "^8.1.0",
27+
"eslint-config-google": "^0.14.0",
28+
"mocha": "^9.1.3",
29+
"nyc": "^15.1.0"
2930
},
3031
"bugs": {
3132
"url": "https://github.com/derbyjs/racer/issues"

test/mocha.opts

-4
This file was deleted.

0 commit comments

Comments
 (0)