Skip to content

Commit

Permalink
Use circleci instead of travis for ci (#1996)
Browse files Browse the repository at this point in the history
  • Loading branch information
pustovalov authored and FredyC committed Jun 12, 2019
1 parent 6491189 commit 56063d5
Show file tree
Hide file tree
Showing 5 changed files with 147 additions and 21 deletions.
138 changes: 138 additions & 0 deletions .circleci/config.yml
@@ -0,0 +1,138 @@
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-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-size:
requires:
- build

- upload-coveralls:
requires:
- test-coverage
4 changes: 2 additions & 2 deletions .editorconfig
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.

4 changes: 2 additions & 2 deletions README.md
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.svg?style=svg)](https://circleci.com/gh/mobxjs/mobx)
[![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 Expand Up @@ -321,7 +321,7 @@ And finally, kudos to all the people that believed in, tried, validated and even

* Feel free to send small pull requests. Please discuss new features or big changes in a GitHub issue first.
* Use `yarn test` to run the basic test suite.
* Use `yarn test:travis` for the test suite with coverage.
* Use `yarn test:ci` for the test suite with coverage.
* and `yarn test:performance` for the performance tests.
* Please note that if you want to backport a feature / fix to MobX 4 a second PR needs to be opened to the mobx4-master branch.

Expand Down
10 changes: 5 additions & 5 deletions package.json
Expand Up @@ -17,13 +17,13 @@
"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:webpack && yarn size",
"test:performance": "PERSIST=true time node --expose-gc test/perf/index.js",
"test:ci": "yarn test:all && yarn test:performance && yarn test -i --coverage && yarn test:webpack && yarn size",
"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 @@ -130,4 +130,4 @@
"pre-commit": "lint-staged"
}
}
}
}

0 comments on commit 56063d5

Please sign in to comment.