Skip to content

Commit

Permalink
fix: fixes after upgrades
Browse files Browse the repository at this point in the history
  • Loading branch information
dword-design committed Jul 4, 2020
1 parent b397de2 commit 2d1c78b
Show file tree
Hide file tree
Showing 7 changed files with 2,806 additions and 8,447 deletions.
32 changes: 23 additions & 9 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,37 +1,49 @@
name: build

on:
push:
branches:
- '**'

- "**"
jobs:
cancel-existing:
runs-on: ubuntu-latest
steps:
- uses: rokroskar/workflow-run-cleanup-action@v0.2.2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
test:
runs-on: ${{ matrix.os }}
needs: cancel-existing
strategy:
matrix:
os: [macos-latest, windows-latest, ubuntu-latest]
node: [10, 12]
os:
- macos-latest
- windows-latest
- ubuntu-latest
node:
- 10
- 12
exclude:
- os: macos-latest
node: 10
- os: windows-latest
node: 10
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node }}
- run: git config --global user.email "actions@github.com"
- run: git config --global user.name "GitHub Actions"
- run: yarn --frozen-lockfile
- run: yarn test
- name: Coveralls
if: matrix.os == 'ubuntu-latest' && matrix.node == 12
run: yarn dw-ci coveralls
env:
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_SERVICE_NAME: github
COVERALLS_GIT_COMMIT: ${{ github.sha }}
COVERALLS_GIT_BRANCH: ${{ github.ref }}

release:
needs: test
if: github.ref == 'refs/heads/master'
Expand All @@ -41,7 +53,10 @@ jobs:
- uses: actions/setup-node@v1
with:
node-version: 12
- run: git config --global user.email "actions@github.com"
- run: git config --global user.name "GitHub Actions"
- run: yarn --frozen-lockfile
- run: yarn lint
- name: Push changed files
run: yarn dw-ci push-changed-files
env:
Expand All @@ -51,5 +66,4 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
yarn semantic-release
run: yarn semantic-release
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
.DS_Store
/.babelrc.json
/.cz.json
/.editorconfig
/.env
/.env.json
/.eslintrc.json
/.nyc_output
/.releaserc.json
/.test.env.json
/.vscode
/coverage
/dist
Expand Down
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
<!-- BADGES/ -->
[![NPM version](https://img.shields.io/npm/v/tree-kill-promise.svg)](https://npmjs.org/package/tree-kill-promise)
![Linux macOS Windows compatible](https://img.shields.io/badge/os-linux%20%7C%C2%A0macos%20%7C%C2%A0windows-blue)

[![Build status](https://img.shields.io/github/workflow/status/dword-design/tree-kill-promise/build)](https://github.com/dword-design/tree-kill-promise/actions)
[![Coverage status](https://img.shields.io/coveralls/dword-design/tree-kill-promise)](https://coveralls.io/github/dword-design/tree-kill-promise)
[![Dependency status](https://img.shields.io/david/dword-design/tree-kill-promise)](https://david-dm.org/dword-design/tree-kill-promise)
Expand All @@ -19,7 +18,7 @@ Simple wrapper around the child_process module that makes use of promises.
<!-- /DESCRIPTION -->

<!-- INSTALL/ -->
# Install
## Install

```bash
# NPM
Expand All @@ -45,7 +44,7 @@ await kill(1, 'SIGKILL')
For more details please visit the [tree-kill docs](https://www.npmjs.com/package/tree-kill).

<!-- LICENSE/ -->
# License
## License

Unless stated otherwise all works are:

Expand Down
7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
],
"scripts": {
"commit": "base commit",
"depgraph": "base depgraph",
"dev": "base dev",
"lint": "base lint",
"prepare": "base prepare",
"prepublishOnly": "base prepublishOnly",
"release": "base release",
"test": "base test"
},
"dependencies": {
Expand All @@ -27,5 +27,8 @@
"fs-extra": "^8.1.0",
"port-ready": "^0.1.0",
"with-local-tmp-dir": "^2.2.8"
},
"publishConfig": {
"access": "public"
}
}
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import kill from 'tree-kill'

export default (...args) => new Promise(resolve => kill(...args, resolve))
export default (...args) => new Promise(resolve => kill(...args, resolve))
27 changes: 16 additions & 11 deletions src/index.spec.js
Original file line number Diff line number Diff line change
@@ -1,22 +1,27 @@
import withLocalTmpDir from 'with-local-tmp-dir'
import execa from 'execa'
import { endent } from '@dword-design/functions'
import { outputFile, chmod } from 'fs-extra'
import execa from 'execa'
import { chmod, outputFile } from 'fs-extra'
import portReady from 'port-ready'
import withLocalTmpDir from 'with-local-tmp-dir'

import kill from '.'

export default {
valid: () => withLocalTmpDir(async () => {
await outputFile('cli.js', endent`
valid: () =>
withLocalTmpDir(async () => {
await outputFile(
'cli.js',
endent`
#!/usr/bin/env node
import http from 'http'
http.createServer().listen(3000)
`)
await chmod('cli.js', '755')
const childProcess = execa.command('./cli.js')
await portReady(3000)
await kill(childProcess.pid)
}),
`
)
await chmod('cli.js', '755')
const childProcess = execa.command('./cli.js')
await portReady(3000)
await kill(childProcess.pid)
}),
}
Loading

0 comments on commit 2d1c78b

Please sign in to comment.