Skip to content

Commit 19d854a

Browse files
authored
chore: update docs and ci (#108)
* chore(scripts): sort alphabetically ascending order Sorted list should allow for quicker reference when looking at scripts * ci(dependabot): auto update github actions * docs(readme): add badges * ci: ignore documentation updates * ci: add parallel test coverage calculation
1 parent 3f38eb7 commit 19d854a

File tree

4 files changed

+50
-16
lines changed

4 files changed

+50
-16
lines changed

.github/dependabot.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
version: 2
22
updates:
3+
- package-ecosystem: github-actions
4+
directory: '/'
5+
schedule:
6+
interval: daily
7+
open-pull-requests-limit: 10
38
- package-ecosystem: npm
49
directory: '/'
510
schedule:
611
interval: daily
712
open-pull-requests-limit: 10
8-

.github/workflows/ci.yml

Lines changed: 34 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,45 @@
11
name: CI workflow
2-
on: [push, pull_request]
2+
on:
3+
push:
4+
paths-ignore:
5+
- 'docs/**'
6+
- '*.md'
7+
pull_request:
8+
paths-ignore:
9+
- 'docs/**'
10+
- '*.md'
311
jobs:
412
test:
513
runs-on: ubuntu-latest
614
strategy:
715
matrix:
816
node-version: [10.x, 12.x, 13.x, 14.x]
917
steps:
10-
- uses: actions/checkout@v2
11-
- name: Use Node.js ${{ matrix.node-version }}
12-
uses: actions/setup-node@v1
13-
with:
14-
node-version: ${{ matrix.node-version }}
15-
- name: Install Dependencies
16-
run: npm install --ignore-scripts
17-
- name: Test
18-
run: npm test
18+
- uses: actions/checkout@v2
19+
- name: Use Node.js ${{ matrix.node-version }}
20+
uses: actions/setup-node@v1
21+
with:
22+
node-version: ${{ matrix.node-version }}
23+
- name: Install Dependencies
24+
run: npm install --ignore-scripts
25+
- name: Tests
26+
run: npm run test:ci
27+
- name: Coveralls Parallel
28+
uses: coverallsapp/[email protected]
29+
with:
30+
github-token: ${{ secrets.github_token }}
31+
parallel: true
32+
flag-name: run-${{ matrix.node-version }}-${{ matrix.os }}
33+
34+
coverage:
35+
needs: test
36+
runs-on: ubuntu-latest
37+
steps:
38+
- name: Coveralls Finished
39+
uses: coverallsapp/[email protected]
40+
with:
41+
github-token: ${{ secrets.GITHUB_TOKEN }}
42+
parallel-finished: true
1943

2044
automerge:
2145
needs: test

README.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
# fastify-cors
22

3-
[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat)](http://standardjs.com/) ![CI workflow](https://github.com/fastify/fastify-cors/workflows/CI%20workflow/badge.svg)
3+
![CI workflow](https://github.com/fastify/fastify-cors/workflows/CI%20workflow/badge.svg)
4+
[![NPM version](https://img.shields.io/npm/v/fastify-cors.svg?style=flat)](https://www.npmjs.com/package/fastify-cors)
5+
[![Known Vulnerabilities](https://snyk.io/test/github/fastify/fastify-cors/badge.svg)](https://snyk.io/test/github/fastify/fastify-cors)
6+
[![Coverage Status](https://coveralls.io/repos/github/fastify/fastify-cors/badge.svg?branch=master)](https://coveralls.io/github/fastify/fastify-cors?branch=master)
7+
[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat)](https://standardjs.com/)
8+
49

510
`fastify-cors` enables the use of [CORS](https://en.wikipedia.org/wiki/Cross-origin_resource_sharing) in a Fastify application.
611

package.json

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,15 @@
55
"main": "index.js",
66
"types": "index.d.ts",
77
"scripts": {
8+
"coverage": "tap --cov --coverage-report=html test",
89
"lint": "npm run lint:standard && npm run lint:typescript",
9-
"lint:standard": "standard",
1010
"lint:fix": "standard --fix",
11+
"lint:standard": "standard",
1112
"lint:typescript": "standard --parser @typescript-eslint/parser --plugin @typescript-eslint/eslint-plugin test/*.ts",
12-
"unit": "tap --100 test/*.test.js",
13-
"typescript": "tsd",
1413
"test": "npm run lint && npm run unit && npm run typescript",
15-
"coverage": "tap --cov --coverage-report=html test"
14+
"test:ci": "npm run lint && tap test/*.test.js --coverage-report=lcovonly && npm run typescript",
15+
"typescript": "tsd",
16+
"unit": "tap --100 test/*.test.js"
1617
},
1718
"keywords": [
1819
"fastify",

0 commit comments

Comments
 (0)