Skip to content

Commit

Permalink
chore: Update dependencies
Browse files Browse the repository at this point in the history
Other changes:

* ci: Migrate to Github Actions
* refactor: Use import type, which introduced in TS3.8
* doc: Remove CircleCI badges
  • Loading branch information
motss committed Apr 1, 2020
1 parent 3a03bcf commit 05ab55a
Show file tree
Hide file tree
Showing 119 changed files with 1,222 additions and 802 deletions.
85 changes: 85 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
name: ci

on:
push:
branches:
- '*'
tags-ignore:
- '*'
pull_request:
branches:
- '*'
tags-ignore:
- '*'

env:
CI_SKIP: false

jobs:
test:
if: "!contains(github.event.head_commit.message, '[ci skip]') && !contains(github.event.head_commit.message, 'doc:')"
name: ${{ matrix.os }} ${{ matrix.target }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest, ubuntu-18.04, windows-2019]
target: [13.x]
timeout-minutes: 120

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Git log
shell: bash
run: |
if [ -n "$(git log --format=%B -n 1 | grep -iE '^[0-9]+[.]{1,}[0-9]+[.]{1,}[0-9]+')" ]; then
echo '::set-env name=CI_SKIP::true'
fi
- name: Setup node@${{ matrix.target }}
if: "env.CI_SKIP == 'false'"
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.target }}

- name: List versions
if: "env.CI_SKIP == 'false'"
continue-on-error: true
shell: bash
run: |
node -v && npm version && which npm && pwd && npx envinfo
- name: Install dependencies
if: "env.CI_SKIP == 'false'"
run: |
npm ci --quiet
- name: Lint
if: "env.CI_SKIP == 'false'"
run: |
npm run lint
- name: Build
if: "env.CI_SKIP == 'false'"
run: |
npm run build:test
- name: Check build
if: "env.CI_SKIP == 'false'"
shell: bash
run: |
pwd && ls -la
- name: Run Test
if: "env.CI_SKIP == 'false'"
run: |
npm run jest
- name: Upload coverage to codecov
uses: codecov/codecov-action@v1
if: success()
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage/lcov.info
flags: unit_tests
78 changes: 78 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
name: publish

on:
push:
branches-ignore:
- '*'
tags:
- '*'

jobs:
build:
name: ${{ matrix.os }} ${{ matrix.target }}
runs-on: ${{ matrix.os }}
timeout-minutes: 120
strategy:
matrix:
os: [ubuntu-18.04]
target: [13.x]

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Setup node@${{ matrix.target }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.target }}
registry-url: 'https://registry.npmjs.org'

- name: List versions
continue-on-error: true
shell: bash
run: |
node -v && npm version && which npm && pwd && npx envinfo
- name: Install dependencies
run: |
npm ci --quiet
- name: Publish to npm (RC)
if: contains(github.ref, '-rc') == true
run: |
npm config list
npm publish . --tag=next
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Publish to npm
if: contains(github.ref, '-rc') == false
run: |
npm config list
npm publish .
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

# See https://github.com/actions/setup-node/issues/73.
# - name: Setup node@${{ matrix.target }}
# uses: actions/setup-node@v1
# with:
# node-version: ${{ matrix.target }}
# registry-url: 'https://npm.pkg.github.com/'
# scope: '@motss'

# - name: Publish to GPR (RC)
# if: success() && contains(github.ref, '-rc') == true
# run: |
# npm config list
# npm publish . --tag=next
# env:
# NODE_AUTH_TOKEN: ${{github.token}}

# - name: Publish to GPR
# if: success() && contains(github.ref, '-rc') == false
# run: |
# npm config list
# npm publish .
# env:
# NODE_AUTH_TOKEN: ${{github.token}}
6 changes: 1 addition & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
[![Packagephobia][packagephobia-badge]][packagephobia-url]
[![Bundlephobia][bundlephobia-badge]][bundlephobia-url]

[![CircleCI][circleci-badge]][circleci-url]
[![Dependency Status][daviddm-badge]][daviddm-url]
[![codecov][codecov-badge]][codecov-url]
[![Coverage Status][coveralls-badge]][coveralls-url]
Expand All @@ -40,8 +39,7 @@

## Pre-requisites

- [Node.js][nodejs-url] >= 8.16.0
- [NPM][npm-url] >= 6.4.1 ([NPM][npm-url] comes with [Node.js][nodejs-url] so there is no need to install separately.)
* [OPTIONAL] TypeScript >= `3.8.3` _Minimum version for TypeScript users_

## Installation

Expand Down Expand Up @@ -123,7 +121,6 @@ console.log(total === 6); // true
[packagephobia-badge]: https://flat.badgen.net/packagephobia/install/jsmodern
[bundlephobia-badge]: https://flat.badgen.net/bundlephobia/minzip/jsmodern

[circleci-badge]: https://flat.badgen.net/circleci/github/motss/jsmodern?icon=circleci
[daviddm-badge]: https://flat.badgen.net/david/dep/motss/jsmodern
[codecov-badge]: https://flat.badgen.net/codecov/c/github/motss/jsmodern?label=codecov&icon=codecov
[coveralls-badge]: https://flat.badgen.net/coveralls/c/github/motss/jsmodern?label=coveralls
Expand All @@ -144,7 +141,6 @@ console.log(total === 6); // true
[packagephobia-url]: https://packagephobia.now.sh/result?p=jsmodern
[bundlephobia-url]: https://bundlephobia.com/result?p=jsmodern

[circleci-url]: https://circleci.com/gh/motss/jsmodern/tree/master
[daviddm-url]: https://david-dm.org/motss/jsmodern
[codecov-url]: https://codecov.io/gh/motss/jsmodern
[coveralls-url]: https://coveralls.io/github/motss/jsmodern?branch=master
Expand Down
Loading

0 comments on commit 05ab55a

Please sign in to comment.