Move to Github Actions (#785)

* Move to Github Actions
* remove Travis in favor of GitHub Actions

Signed-off-by: Moni <40552237+NotMoni@users.noreply.github.com>
Co-authored-by: Linus Unnebäck <linus@folkdatorn.se>
Co-authored-by: Konstantin Vyatkin <tino@vtkn.io>
This commit is contained in:
Moni 2020-05-22 16:35:14 -04:00 committed by GitHub
parent 63d3663466
commit 29d7556870
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 66 additions and 16 deletions

40
.github/workflows/ci.yml vendored Normal file
View File

@ -0,0 +1,40 @@
name: Node.js CI
on:
[pull_request]
jobs:
build:
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
node: [14.x, 12.x, 10.x]
exclude:
# On Windows, run tests with only the LTS environments.
- os: windows-latest
node: 10.x
- os: windows-latest
node: 14.x
# On macOS, run tests with only the LTS environments.
- os: macOS-latest
node: 10.x
- os: macOS-latest
node: 14.x
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- 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

25
.github/workflows/lint.yml vendored Normal file
View File

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

View File

@ -1,15 +0,0 @@
language: node_js
node_js:
- "lts/*" # Latest LTS
- "node" # Latest Stable
matrix:
include:
- # Linting stage
node_js: "lts/*" # Latest LTS
script: npm run lint
cache: npm
after_success: npm run coverage

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://travis-ci.com/node-fetch/node-fetch"><img src="https://img.shields.io/travis/com/node-fetch/node-fetch/master?style=flat-square" alt="Build status"></a>
<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://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>