Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restore Danger on Circle CI 2.0 #16324

Closed
wants to merge 3 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 34 additions & 12 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,16 +95,6 @@ jobs:
npm test -- --maxWorkers=2
npm run lint
npm run flow -- check
# eslint - doesn't run on non-PR builds
- run:
name: Analyze Code
command: |
if [ -n "$CIRCLE_PR_NUMBER" ]; then
npm install github@0.2.4
cat <(echo eslint; npm run lint --silent -- --format=json; echo flow; npm run flow --silent -- check --json) | GITHUB_TOKEN="af6ef0d15709bc91d""06a6217a5a826a226fb57b7" CI_USER=$CIRCLE_PROJECT_USERNAME CI_REPO=$CIRCLE_PROJECT_REPONAME PULL_REQUEST_NUMBER=$CIRCLE_PR_NUMBER node bots/code-analysis-bot.js
else
echo "Skipping code analysis."
fi

test-node-6:
<<: *defaults
Expand All @@ -129,7 +119,7 @@ jobs:
npm test -- --maxWorkers=2
npm run lint
npm run flow -- check

test-website:
<<: *defaults
docker:
Expand Down Expand Up @@ -168,7 +158,6 @@ jobs:
git config --global user.email "reactjs-bot@users.noreply.github.com"
git config --global user.name "Website Deployment Script"
echo "machine github.com login reactjs-bot password $GITHUB_TOKEN" > ~/.netrc

echo "Deploying website..."
cd website && GIT_USER=reactjs-bot npm run gh-pages
else
Expand Down Expand Up @@ -346,6 +335,31 @@ jobs:
- store_artifacts:
path: ~/junit

# Only runs on pull request builds.
analyze-pull-request:
<<: *defaults
docker:
- image: circleci/node:8
steps:
- checkout
- run: npm install --no-package-lock
# Run eslint against this pull request.
- run: npm install github@0.2.4
- run:
name: Analyze Code
command: |
cat <(echo eslint; npm run lint --silent -- --format=json; echo flow; npm run flow --silent -- check --json) | GITHUB_TOKEN="af6ef0d15709bc91d""06a6217a5a826a226fb57b7" CI_USER=$CIRCLE_PROJECT_USERNAME CI_REPO=$CIRCLE_PROJECT_REPONAME PULL_REQUEST_NUMBER=$CIRCLE_PR_NUMBER node bots/code-analysis-bot.js
# Run Danger against this pull request.
- restore-cache: *restore-cache-danger
- run: cd danger && npm install --no-package-lock
- save-cache: *save-cache-danger
- run:
name: Analyze Pull Request
command: |
cd danger
DANGER_GITHUB_API_TOKEN="e622517d9f1136ea8900""07c6373666312cdfaa69" npm run danger
# The GitHub token used above grants public_repo access scope. The associated account has no privileged access to the React Native repo. The token must be split in this manner to avoid automatic revocation by GitHub when checked in.

# Workflows enables us to run multiple jobs in parallel
workflows:
version: 2
Expand All @@ -366,6 +380,14 @@ workflows:
only:
- /.*-stable/
- master
analyze:
jobs:
- analyze-pull-request
branches:
ignore:
- master
- gh-pages
- /.*-stable/
test_android:
jobs:
- build-js-bundle:
Expand Down