Skip to content

Commit b1ae2be

Browse files
committed
chore: GH actions CI #123
1 parent c685ebe commit b1ae2be

File tree

10 files changed

+118
-49
lines changed

10 files changed

+118
-49
lines changed

.github/workflows/alpine.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: test-alpine
2+
3+
on:
4+
push:
5+
branches: '*'
6+
pull_request:
7+
branches: '*'
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
name: Test alpine
13+
steps:
14+
- uses: actions/checkout@v2
15+
- run: |
16+
docker build . -t pidusage
17+
docker run -v $(pwd):/var/pidusage pidusage:latest npm install
18+
docker run -v $(pwd):/var/pidusage pidusage:latest npm test

.github/workflows/lint.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: lint
2+
3+
on:
4+
push:
5+
branches: '*'
6+
pull_request:
7+
branches: '*'
8+
9+
jobs:
10+
lint:
11+
runs-on: ubuntu-latest
12+
name: Lint
13+
steps:
14+
- name: Setup repo
15+
uses: actions/checkout@v2
16+
- name: Setup node
17+
uses: actions/setup-node@v1
18+
- name: Install dev dependencies
19+
run: |
20+
npm install --only=dev
21+
- name: Run lint
22+
run: npm run lint

.github/workflows/macos.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: test-macos
2+
3+
on:
4+
push:
5+
branches: '*'
6+
pull_request:
7+
branches: '*'
8+
9+
jobs:
10+
test:
11+
runs-on: macos-latest
12+
name: Test MacOS
13+
steps:
14+
- uses: actions/checkout@v2
15+
- name: Setup node
16+
uses: actions/setup-node@v2
17+
- run: npm install
18+
- run: npm test

.github/workflows/test.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: linux
2+
3+
on:
4+
push:
5+
branches: '*'
6+
pull_request:
7+
branches: '*'
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
strategy:
13+
matrix:
14+
node: [ '10', '12', '14', '16' ]
15+
name: Test Node ${{ matrix.node }}
16+
steps:
17+
- uses: actions/checkout@v2
18+
- name: Setup node
19+
uses: actions/setup-node@v2
20+
with:
21+
node-version: ${{ matrix.node }}
22+
- run: npm install
23+
- run: npm test
24+
coverage:
25+
runs-on: ubuntu-latest
26+
name: Test coverage
27+
steps:
28+
- uses: actions/checkout@v2
29+
- name: Setup node
30+
uses: actions/setup-node@v2
31+
- run: npm install
32+
- run: npm run coverage

.github/workflows/windows.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: test-windows
2+
3+
on:
4+
push:
5+
branches: '*'
6+
pull_request:
7+
branches: '*'
8+
9+
jobs:
10+
test:
11+
runs-on: windows-latest
12+
name: Test Windows
13+
steps:
14+
- uses: actions/checkout@v2
15+
- name: Setup node
16+
uses: actions/setup-node@v2
17+
- run: npm install
18+
- run: npm test

.travis.yml

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

README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
# pidusage
22

3-
[![Mac/Linux Build Status](https://img.shields.io/travis/soyuka/pidusage/master.svg?label=MacOS%20%26%20Linux)](https://travis-ci.org/soyuka/pidusage)
4-
[![Windows Build status](https://img.shields.io/appveyor/ci/soyuka/pidusage/master.svg?label=Windows)](https://ci.appveyor.com/project/soyuka/pidusage)
3+
[![Lint](https://github.com/soyuka/pidusage/workflows/lint/badge.svg?branch=main)](https://github.com/soyuka/pidusage/actions?query=workflow:lint+branch:main)
4+
[![MacOS](https://github.com/soyuka/pidusage/workflows/macos/badge.svg?branch=main)](https://github.com/soyuka/pidusage/actions?query=workflow:macos+branch:main)
5+
[![Ubuntu](https://github.com/soyuka/pidusage/workflows/test/badge.svg?branch=main)](https://github.com/soyuka/pidusage/actions?query=workflow:test+branch:main)
6+
[![Windows](https://github.com/soyuka/pidusage/workflows/windows/badge.svg?branch=main)](https://github.com/soyuka/pidusage/actions?query=workflow:windows+branch:main)
7+
[![Alpine](https://github.com/soyuka/pidusage/workflows/alpine/badge.svg?branch=main)](https://github.com/soyuka/pidusage/actions?query=workflow:alpine+branch:main)
58
[![Code coverage](https://img.shields.io/codecov/c/github/soyuka/pidusage/master.svg)](https://codecov.io/gh/soyuka/pidusage)
69
[![npm version](https://img.shields.io/npm/v/pidusage.svg)](https://www.npmjs.com/package/pidusage)
710
[![license](https://img.shields.io/github/license/soyuka/pidusage.svg)](https://github.com/soyuka/pidusage/tree/master/license)

appveyor.yml

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

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
"scripts": {
2424
"lint": "standard",
2525
"test": "nyc ava -m \"!*benchmark*\"",
26-
"alpine": "docker run -v $(pwd):/var/pidusage pidusage:latest npm test",
2726
"coverage": "codecov",
2827
"bench": "ava -m \"*benchmark*\""
2928
},

test/integration.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,3 +137,8 @@ test.cb('should exit right away because the event loop ignores history', t => {
137137
test.cb("should use the callback if it's provided", t => {
138138
m(process.pid, () => t.end())
139139
})
140+
141+
process.on('unhandledException', (e) => {
142+
console.error(e)
143+
process.exit(1)
144+
})

0 commit comments

Comments
 (0)