Skip to content

Commit

Permalink
[MobX4] Use circleci instead of travis for ci (#1996) (#1999)
Browse files Browse the repository at this point in the history
* Use circleci instead of travis for ci (#1996)

* Update README.md

Co-Authored-By: Pavel Pustovalov <pustovalov.pavel@gmail.com>

* Polish circle config for mobx4 (#2000)
  • Loading branch information
FredyC committed Jun 18, 2019
1 parent a9061f4 commit 42b32af
Show file tree
Hide file tree
Showing 5 changed files with 157 additions and 20 deletions.
149 changes: 149 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,149 @@
version: 2.1

executors:
my-executor:
docker:
- image: circleci/node:11
environment:
CI: true
working_directory: ~/mobx

jobs:
build:
executor: my-executor
steps:
- checkout

- restore_cache:
name: restore .cache/yarn
keys:
- yarn-cache-{{ arch }}
- restore_cache:
name: restore node_modules
keys:
- node-modules-{{ arch }}-{{ .Branch }}-{{ checksum "yarn.lock" }}
- node-modules-{{ arch }}-{{ .Branch }}
- node-modules-{{ arch }}

- run: yarn install --frozen-lockfile --cache-folder ~/.cache/yarn

- save_cache:
name: cache .cache/yarn
key: yarn-cache-{{ arch }}
paths:
- ~/.cache/yarn
- save_cache:
name: cache node_modules
key: node-modules-{{ arch }}-{{ .Branch }}-{{ checksum "yarn.lock" }}
paths:
- node_modules

- run: yarn small-build

- persist_to_workspace:
root: .
paths:
- ./*

test-all:
executor: my-executor
steps:
- attach_workspace:
at: .

- run: yarn test:all

test-performance:
executor: my-executor
steps:
- attach_workspace:
at: .

- run:
command: time node --expose-gc test/perf/index.js
environment:
PERSIST: true

test-coverage:
executor: my-executor
steps:
- attach_workspace:
at: .

- run: yarn test -i --coverage
- persist_to_workspace:
root: .
paths:
- ./coverage

test-webpack:
executor: my-executor
steps:
- attach_workspace:
at: .

- run: yarn test:webpack

test-es5:
executor: my-executor
steps:
- attach_workspace:
at: .

- run: yarn test:es5

test-size:
executor: my-executor
steps:
- attach_workspace:
at: .

- run: yarn size

# upload coverage
upload-coveralls:
executor: my-executor
steps:
- attach_workspace:
at: .

# only run coveralls if the token is present (it is not present for fork PRs for security reasons)
- run:
name: upload coveralls
command: |
if [[ -v COVERALLS_REPO_TOKEN ]]
then
cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js
echo "Coveralls info uploaded"
else
echo "Warning - Coveralls info could NOT be uploaded since the COVERALLS_REPO_TOKEN was not available"
fi
workflows:
version: 2
build-and-test:
jobs:
- build

- test-all:
requires:
- build
- test-performance:
requires:
- build
- test-coverage:
requires:
- build
- test-webpack:
requires:
- build
- test-es5:
requires:
- build
- test-size:
requires:
- build

- upload-coveralls:
requires:
- test-coverage
4 changes: 2 additions & 2 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ charset = utf-8
indent_style = space
tab_width = 4

[{package.json,.travis.yml}]
[{package.json}]
indent_style = space
indent_size = 2
indent_size = 2
12 changes: 0 additions & 12 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

_Simple, scalable state management_

[![Build Status](https://travis-ci.org/mobxjs/mobx.svg?branch=master)](https://travis-ci.org/mobxjs/mobx)
[![CircleCI](https://circleci.com/gh/mobxjs/mobx/tree/mobx4-master.svg?style=svg)](https://circleci.com/gh/mobxjs/mobx/tree/mobx4-master)
[![Coverage Status](https://coveralls.io/repos/mobxjs/mobx/badge.svg?branch=master&service=github)](https://coveralls.io/github/mobxjs/mobx?branch=master)
[![Join the chat at https://gitter.im/mobxjs/mobx](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/mobxjs/mobx?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[![Discuss MobX on Hashnode](https://hashnode.github.io/badges/mobx.svg)](https://hashnode.com/n/mobx)
Expand Down
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@
"test": "jest",
"watch": "jest --watch",
"test:mixed-versions": "jest --testRegex mixed-versions",
"test:all": "yarn lint && yarn small-build && yarn jest -i && yarn test:flow && yarn test:mixed-versions",
"test:all": "yarn lint && yarn jest -i && yarn test:flow && yarn test:mixed-versions",
"test:webpack": "node scripts/webpack-regression-tests.js",
"test:flow": "node_modules/.bin/flow check",
"test:performance": "npm run small-build && PERSIST=true time node --expose-gc test/perf/index.js",
"test:travis": "yarn test:all && yarn test:performance && yarn test -i --coverage && yarn test:es5 && yarn test:webpack && yarn size",
"test:es5": "yarn small-build && es-check es5 lib/mobx.js",
"test:ci": "yarn test:all && yarn test:performance && yarn test -i --coverage && test:es5 && yarn test:webpack && yarn size",
"test:es5": "yarn es-check es5 lib/mobx.js",
"prettier": "prettier \"**/*.js\" \"**/*.jsx\" \"**/*.tsx\" \"**/*.ts\"",
"_prepublish": "npm run small-build",
"_prepublish": "yarn small-build",
"quick-build": "tsc --pretty",
"small-build": "node scripts/build.js",
"lint": "eslint src/**/*.ts",
Expand Down Expand Up @@ -132,4 +132,4 @@
"pre-commit": "lint-staged"
}
}
}
}

0 comments on commit 42b32af

Please sign in to comment.