Fix GitHub Actions (#820)

* fix test command
* use action for coverage upload
* specify branch
* limit paths
* forgot install
* fix badge
* don't need a workaround for Node 10
* shorten CI name
This commit is contained in:
Konstantin Vyatkin 2020-05-22 21:42:48 -04:00 committed by GitHub
parent c0a977c549
commit 912348d5dc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 31 additions and 29 deletions

View File

@ -1,11 +1,16 @@
name: Node.js CI
name: CI
on:
[pull_request, push]
push:
branches: [ master ]
pull_request:
paths:
- '*.js'
- 'package.json'
- '.github/workflows/ci.yml'
jobs:
build:
test:
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
@ -28,13 +33,15 @@ jobs:
- uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: npm test
if: matrix.node-version != '10.x'
- run: npm run coverage
if: matrix.node-version == '14.x' && matrix.os == 'ubuntu-latest'
- name: Test without coverage
if: matrix.node-version == '10.x'
run: |
npm install -D esm
npx mocha -r esm
- run: npm install
- run: npm test -- --colors
# upload coverage only once
- name: Coveralls
uses: coverallsapp/github-action@master
if: matrix.node == '14.x' && matrix.os == 'ubuntu-latest'
with:
github-token: ${{ secrets.GITHUB_TOKEN }}

View File

@ -1,4 +1,4 @@
name: Lint
name: CI
on:
pull_request:
@ -8,18 +8,13 @@ on:
- 'package.json'
- '.github/workflows/lint.yml'
jobs:
xo:
runs-on: [ubuntu-latest]
strategy:
matrix:
node-version: [12.x]
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
node-version: 14
- run: npm install
- run: npm run lint

View File

@ -2,7 +2,7 @@
<img src="docs/media/Banner.svg" alt="Node Fetch"/>
<br>
<p>A light-weight module that brings <code>window.fetch</code> to Node.js.</p>
<a href="https://github.com/node-fetch/node-fetch/actions"><img src="https://github.com/node-fetch/node-fetch/workflows/.github/workflows/ci.yml/badge.svg" alt="Build status"></a>
<a href="https://github.com/node-fetch/node-fetch/actions"><img src="https://github.com/node-fetch/node-fetch/workflows/CI/badge.svg?branch=master" alt="Build status"></a>
<a href="https://coveralls.io/github/node-fetch/node-fetch"><img src="https://img.shields.io/coveralls/github/node-fetch/node-fetch?style=flat-square" alt="Coverage status"></a>
<a href="https://packagephobia.now.sh/result?p=node-fetch"><img src="https://flat.badgen.net/packagephobia/install/node-fetch" alt="Current version"></a>
<a href="https://www.npmjs.com/package/node-fetch"><img src="https://img.shields.io/npm/v/node-fetch?style=flat-square" alt="Install size"></a>
@ -696,9 +696,9 @@ Thanks to [github/fetch](https://github.com/github/fetch) for providing a solid
## Team
[![David Frank](https://github.com/bitinn.png?size=100)](https://github.com/bitinn) | [![Jimmy Wärting](https://github.com/jimmywarting.png?size=100)](https://github.com/jimmywarting) | [![Antoni Kepinski](https://github.com/xxczaki.png?size=100)](https://github.com/xxczaki) | [![Richie Bendall](https://github.com/Richienb.png?size=100)](https://github.com/Richienb) | [![Gregor Martynus](https://github.com/gr2m.png?size=100)](https://github.com/gr2m)
---|---|---|---|---
[David Frank](https://bitinn.net/) | [Jimmy Wärting](https://jimmy.warting.se/) | [Antoni Kepinski](https://kepinski.me) | [Richie Bendall](https://www.richie-bendall.ml/) | [Gregor Martynus](https://twitter.com/gr2m)
| [![David Frank](https://github.com/bitinn.png?size=100)](https://github.com/bitinn) | [![Jimmy Wärting](https://github.com/jimmywarting.png?size=100)](https://github.com/jimmywarting) | [![Antoni Kepinski](https://github.com/xxczaki.png?size=100)](https://github.com/xxczaki) | [![Richie Bendall](https://github.com/Richienb.png?size=100)](https://github.com/Richienb) | [![Gregor Martynus](https://github.com/gr2m.png?size=100)](https://github.com/gr2m) |
| ----------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------- |
| [David Frank](https://bitinn.net/) | [Jimmy Wärting](https://jimmy.warting.se/) | [Antoni Kepinski](https://kepinski.me) | [Richie Bendall](https://www.richie-bendall.ml/) | [Gregor Martynus](https://twitter.com/gr2m) |
###### Former

View File

@ -20,7 +20,7 @@
},
"scripts": {
"build": "rollup -c",
"test": "node --experimental-modules node_modules/.bin/c8 --reporter=html --reporter=text --check-coverage node --experimental-modules node_modules/.bin/mocha",
"test": "node --experimental-modules node_modules/c8/bin/c8 --reporter=html --reporter=lcov --reporter=text --check-coverage node --experimental-modules node_modules/mocha/bin/mocha",
"coverage": "c8 report --reporter=text-lcov | coveralls",
"lint": "xo"
},