From 9b40631c9a3cee3a71dff5a5b8f250822af0091b Mon Sep 17 00:00:00 2001 From: Burak Tasci Date: Mon, 4 Sep 2017 23:59:59 +0300 Subject: [PATCH] ci(circle): migrate to `circle-ci` (#4) * ci(bithound): remove config * ci(travis): remove config * ci(appveyor): remove config * ci(codedov): remove config * ci(circle): add config * build(npm): update scripts, deps * refactor: update .gitignore * docs: update README --- .bithoundrc | 8 -------- .circleci/config.yml | 40 ++++++++++++++++++++++++++++++++++++++++ .gitignore | 3 ++- .travis.yml | 38 -------------------------------------- README.md | 3 +-- appveyor.yml | 31 ------------------------------- codecov.yml | 6 ------ package.json | 5 ++++- 8 files changed, 47 insertions(+), 87 deletions(-) delete mode 100644 .bithoundrc create mode 100644 .circleci/config.yml delete mode 100644 .travis.yml delete mode 100644 appveyor.yml delete mode 100644 codecov.yml diff --git a/.bithoundrc b/.bithoundrc deleted file mode 100644 index 99bb1b5..0000000 --- a/.bithoundrc +++ /dev/null @@ -1,8 +0,0 @@ -{ - "critics": { - "lint": { "engine": "tslint" }, - "wc": { - "limit": 15000 - } - } -} diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 0000000..ca3ed1e --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,40 @@ +version: 2 +jobs: + build: + docker: + - image: circleci/node:7 + branches: + only: master + steps: + - checkout + - run: + name: Update yarn + command: 'sudo npm install -g yarn@latest' + - restore_cache: + keys: + - deps-{{ .Branch }}-{{ checksum "yarn.lock" }} + - deps- + - run: + name: Install dependencies + command: yarn + - save_cache: + key: deps-{{ .Branch }}-{{ checksum "yarn.lock" }} + paths: 'node_modules' + - run: + name: Rollup build + command: yarn build + - run: + name: Test & coverage + command: yarn test.ci + - store_artifacts: + path: test-report.xml + prefix: tests + - store_artifacts: + path: coverage + prefix: coverage + - store_artifacts: + path: dist + prefix: dist + - store_test_results: + path: test-report.xml + - run: bash <(curl -s https://codecov.io/bash) diff --git a/.gitignore b/.gitignore index 5761cb2..898b0ac 100644 --- a/.gitignore +++ b/.gitignore @@ -6,13 +6,14 @@ dist/ # dependencies node_modules/ -yarn.* # IDEs and editors .idea/ # build tools coverage/ +test-report.xml # misc npm-debug.log +yarn-error.log diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index c392a56..0000000 --- a/.travis.yml +++ /dev/null @@ -1,38 +0,0 @@ -sudo: required -dist: trusty -addons: - apt: - sources: - - google-chrome - packages: - - google-chrome-stable - -language: node_js -node_js: - - "6" - - "7" - - "8" -cache: - directories: node_modules -branches: - only: master - -before_script: - - export DISPLAY=:99.0 - - sh -e /etc/init.d/xvfb start - - yarn - - cd packages/@ngx-auth/core - - yarn - - cd ../../.. - - sleep 3 -after_failure: - - cat /home/travis/build/fulls1z3/ngx-auth/npm-debug.log -after_success: - - bash <(curl -s https://codecov.io/bash) - -notifications: - email: true - webhooks: - on_success: change # options: [always|never|change] default: always - on_failure: always # options: [always|never|change] default: always - on_start: never # options: [always|never|change] default: always diff --git a/README.md b/README.md index 81f2446..c195d3a 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,7 @@ # ngx-auth JWT authentication utility for **Angular** -[![Linux build](https://travis-ci.org/fulls1z3/ngx-auth.svg?branch=master)](https://travis-ci.org/fulls1z3/ngx-auth) -[![Windows build](https://ci.appveyor.com/api/projects/status/github/fulls1z3/ngx-auth?branch=master&svg=true)](https://ci.appveyor.com/project/fulls1z3/ngx-auth) +[![CircleCI](https://circleci.com/gh/fulls1z3/ngx-auth.svg?style=shield)](https://circleci.com/gh/fulls1z3/ngx-auth) [![coverage](https://codecov.io/github/fulls1z3/ngx-auth/coverage.svg?branch=master)](https://codecov.io/gh/fulls1z3/ngx-auth) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://github.com/facebook/jest) [![Angular Style Guide](https://mgechev.github.io/angular2-style-guide/images/badge.svg)](https://angular.io/styleguide) diff --git a/appveyor.yml b/appveyor.yml deleted file mode 100644 index 57eafb0..0000000 --- a/appveyor.yml +++ /dev/null @@ -1,31 +0,0 @@ -# Test against this version of Node.js -environment: - matrix: - - nodejs_version: "6" - - nodejs_version: "7" - - nodejs_version: "8" -cache: - # local npm modules - - node_modules -> package.json - # Don't actually build. -build: off - -# Fix line endings on Windows -init: - - git config --global core.autocrlf true -# Install scripts. (runs after repo cloning) -install: - # Get the latest stable version of Node.js - - ps: Install-Product node $env:nodejs_version - - npm install -g npm - # install modules - - npm install - - cd packages/@ngx-auth/core - - npm install - - cd ../../.. -# Post-install test scripts -test_script: - # Output useful info for debugging. - - node --version && npm --version - # run tests - - cmd: npm test diff --git a/codecov.yml b/codecov.yml deleted file mode 100644 index d14f9a6..0000000 --- a/codecov.yml +++ /dev/null @@ -1,6 +0,0 @@ -coverage: - status: - project: - ngx-auth/core: - target: 80% - paths: packages/@ngx-auth/core diff --git a/package.json b/package.json index a720a7f..1f21103 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,8 @@ "build": "ts-node ./tools/build/rollup.ts && rimraf .temp", "lint": "tslint -p ./tslint.json --force", "rebuild": "npm run clean && npm run build", - "test": "jest --runInBand --colors" + "test": "jest --runInBand --colors", + "test.ci": "jest --ci --updateSnapshot" }, "devDependencies": { "@angular/common": "~2.4.0", @@ -48,6 +49,7 @@ "rollup-plugin-uglify": "^2.0.1", "jest": "^20.0.4", "jest-preset-angular": "^2.0.5", + "jest-junit-reporter": "^1.1.0", "codelyzer": "^3.1.2", "tslint": "~5.7.0", "angular-tslint-rules": "^1.0.4", @@ -56,6 +58,7 @@ "jest": { "preset": "jest-preset-angular", "setupTestFrameworkScriptFile": "./tools/test/jest.setup.ts", + "testResultsProcessor": "./node_modules/jest-junit-reporter", "globals": { "ts-jest": { "tsConfigFile": "./tsconfig.json"