Skip to content

Commit e65d149

Browse files
author
Benjamin E. Coe
authored
build: add GitHub actions config for unit tests
* build: add GitHub actions config for unit tests * chore: link root directory before linting * chore: also need to npm i
1 parent 6f05f15 commit e65d149

File tree

2 files changed

+59
-1
lines changed

2 files changed

+59
-1
lines changed

.github/workflows/ci.yaml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
on:
2+
push:
3+
branches:
4+
- master
5+
pull_request:
6+
name: ci
7+
jobs:
8+
test:
9+
runs-on: ubuntu-latest
10+
strategy:
11+
matrix:
12+
node: [8, 10, 12, 13]
13+
steps:
14+
- uses: actions/checkout@v1
15+
- uses: actions/setup-node@v1
16+
with:
17+
node-version: ${{ matrix.node }}
18+
- run: node --version
19+
- run: npm install
20+
- run: npm test
21+
windows:
22+
runs-on: windows-latest
23+
steps:
24+
- uses: actions/checkout@v2
25+
- uses: actions/setup-node@v1
26+
with:
27+
node-version: 12
28+
- run: npm install
29+
- run: npm test
30+
lint:
31+
runs-on: ubuntu-latest
32+
steps:
33+
- uses: actions/checkout@v1
34+
- uses: actions/setup-node@v1
35+
with:
36+
node-version: 12
37+
- run: npm install
38+
- run: npm run lint
39+
docs:
40+
runs-on: ubuntu-latest
41+
steps:
42+
- uses: actions/checkout@v1
43+
- uses: actions/setup-node@v1
44+
with:
45+
node-version: 12
46+
- run: npm install
47+
- run: npm run docs-test
48+
coverage:
49+
runs-on: ubuntu-latest
50+
steps:
51+
- uses: actions/checkout@v1
52+
- uses: actions/setup-node@v1
53+
with:
54+
node-version: 12
55+
- run: npm install
56+
- run: npm test
57+
- run: ./node_modules/.bin/c8 report --reporter=text-lcov | npx codecov@3 -t ${{ secrets.CODECOV_TOKEN }} --pipe

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@
4343
"proto:datastore": "mkdir -p proto && pbjs -t static-module -w commonjs -p node_modules/google-proto-files google/datastore/v1/datastore.proto | pbts -i long -o proto/datastore.d.ts -",
4444
"proto:appenginekey": "mkdir -p proto && pbjs -t static-module -w commonjs protos/app_engine_key.proto | pbts -o proto/app_engine_key.d.ts -",
4545
"docs-test": "linkinator docs",
46-
"predocs-test": "npm run docs"
46+
"predocs-test": "npm run docs",
47+
"prelint": "cd samples; npm link ../; npm i"
4748
},
4849
"dependencies": {
4950
"@google-cloud/projectify": "^1.0.0",

0 commit comments

Comments
 (0)