Move CI to GitHub Actions (#11)
This commit is contained in:
parent
bddf54e9fe
commit
fa5499b9fe
62
.github/workflows/ci.yml
vendored
Normal file
62
.github/workflows/ci.yml
vendored
Normal file
@ -0,0 +1,62 @@
|
|||||||
|
name: ci
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- '**'
|
||||||
|
tags-ignore:
|
||||||
|
- '*.*'
|
||||||
|
pull_request:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
test:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
node-version: [10.x, 12.x, 13.x, 14.x]
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- name: Setup Node.js ${{ matrix.node-version }}
|
||||||
|
uses: actions/setup-node@v1
|
||||||
|
with:
|
||||||
|
node-version: ${{ matrix.node-version }}
|
||||||
|
- name: Install dependencies
|
||||||
|
run: npm install
|
||||||
|
- name: Run tests
|
||||||
|
run: npm run test
|
||||||
|
- name: Coverage
|
||||||
|
run: |
|
||||||
|
npm install -g codecov
|
||||||
|
npm run report-coverage
|
||||||
|
gh-pages:
|
||||||
|
needs: ['test']
|
||||||
|
if: success() && github.event_name == 'push' && github.repository_owner == 'retailcrm' && github.ref == 'refs/heads/master'
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- name: Setup Node.js
|
||||||
|
uses: actions/setup-node@v1
|
||||||
|
with:
|
||||||
|
node-version: 10.x
|
||||||
|
- name: Generate doc
|
||||||
|
run: npm run doc
|
||||||
|
- name: Deploy doc
|
||||||
|
uses: peaceiris/actions-gh-pages@v3
|
||||||
|
with:
|
||||||
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
publish_dir: ./out
|
||||||
|
deploy:
|
||||||
|
needs: ['test']
|
||||||
|
if: success() && github.event_name == 'push' && github.repository_owner == 'retailcrm' && github.ref == 'refs/heads/master'
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v1
|
||||||
|
- uses: actions/setup-node@v1
|
||||||
|
with:
|
||||||
|
node-version: 10.x
|
||||||
|
- name: Build
|
||||||
|
run: npm run build
|
||||||
|
- name: Publish
|
||||||
|
uses: JS-DevTools/npm-publish@v1
|
||||||
|
with:
|
||||||
|
token: ${{ secrets.NPM_TOKEN }}
|
46
.travis.yml
46
.travis.yml
@ -1,46 +0,0 @@
|
|||||||
os: linux
|
|
||||||
language: node_js
|
|
||||||
|
|
||||||
if: tag IS blank
|
|
||||||
|
|
||||||
stages:
|
|
||||||
- test
|
|
||||||
- gh pages
|
|
||||||
- npm deploy
|
|
||||||
|
|
||||||
script: npm run test
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
include:
|
|
||||||
- node_js: 10
|
|
||||||
- node_js: 12
|
|
||||||
- node_js: 13
|
|
||||||
- node_js: 14
|
|
||||||
after_success:
|
|
||||||
- npm install -g codecov
|
|
||||||
- npm run report-coverage
|
|
||||||
- stage: gh pages
|
|
||||||
node_js: 10
|
|
||||||
script: skip
|
|
||||||
before_deploy: npm run doc
|
|
||||||
deploy:
|
|
||||||
provider: pages
|
|
||||||
skip-cleanup: true
|
|
||||||
github-token: $GITHUB_TOKEN
|
|
||||||
keep-history: true
|
|
||||||
local-dir: out
|
|
||||||
on:
|
|
||||||
branch: master
|
|
||||||
if: branch = master AND type = push AND fork = false
|
|
||||||
- stage: npm deploy
|
|
||||||
node_js: 10
|
|
||||||
script: skip
|
|
||||||
before_deploy: npm run build
|
|
||||||
deploy:
|
|
||||||
provider: npm
|
|
||||||
email: $NPM_EMAIL
|
|
||||||
api_key: $NPM_API_KEY
|
|
||||||
skip-cleanup: true
|
|
||||||
on:
|
|
||||||
branch: master
|
|
||||||
if: branch = master AND type = push AND fork = false
|
|
@ -1,7 +1,8 @@
|
|||||||
[![Build Status](https://img.shields.io/travis/retailcrm/mg-bot-api-client-js/master.svg?logo=travis&style=flat-square)](https://travis-ci.org/retailcrm/mg-bot-api-client-js)
|
[![Build Status](https://github.com/retailcrm/mg-bot-api-client-js/workflows/ci/badge.svg)](https://github.com/retailcrm/mg-bot-api-client-js/actions)
|
||||||
[![GitHub release](https://img.shields.io/github/release/retailcrm/mg-bot-api-client-js.svg?style=flat-square)](https://github.com/retailcrm/mg-bot-api-client-js/releases)
|
[![Coverage](https://img.shields.io/codecov/c/gh/retailcrm/mg-bot-api-client-js/master.svg?logo=codecov)](https://codecov.io/gh/retailcrm/mg-bot-api-client-js)
|
||||||
[![Node version](https://img.shields.io/node/v/mg-api-client.svg?style=flat-square)](https://www.npmjs.com/package/mg-api-client)
|
[![Latest stable](https://img.shields.io/npm/v/mg-api-client.svg)](https://npmjs.com/package/mg-api-client)
|
||||||
|
[![Node version](https://img.shields.io/node/v/mg-api-client.svg)](https://www.npmjs.com/package/mg-api-client)
|
||||||
|
[![JS Doc](https://img.shields.io/badge/doc-github_pages-green)](https://retailcrm.github.io/mg-bot-api-client-js/)
|
||||||
|
|
||||||
# Message Gateway Bot API JS client
|
# Message Gateway Bot API JS client
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user