Skip to content

Commit

Permalink
fix #18 add support for node 16 (#19)
Browse files Browse the repository at this point in the history
  • Loading branch information
regevbr authored Apr 11, 2022
1 parent e2eda93 commit 9941669
Show file tree
Hide file tree
Showing 8 changed files with 232 additions and 38 deletions.
41 changes: 41 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: bug
assignees: regevbr

---

Your issue may already be reported!
Please search on the [issue tracker](../) before creating one.

## Expected Behavior
<!--- If you're describing a bug, tell us what should happen -->
<!--- If you're suggesting a change/improvement, tell us how it should work -->

## Current Behavior
<!--- If describing a bug, tell us what happens instead of the expected behavior -->
<!--- If suggesting a change/improvement, explain the difference from current behavior -->

## Possible Solution
<!--- Not obligatory, but suggest a fix/reason for the bug, -->
<!--- or ideas how to implement the addition or change -->

## Steps to Reproduce (for bugs)
<!--- Provide a link to a live example, or an unambiguous set of steps to -->
<!--- reproduce this bug. Include code to reproduce, if relevant -->
1.
2.
3.
4.

## Context
<!--- How has this issue affected you? What are you trying to accomplish? -->
<!--- Providing context helps us come up with a solution that is most useful in the real world -->

## Your Environment
<!--- Include as many relevant details about the environment you experienced the bug in -->
* Version used:
* Node version:

20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: enhancement
assignees: regevbr

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
29 changes: 29 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
A similar PR may already be submitted!
Please search among the [Pull request](../) before creating one.

Thanks for submitting a pull request! Please provide enough information so that others can review your pull request:

For more information, see the `CONTRIBUTING` guide.


**Summary**

<!-- Summary of the PR -->

This PR fixes/implements the following **bugs/features**

* [ ] Bug 1
* [ ] Bug 2
* [ ] Feature 1
* [ ] Feature 2
* [ ] Breaking changes

<!-- You can skip this if you're fixing a typo or alike -->

Explain the **motivation** for making this change. What existing problem does the pull request solve?

<!-- Example: When "Adding a function to do X", explain why it is necessary to have a way to do X. -->

**Test plan (required)**

<!-- Make sure tests pass on both Travis and locally. -->
130 changes: 130 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
name: CI

on:
push:
branches:
- master
release:
types: [ published ]
pull_request:
branches:
- '**'

env:
PRIMARY_NODE_VERSION: 16.x
PRIMARY_OS: ubuntu-latest
REGISTRY: https://registry.npmjs.org/

jobs:
test:
name: CI
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ ubuntu-latest ]
node-version: [ 6.x, 8.x, 10.x, 12.x, 14.x, 16.x ]

steps:

- name: Echo env variables
run: |
echo ref: ${{ github.event.client_payload.ref || github.ref }}
echo sha: ${{ github.event.client_payload.sha || github.sha }}
echo head ref: ${{ github.event.client_payload.head_ref || github.head_ref }}
echo base ref: ${{ github.event.client_payload.base_ref || github.base_ref }}
echo action: ${{ github.action }}
echo event: ${{ github.event_name }}
- uses: actions/checkout@v2
name: Checkout
with:
ref: ${{ github.event.client_payload.ref || github.ref }}

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}

- name: Get npm cache directory
id: npm-cache-dir
run: |
echo "::set-output name=dir::$(npm config get cache)"
- uses: actions/cache@v2
id: npm-cache
with:
path: ${{ steps.npm-cache-dir.outputs.dir }}
key: ${{ matrix.os }}-${{ matrix.node-version }}-node
restore-keys: |
${{ matrix.os }}-${{ matrix.node-version }}-node
- name: Install dependencies and build
run: |
npm install
npm run build
- name: Snyk security check
if: matrix.node-version == env.PRIMARY_NODE_VERSION && matrix.os == env.PRIMARY_OS
uses: snyk/actions/node@master
env:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}

- name: Run unit tests with coverage
if: matrix.node-version == env.PRIMARY_NODE_VERSION && matrix.os == env.PRIMARY_OS
uses: paambaati/[email protected]
env:
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
with:
coverageCommand: npm run cover

