Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Automate deployment on master branch.
- Loading branch information
Showing
19 changed files
with
12,065 additions
and
934 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
# Javascript Node CircleCI 2.0 configuration file | ||
# | ||
# Check https://circleci.com/docs/2.0/language-javascript/ for more details | ||
# | ||
version: 2 | ||
jobs: | ||
build: | ||
environment: | ||
CC_TEST_REPORTER_ID: e124bacf0493b1f396545259279fd0a85656ad5441e862cd9630c4652a42af5b | ||
docker: | ||
- image: node:8.4 | ||
working_directory: ~/react-chunk | ||
steps: | ||
- checkout | ||
- run: | ||
name: "~/.npmrc" | ||
command: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc | ||
- run: | ||
name: "Checking Versions" | ||
command: | | ||
node --version | ||
npm --version | ||
- restore_cache: | ||
key: dependency-cache-{{ checksum "package.json" }} | ||
- run: | ||
name: "npm install" | ||
command: npm install | ||
- save_cache: | ||
key: dependency-cache-{{ checksum "package.json" }} | ||
paths: | ||
- ./node_modules | ||
- run: | ||
command: | | ||
mkdir -p ./.build | ||
mkdir -p ./.build/lint | ||
mkdir -p ./.build/coverage | ||
mkdir -p ./.build/test | ||
mkdir -p ./coverage | ||
when: always | ||
- run: | ||
name: lint | ||
command: npm run ci-lint | ||
- run: | ||
name: "install code climate" | ||
command: | | ||
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter | ||
chmod +x ./cc-test-reporter | ||
- run: | ||
name: test | ||
command: | | ||
# Prepare the test reporter | ||
./cc-test-reporter before-build | ||
# Run the tests | ||
npm run ci-jest | ||
COVERAGE_EXIT_CODE=$? | ||
# Copy the coverage file for reporting purposes | ||
cp ./.build/coverage/lcov.info ./coverage | ||
# Prevent errors when re-building on the CI server (reports previously uploaded) | ||
set +e | ||
./cc-test-reporter after-build -t lcov --exit-code $COVERAGE_EXIT_CODE | ||
REPORTER_EXIT_CODE=$? | ||
set -e | ||
if [ "$REPORTER_EXIT_CODE" != "0" ] && [ "$REPORTER_EXIT_CODE" != "255" ]; then | ||
exit $$REPORTER_EXIT_CODE | ||
fi | ||
- store_test_results: | ||
path: ./.build/test/test-report.xml | ||
- store_artifacts: | ||
path: ./.build/test | ||
prefix: "test" | ||
- store_artifacts: | ||
path: ./.build/lint | ||
prefix: "lint" | ||
- store_artifacts: | ||
path: ./.build/coverage | ||
prefix: "coverage" | ||
- deploy: | ||
name: Maybe Deploy | ||
command: | | ||
if [ "${CIRCLE_BRANCH}" == "master" ]; then | ||
git config -l | ||
git config user.email ci@circleci | ||
git config user.name CircleCI | ||
# Build for release | ||
npm run build | ||
# Tag the release, update package.json version and changelog, commit and push to github. | ||
./node_modules/.bin/standard-version --no-verify -m "chore(release): %s. [skip ci]" | ||
git push --follow-tags origin master | ||
npm publish | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
|
||
engines: | ||
|
||
fixme: | ||
enabled: true | ||
|
||
nodesecurity: | ||
enabled: true | ||
|
||
eslint: | ||
enabled: true | ||
channel: "eslint-3" | ||
|
||
duplication: | ||
enabled: true | ||
config: | ||
languages: | ||
- javascript: | ||
|
||
ratings: | ||
paths: | ||
- "src/*.js" | ||
|
||
exclude_paths: | ||
- "lib/**/*" | ||
- "__tests__/**/*" | ||
- "__fixtures__/**/*" | ||
- "src/__tests__/*" | ||
- "src/__tests__/**/*" | ||
- "examples/**/*" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# EditorConfig is awesome: http://EditorConfig.org | ||
|
||
# top-most EditorConfig file | ||
root = true | ||
|
||
# Unix-style newlines with a newline ending every file | ||
[*] | ||
end_of_line = lf | ||
insert_final_newline = true | ||
|
||
# Matches multiple files with brace expansion notation | ||
# Set default charset | ||
[*.js] | ||
charset = utf-8 | ||
|
||
# Indentation override for all JS under src directory | ||
[{src/**.js,example/*.js,example/components/*.js}] | ||
indent_style = space | ||
indent_size = 2 | ||
|
||
# Matches the exact files either package.json | ||
[package.json] | ||
indent_style = space | ||
indent_size = 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
{ | ||
"parser": "babel-eslint", | ||
"parserOptions": { | ||
"ecmaVersion": 6, | ||
"sourceType": "module", | ||
"ecmaFeatures": { | ||
"jsx": true, | ||
"experimentalObjectRestSpread": true | ||
} | ||
}, | ||
"rules": { | ||
"strict": 0, | ||
"indent": ["error", 2] | ||
}, | ||
"env": { | ||
"es6": true, | ||
"browser": true, | ||
"node": true, | ||
"jest": true | ||
}, | ||
"extends": [ | ||
"eslint:recommended", | ||
"plugin:react/recommended", | ||
"plugin:jest/recommended" | ||
], | ||
"plugins": ["jest"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
.idea | ||
.build | ||
node_modules | ||
*.log | ||
lib | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
node_modules/ | ||
.babelrc | ||
.eslintrc | ||
.eslintrc.json | ||
scripts | ||
.idea | ||
.circleci | ||
docs/ | ||
src/ | ||
.build/ | ||
coverage/ | ||
examples/ | ||
jest_*/ | ||
.codeclimate.yml | ||
npm-shrinkwrap.json | ||
yarn.lock | ||
cc-test-reporter | ||
__tests__ | ||
__fixtures__ |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.