Skip to content

Commit d6397e6

Browse files
committed
Add CI and coverage report
1 parent f52361c commit d6397e6

File tree

4 files changed

+64
-1
lines changed

4 files changed

+64
-1
lines changed

.github/workflows/lint.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# This workflow will do a clean install of node dependencies and run the linter
2+
3+
name: Node.js CI
4+
5+
on:
6+
push:
7+
branches: [ master ]
8+
pull_request:
9+
branches: [ master ]
10+
11+
jobs:
12+
lint:
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- uses: actions/checkout@v2
17+
18+
- name: Use Node.js 12
19+
uses: actions/setup-node@v1
20+
with:
21+
node-version: '12'
22+
23+
- run: npm ci
24+
25+
- run: npm run lint

.github/workflows/test.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# This workflow will do a clean install of node dependencies and run the linter
2+
3+
name: Node.js CI
4+
5+
on:
6+
push:
7+
branches: [ master ]
8+
pull_request:
9+
branches: [ master ]
10+
11+
jobs:
12+
test:
13+
runs-on: ubuntu-latest
14+
15+
strategy:
16+
matrix:
17+
node-version: [10.x, 12.x, 14.x]
18+
19+
steps:
20+
- uses: actions/checkout@v2
21+
22+
- name: Use Node.js ${{ matrix.node-version }}
23+
uses: actions/setup-node@v1
24+
with:
25+
node-version: ${{ matrix.node-version }}
26+
27+
- run: npm ci
28+
29+
- run: npm run test:coverage
30+
31+
- name: Coveralls GitHub Action
32+
uses: coverallsapp/[email protected]
33+
with:
34+
github-token: ${{ secrets.GITHUB_TOKEN }}

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
44
[![NPM Version][npm-image]][npm-url]
55
[![Downloads Stats][npm-downloads]][npm-url]
6+
[![Coverage Status][coveralls-image]](coveralls-url)
67

78
## What's it all about?
89
SQL Highlight is a small package that highlights SQL queries. It can output to
@@ -119,4 +120,6 @@ very little similarity with the original repo.
119120

120121
[npm-image]: https://img.shields.io/npm/v/sql-highlight.svg
121122
[npm-url]: https://npmjs.org/package/sql-highlight
122-
[npm-downloads]: https://img.shields.io/npm/dm/sql-highlight.svg
123+
[npm-downloads]: https://img.shields.io/npm/dm/sql-highlight.svg
124+
[coveralls-image]: https://coveralls.io/repos/github/scriptcoded/sql-highlight/badge.svg
125+
[coveralls-url]: https://coveralls.io/github/scriptcoded/sql-highlight

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
"scripts": {
1111
"pretest": "npm run lint",
1212
"test": "jest",
13+
"test:coverage": "jest --coverage",
1314
"lint": "eslint ."
1415
},
1516
"keywords": [

0 commit comments

Comments
 (0)