- name: Run unit tests
if: "!(matrix.node-version == env.PRIMARY_NODE_VERSION && matrix.os == env.PRIMARY_OS)"
run: npm run mocha

publish_version:
name: Publish
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ ubuntu-latest ]
node-version: [ 6.x ]
needs: [ test ]
if: github.event_name == 'release' && github.event.action == 'published'
steps:

- name: Checkout
uses: actions/checkout@v2

- name: fetch
run: |
git fetch --prune --unshallow
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
registry-url: ${{ env.REGISTRY }}

- name: Get npm cache directory
id: npm-cache-dir
run: |
echo "::set-output name=dir::$(npm config get cache)"
- uses: actions/cache@v2
id: npm-cache
with:
path: ${{ steps.npm-cache-dir.outputs.dir }}
key: ${{ matrix.os }}-${{ matrix.node-version }}-node
restore-keys: |
${{ matrix.os }}-${{ matrix.node-version }}-node
- name: Install dependencies and build
run: |
npm install
npm run build
- name: Publish
uses: JS-DevTools/npm-publish@v1
with:
token: ${{ secrets.NPM_AUTH_TOKEN }}
registry: ${{ env.REGISTRY }}
30 changes: 0 additions & 30 deletions .travis.yml

This file was deleted.

5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ This project adheres to [Semantic Versioning](http://semver.org/).
## Development
- nothing yet

## [v3.1.1](https://github.com/regevbr/busywait.js/compare/v3.1.0...v3.1.1)
### Fixed
- Support for node 16


## [v3.1.0](https://github.com/regevbr/busywait.js/compare/v3.0.0...v3.1.0)
### Added
- Added total delay information to the checked function call
Expand Down
11 changes: 5 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
[![Npm Version](https://img.shields.io/npm/v/busywait.svg?style=popout)](https://www.npmjs.com/package/busywait)
[![Build Status](https://travis-ci.org/regevbr/busywait.js.svg?branch=master)](https://travis-ci.org/regevbr/busywait.js)
[![Coverage Status](https://coveralls.io/repos/github/regevbr/busywait.js/badge.svg?branch=master)](https://coveralls.io/github/regevbr/busywait.js?branch=master)
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/58abd1713b064f4c9af7dc88d7178ebe)](https://www.codacy.com/app/regevbr/busywait.js?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=regevbr/busywait.js&amp;utm_campaign=Badge_Grade)
[![Npm Version](https://img.shields.io/npm/v/busywait.js.svg?style=popout)](https://www.npmjs.com/package/busywait.js)
[![node](https://img.shields.io/node/v-lts/busywait.js)](https://www.npmjs.com/package/busywait.js)
[![Build status](https://github.com/regevbr/busywait.js/actions/workflows/ci.yml/badge.svg?branch=master)](https://www.npmjs.com/package/busywait.js)
[![Test Coverage](https://api.codeclimate.com/v1/badges/5cc9e9fe4871a315f2aa/test_coverage)](https://codeclimate.com/github/regevbr/busywait.js/test_coverage)
[![Maintainability](https://api.codeclimate.com/v1/badges/5cc9e9fe4871a315f2aa/maintainability)](https://codeclimate.com/github/regevbr/busywait.js/maintainability)
[![Known Vulnerabilities](https://snyk.io/test/github/regevbr/busywait.js/badge.svg?targetFile=package.json)](https://snyk.io/test/github/regevbr/busywait.js?targetFile=package.json)
[![dependencies Status](https://david-dm.org/regevbr/busywait.js/status.svg)](https://david-dm.org/regevbr/busywait.js)
[![devDependencies Status](https://david-dm.org/regevbr/busywait.js/dev-status.svg)](https://david-dm.org/regevbr/busywait.js?type=dev)

# busywait.js

Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "busywait",
"version": "3.1.0",
"version": "3.1.1",
"description": "Async busy wait",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down Expand Up @@ -38,7 +38,7 @@
"backoff-strategy"
],
"engines": {
"node": "^6 || ^8 || ^10 || ^12 || ^14"
"node": "^6 || ^8 || ^10 || ^12 || ^14 || ^16"
},
"files": [
"/dist/*.d.ts",
Expand Down

0 comments on commit 9941669

Please sign in to comment.