forked from facebook/react
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add circle.yml / CircleCI support (facebook#8486)
- Loading branch information
1 parent
c780dd3
commit 6c4dc7e
Showing
10 changed files
with
163 additions
and
5 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,54 @@ | ||
--- | ||
general: | ||
branches: | ||
ignore: | ||
- gh-pages | ||
|
||
machine: | ||
timezone: America/Los_Angeles | ||
node: | ||
version: 6 | ||
ruby: | ||
version: 2.2.3 | ||
environment: | ||
TRAVIS_REPO_SLUG: facebook/react | ||
|
||
dependencies: | ||
pre: | ||
# This is equivalent to $TRAVIS_COMMIT_RANGE | ||
# Need to figure out how to bail early if this is a "docs only" build | ||
- echo $CIRCLE_COMPARE_URL | cut -d/ -f7 | ||
# install yarn | ||
- sudo apt-key adv --fetch-keys http://dl.yarnpkg.com/debian/pubkey.gpg | ||
- echo "deb http://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list | ||
- sudo apt-get update -qq | ||
- sudo apt-get install -y -qq yarn | ||
override: | ||
- bundle install --gemfile=docs/Gemfile --deployment --path=vendor/bundle --jobs=3 --retry=3 | ||
- yarn install | ||
- scripts/circleci/set_up_github_keys.sh | ||
post: | ||
# - npm ls --depth=0 | ||
cache_directories: | ||
- docs/vendor/bundle | ||
- .grunt # Show size comparisons between builds | ||
- ~/react-gh-pages # docs checkout | ||
- ~/.yarn-cache | ||
|
||
test: | ||
override: | ||
- ./node_modules/.bin/gulp lint | ||
- ./node_modules/.bin/gulp flow | ||
- ./scripts/circleci/test_coverage.sh | ||
- ./scripts/circleci/test_fiber.sh | ||
- ./scripts/circleci/test_html_generation.sh | ||
- ./scripts/circleci/track_stats.sh | ||
- ./node_modules/.bin/grunt build | ||
- ./node_modules/.bin/gulp react:extract-errors | ||
|
||
deployment: | ||
staging: | ||
branch: /.*/ | ||
commands: | ||
- ./scripts/circleci/upload_build.sh | ||
- ./scripts/circleci/build_gh_pages.sh |
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
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,33 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
if [ -z $CI_PULL_REQUEST ] && [ "$CIRCLE_BRANCH" = "$REACT_WEBSITE_BRANCH" ]; then | ||
|
||
GH_PAGES_DIR=`pwd`/../react-gh-pages | ||
|
||
# check if directory exists (restored from cache) | ||
if [ -d $GH_PAGES_DIR ]; then | ||
pushd $GH_PAGES_DIR | ||
git pull origin gh-pages | ||
popd | ||
else | ||
git clone --branch gh-pages --depth=1 \ | ||
https://[email protected]/facebook/react.git \ | ||
$GH_PAGES_DIR | ||
fi | ||
|
||
pushd docs | ||
bundle exec rake release | ||
cd $GH_PAGES_DIR | ||
git status | ||
git --no-pager diff | ||
if ! git diff-index --quiet HEAD --; then | ||
git add -A . | ||
git commit -m "Rebuild website" | ||
git push origin gh-pages | ||
fi | ||
popd | ||
else | ||
echo "Not building website" | ||
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,12 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
if [ -n $GITHUB_TOKEN ]; then | ||
|
||
GH_PAGES_DIR=`pwd`/../react-gh-pages | ||
echo "machine github.com login reactjs-bot password $GITHUB_TOKEN" >~/.netrc | ||
git config --global user.name "Circle CI" | ||
git config --global user.email "[email protected]" | ||
|
||
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,6 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
./node_modules/.bin/grunt jest:coverage | ||
cat ./coverage/lcov.info | ./node_modules/.bin/coveralls |
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,9 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
echo 'Testing in fiber mode...' | ||
./scripts/fiber/record-tests --track-facts --max-workers 1 | ||
git --no-pager diff scripts/fiber | ||
FIBER_TESTS_STATUS=$(git status --porcelain scripts/fiber) | ||
test -z "$FIBER_TESTS_STATUS" |
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,9 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
echo 'Testing in server-render (HTML generation) mode...' | ||
printf '\nmodule.exports.useCreateElement = false;\n' \ | ||
>> src/renderers/dom/shared/ReactDOMFeatureFlags.js | ||
./node_modules/.bin/grunt jest:normal | ||
git checkout -- src/renderers/dom/shared/ReactDOMFeatureFlags.js |
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,8 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
ALL_FILES=`find src -name '*.js' | grep -v umd/ | grep -v __tests__ | grep -v __mocks__` | ||
COUNT_ALL_FILES=`echo "$ALL_FILES" | wc -l` | ||
COUNT_WITH_FLOW=`grep '@flow' $ALL_FILES | perl -pe 's/:.+//' | wc -l` | ||
node scripts/facts-tracker/index.js "flow-files" "$COUNT_WITH_FLOW/$COUNT_ALL_FILES" |
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,23 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
if [ -z $CI_PULL_REQUEST ]; then | ||
curl \ | ||
-F "react=@build/react.js" \ | ||
-F "react.min=@build/react.min.js" \ | ||
-F "react-with-addons=@build/react-with-addons.js" \ | ||
-F "react-with-addons.min=@build/react-with-addons.min.js" \ | ||
-F "react-dom=@build/react-dom.js" \ | ||
-F "react-dom.min=@build/react-dom.min.js" \ | ||
-F "react-dom-server=@build/react-dom-server.js" \ | ||
-F "react-dom-server.min=@build/react-dom-server.min.js" \ | ||
-F "npm-react=@build/packages/react.tgz" \ | ||
-F "npm-react-dom=@build/packages/react-dom.tgz" \ | ||
-F "commit=$CIRCLE_SHA1" \ | ||
-F "date=`git log --format='%ct' -1`" \ | ||
-F "pull_request=false" \ | ||
-F "token=$BUILD_SERVER_TOKEN" \ | ||
-F "branch=$CIRCLE_BRANCH" \ | ||
$BUILD_SERVER_ENDPOINT | ||
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