Skip to content

Commit fcb7af0

Browse files
authored
refactor: migrate travis to github actions (#73)
1 parent 6a92c1d commit fcb7af0

File tree

3 files changed

+52
-12
lines changed

3 files changed

+52
-12
lines changed

.github/workflows/build.yaml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Node.js CI
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- master
8+
schedule:
9+
- cron: '0 0 * * 0' # weekly
10+
11+
jobs:
12+
test:
13+
runs-on: ubuntu-latest
14+
name: Node.js
15+
strategy:
16+
matrix:
17+
node-version: [12.x, 14.x, 16.x]
18+
19+
steps:
20+
- uses: actions/checkout@v2
21+
- name: Set up Node.js ${{ matrix.node-version }}
22+
uses: actions/setup-node@v1
23+
with:
24+
node-version: ${{ matrix.node-version }}
25+
- name: Cache Node.js modules
26+
uses: actions/cache@v2
27+
with:
28+
# npm cache files are stored in `~/.npm` on Linux/macOS
29+
path: ~/.npm
30+
key: ${{ runner.OS }}-node-${{ hashFiles('**/package-lock.json') }}
31+
restore-keys: |
32+
${{ runner.OS }}-node-
33+
${{ runner.OS }}-
34+
- run: npm ci
35+
- run: npm test
36+
- name: Coveralls Parallel
37+
uses: coverallsapp/github-action@master
38+
with:
39+
github-token: ${{ secrets.github_token }}
40+
flag-name: run-${{ matrix.test_number }}
41+
parallel: true
42+
43+
finish:
44+
needs: test
45+
runs-on: ubuntu-latest
46+
steps:
47+
- name: Coveralls Finished
48+
uses: coverallsapp/github-action@master
49+
with:
50+
github-token: ${{ secrets.github_token }}
51+
parallel-finished: true

.travis.yml

Lines changed: 0 additions & 10 deletions
This file was deleted.

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@
44
"description": "Validate GraphQL fields",
55
"main": "index.js",
66
"scripts": {
7-
"test": "standard && nyc --reporter=html --reporter=text mocha test/**/*.test.js",
8-
"coverage": "nyc report --reporter=text-lcov | coveralls"
7+
"test": "standard && nyc --reporter=html --reporter=text --reporter=lcov mocha test/**/*.test.js"
98
},
109
"author": "James Mortemore ([email protected])",
1110
"license": "ISC",

0 commit comments

Comments
 (0)