Skip to content
This repository was archived by the owner on Oct 10, 2022. It is now read-only.

Commit 98987cc

Browse files
authored
Merge pull request #78 from netlify/feat/use-github-actions
Use GitHub actions
2 parents 4f7ffea + 4508806 commit 98987cc

File tree

7 files changed

+72
-37
lines changed

7 files changed

+72
-37
lines changed

.github/workflows/workflow.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Build
2+
on: [push]
3+
env:
4+
CI: 'true'
5+
jobs:
6+
build:
7+
strategy:
8+
matrix:
9+
os: [ubuntu-latest, macOS-latest]
10+
node: [8.3.0, 13]
11+
exclude:
12+
- os: macOS-latest
13+
node: 8.3.0
14+
fail-fast: false
15+
runs-on: ${{ matrix.os }}
16+
steps:
17+
- name: Git checkout
18+
uses: actions/checkout@v1
19+
- name: Node.js ${{ matrix.node }}
20+
uses: actions/setup-node@v1
21+
with:
22+
node-version: ${{ matrix.node }}
23+
- name: Install dependencies
24+
run: npm install
25+
- name: Tests
26+
run: npm run test-ci
27+
- name: Codecov test coverage
28+
run: bash scripts/coverage.sh "${{ secrets.CODECOV_TOKEN }}" "${{ matrix.os }}" "${{ matrix.node }}"

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ dist
55
package-lock.json
66
yarn.lock
77
.vscode
8+
.eslintcache

.travis.yml

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

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# netlify/js-client
22

3-
[![npm version][npm-img]][npm] [![build status][travis-img]][travis] [![windows build status][av-img]][av]
3+
[![npm version][npm-img]][npm] [![build status][build-img]][build]
44
[![coverage][coverage-img]][coverage] [![dependencies][david-img]][david] [![downloads][dl-img]][dl]
55

66
A Netlify [open-api](https://github.com/netlify/open-api) client that works in the browser and Node.js.
@@ -205,11 +205,11 @@ MIT. See [LICENSE](LICENSE) for more details.
205205

206206
[npm-img]: https://img.shields.io/npm/v/netlify.svg
207207
[npm]: https://npmjs.org/package/netlify
208-
[travis-img]: https://img.shields.io/travis/netlify/js-client/master.svg
209-
[travis]: https://travis-ci.org/netlify/js-client
208+
[build-img]: https://github.com/netlify/js-client/workflows/Build/badge.svg
209+
[build]: https://github.com/netlify/js-client/actions
210210
[dl-img]: https://img.shields.io/npm/dm/netlify.svg
211211
[dl]: https://npmjs.org/package/netlify
212-
[coverage-img]: https://img.shields.io/coveralls/netlify/js-client/master.svg
213-
[coverage]: https://coveralls.io/github/netlify/js-client
212+
[coverage-img]: https://codecov.io/gh/netlify/js-client/branch/master/graph/badge.svg
213+
[coverage]: https://codecov.io/gh/netlify/js-client
214214
[david-img]: https://david-dm.org/netlify/js-client/status.svg
215215
[david]: https://david-dm.org/netlify/js-client

codecov.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
codecov:
2+
strict_yaml_branch: master
3+
coverage:
4+
range: [80, 100]
5+
parsers:
6+
javascript:
7+
enable_partials: true
8+
comment: false

package.json

Lines changed: 17 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
"@netlify/zip-it-and-ship-it": "^0.3.1",
3030
"backoff": "^2.5.0",
3131
"clean-deep": "^3.0.2",
32-
"debug": "^4.1.1",
3332
"flush-write-stream": "^2.0.0",
3433
"folder-walker": "^3.2.0",
3534
"from2-array": "0.0.4",
@@ -57,27 +56,26 @@
5756
"@babel/preset-env": "^7.4.3",
5857
"@babel/runtime": "^7.4.3",
5958
"auto-changelog": "^1.13.0",
60-
"ava": "1.2.1",
61-
"babel-eslint": "^10.0.1",
59+
"ava": "^2.4.0",
60+
"babel-eslint": "^10.0.3",
6261
"babel-loader": "^8.0.5",
63-
"coveralls": "^3.0.3",
64-
"dependency-check": "^3.3.0",
6562
"eslint": "^5.16.0",
66-
"eslint-config-prettier": "^4.1.0",
67-
"eslint-plugin-import": "^2.17.2",
68-
"eslint-plugin-node": "^8.0.1",
69-
"eslint-plugin-prettier": "^3.0.1",
63+
"eslint-config-prettier": "^6.5.0",
64+
"eslint-plugin-import": "^2.18.2",
65+
"eslint-plugin-node": "^10.0.0",
66+
"eslint-plugin-prettier": "^3.1.1",
7067
"from2-string": "^1.1.0",
7168
"gh-release": "^3.5.0",
69+
"husky": "^3.0.9",
7270
"nock": "^11.3.4",
7371
"npm-run-all": "^4.1.3",
74-
"nyc": "^13.3.0",
75-
"prettier": "^1.17.0",
72+
"nyc": "^14.1.1",
73+
"prettier": "^1.19.1",
7674
"webpack": "^4.30.0",
7775
"webpack-cli": "^3.3.1"
7876
},
7977
"engines": {
80-
"node": ">=8.0.0"
78+
"node": ">=8.3.0"
8179
},
8280
"homepage": "https://github.com/netlify/js-client",
8381
"keywords": [
@@ -95,15 +93,13 @@
9593
},
9694
"scripts": {
9795
"prepublishOnly": "run-s build && git push && git push --tags && gh-release",
98-
"ci": "run-s test coverage build",
99-
"test": "run-s test:*",
100-
"test:lint": "eslint --fix \"src/**/*.js\" \"*.js\"",
101-
"test:prettier": "prettier --write --loglevel warn \"src/**/*.js\" \"*.{js,md,yml,json}\"",
102-
"test:deps": "dependency-check ./package.json --entry \"src/**/!(*.test).js\" --unused --missing --no-dev --no-peer",
103-
"test:ava": "nyc --reporter=lcov ava --verbose",
104-
"test:nyc": "nyc report",
105-
"watch": "nyc --reporter=lcov ava --watch",
106-
"coverage": "nyc report --reporter=text-lcov | coveralls",
96+
"ci": "run-s test build",
97+
"test": "run-s test:* test:dev:*",
98+
"test-ci": "run-s test:* test:ci:*",
99+
"test:lint": "eslint --ignore-path .gitignore --fix --cache --format=codeframe --max-warnings=0 \"src/**/*.js\" \"*.js\"",
100+
"test:prettier": "prettier --ignore-path .gitignore --write --loglevel warn \"src/**/*.js\" \"*.{js,md,yml,json}\"",
101+
"test:dev:ava": "ava",
102+
"test:ci:ava": "nyc -r lcovonly -r text -r json ava",
107103
"build": "run-s build:*",
108104
"build:webpack": "webpack",
109105
"deptree": "depcruise --exclude '^node_modules' --output-type dot src | dot -T svg > site/dist/dependencygraph.svg",

scripts/coverage.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/bin/bash
2+
# Upload test coverage to Codecov
3+
4+
token="$1"
5+
6+
os="$2"
7+
os="${os/-latest/}"
8+
9+
node="$3"
10+
node="node_${node//./_}"
11+
12+
curl -s https://codecov.io/bash | \
13+
bash -s -- -Z -y codecov.yml -f coverage/coverage-final.json -t "$token" -F "$os" -F "$node"

0 commit comments

Comments
 (0)