From 3f589e35144eb809d93337384689c8fbda4b3045 Mon Sep 17 00:00:00 2001 From: pscanf Date: Sat, 2 Jun 2018 16:40:28 +0200 Subject: [PATCH] ci: switch from the unrelieable travis-ci to circleci --- .circleci/config.yml | 58 ++++++++++++++++++++++++++++++++++++++++++++ .travis.yml | 20 --------------- README.md | 4 +-- package.json | 2 +- 4 files changed, 61 insertions(+), 23 deletions(-) create mode 100644 .circleci/config.yml delete mode 100644 .travis.yml diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 0000000..690be5c --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,58 @@ +version: 2 +jobs: + qa: + docker: + - image: circleci/node:8 + steps: + - checkout + - run: + name: Install dependencies + command: yarn install --frozen-lockfile + - run: + name: Compile modules + command: yarn compile + - run: + name: Run linters + command: yarn lint + - run: + name: Run tests and calculate code coverage + command: yarn coverage + - run: + name: Publish code coverage report + command: yarn publish-coverage + npm-publish: + docker: + - image: circleci/node:8 + steps: + - checkout + - run: + name: Install dependencies + command: yarn install --frozen-lockfile + - run: + name: Login to npm + command: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > .npmrc + - run: + name: Compile modules + command: yarn compile + - run: + name: Publish npm modules + command: npm publish + +workflows: + version: 2 + qa-npm: + jobs: + - qa: + # Run for all branches and all tags + filters: + tags: + only: /.*/ + - npm-publish: + requires: + - qa + # Run only for tags starting with a v, don't run for branches + filters: + tags: + only: /^v.*/ + branches: + ignore: /.*/ diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index d577b89..0000000 --- a/.travis.yml +++ /dev/null @@ -1,20 +0,0 @@ -language: node_js - -node_js: - - 6 - -cache: yarn - -deploy: - provider: npm - email: npm-bot@mondora.com - api_key: $NPM_TOKEN - on: - tags: true - skip_cleanup: true - -script: - - yarn lint - - yarn coverage - - yarn coveralls - - yarn compile diff --git a/README.md b/README.md index 6a48333..4004a23 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ -[![npm](https://img.shields.io/npm/v/@mondora/env.svg)](https://www.npmjs.com/package/@mondora/env) -[![Build Status](https://travis-ci.org/mondora/env.svg?branch=master)](https://travis-ci.org/mondora/env) +[![Package Version](https://img.shields.io/npm/v/@mondora/env.svg)](https://www.npmjs.com/package/@mondora/env) +[![Build Status](https://img.shields.io/circleci/project/github/mondora/env.svg)](https://circleci.com/gh/mondora/env) [![Coverage Status](https://img.shields.io/coveralls/mondora/env.svg)](https://coveralls.io/r/mondora/env?branch=master) [![Dependencies Status](https://david-dm.org/mondora/env.svg)](https://david-dm.org/mondora/env) [![Dev Dependencies Status](https://david-dm.org/mondora/env/dev-status.svg)](https://david-dm.org/mondora/env#info=devDependencies) diff --git a/package.json b/package.json index 3f61c6c..a63bc70 100644 --- a/package.json +++ b/package.json @@ -28,7 +28,7 @@ "lint": "yarn lint:prettier && yarn lint:tslint", "test": "NODE_ENV=test mocha --exit -r ts-node/register --watch-extensions ts 'test/**/*.ts'", "coverage": "nyc --all yarn test", - "coveralls": "cat ./coverage/lcov.info | coveralls" + "publish-coverage": "cat ./coverage/lcov.info | coveralls" }, "dependencies": {}, "devDependencies": {