Skip to content

Commit

Permalink
Migrate CI to github actions (#11)
Browse files Browse the repository at this point in the history
* Bumps dependencies

* Removes travis ci file

* Adds ga
  • Loading branch information
repraze authored Dec 30, 2020
1 parent 1614d79 commit dba8dec
Show file tree
Hide file tree
Showing 6 changed files with 844 additions and 1,124 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: CI

on:
push:
pull_request:
schedule:
- cron: "0 0 * * 0" # weekly

jobs:
build:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [10.x, 12.x, 14.x]

steps:
- name: Checkout
uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
- name: Install Dependencies
run: npm ci
- name: Build
run: npm run build --if-present
- name: Check Linting
run: npm run lint
- name: Run Test with Coverage
run: npm run coverage
- name: Upload Coverage
uses: codecov/codecov-action@v1
with:
fail_ci_if_error: true
28 changes: 26 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,14 @@
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov
Expand All @@ -20,18 +23,39 @@ coverage
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules
jspm_packages
node_modules/
jspm_packages/

# Typescript v1 declaration files
typings/

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env

# Editor
.vscode
8 changes: 0 additions & 8 deletions .travis.yml

This file was deleted.

52 changes: 28 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
# delta-time

[![npm](https://img.shields.io/npm/v/delta-time.svg?logo=npm&style=flat-square)](https://www.npmjs.com/package/delta-time) [![Travis (.org)](https://img.shields.io/travis/repraze-org/delta-time.svg?logo=travis&style=flat-square)](https://travis-ci.org/repraze-org/delta-time) [![Codecov](https://img.shields.io/codecov/c/github/repraze-org/delta-time.svg?logo=codecov&style=flat-square)](https://codecov.io/gh/repraze-org/delta-time) [![GitHub](https://img.shields.io/github/license/repraze-org/delta-time.svg?logo=github&style=flat-square)](https://github.com/repraze-org/delta-time) [![npm](https://img.shields.io/npm/dm/delta-time.svg?logo=npm&style=flat-square)](https://www.npmjs.com/package/delta-time)
[![npm](https://img.shields.io/npm/v/delta-time.svg?logo=npm&style=flat-square)](https://www.npmjs.com/package/delta-time)
[![GitHub Workflow CI Status](https://img.shields.io/github/workflow/status/repraze-org/delta-time/CI?logo=github&style=flat-square)](https://github.com/repraze-org/delta-time/actions?query=workflow%3ACI)
[![Codecov](https://img.shields.io/codecov/c/github/repraze-org/delta-time.svg?logo=codecov&style=flat-square)](https://codecov.io/gh/repraze-org/delta-time)
[![GitHub](https://img.shields.io/github/license/repraze-org/delta-time.svg?logo=github&style=flat-square)](https://github.com/repraze-org/delta-time)
[![npm](https://img.shields.io/npm/dm/delta-time.svg?logo=npm&style=flat-square)](https://www.npmjs.com/package/delta-time)

A simple module to compute intervals

- Simple function to parse user friendly intervals
- Clear-up your code from messy time computations
- Plug it into your utility to ease the interface
- Simple function to parse user friendly intervals
- Clear-up your code from messy time computations
- Plug it into your utility to ease the interface

## Installation

Expand All @@ -26,16 +30,16 @@ dt("1h1m1s"); // 3661000
### Perfect for timeouts

```javascript
setTimeout(function() {
console.log("foo");
setTimeout(function () {
console.log("foo");
}, dt("500ms"));

setTimeout(function() {
console.log("bar");
setTimeout(function () {
console.log("bar");
}, dt("5 secs"));

setTimeout(function() {
console.log("baz");
setTimeout(function () {
console.log("baz");
}, dt("1h30m5s"));
```

Expand All @@ -58,20 +62,20 @@ dt("300 Years, 5 Months and 2 Hours", "days"); // 109727.28333333334

### function(time, [unit])

- Takes a number or a string describing a time interval
- A combination of units can be given
- Returns the value of the interval in ms
- If a unit is provided, it will be used instead of ms
- Takes a number or a string describing a time interval
- A combination of units can be given
- Returns the value of the interval in ms
- If a unit is provided, it will be used instead of ms

## Language

- nanosecond : ns, nano(s), nanosecond(s)
- microsecond : μs, micro(s), microsecond(s)
- millisecond : ms, milli(s), millisecond(s)
- second : s, sec(s), second(s)
- minute : m, min(s), minute(s)
- hour : h, hr(s), hour(s)
- day : d, day(s)
- week : w, wk(s), week(s)
- month : mo(s), month(s)
- year : y, yr(s), year(s)
- nanosecond : ns, nano(s), nanosecond(s)
- microsecond : μs, micro(s), microsecond(s)
- millisecond : ms, milli(s), millisecond(s)
- second : s, sec(s), second(s)
- minute : m, min(s), minute(s)
- hour : h, hr(s), hour(s)
- day : d, day(s)
- week : w, wk(s), week(s)
- month : mo(s), month(s)
- year : y, yr(s), year(s)
Loading

0 comments on commit dba8dec

Please sign in to comment.