From fccfdf66f51c64783042b9ace4863e4818d0636c Mon Sep 17 00:00:00 2001 From: Hector Ramos Date: Wed, 11 Oct 2017 18:47:57 -0700 Subject: [PATCH 1/3] Restore Danger on Circle CI 2.0 --- .circleci/config.yml | 46 ++++++++++++++++++++++++++++++++------------ 1 file changed, 34 insertions(+), 12 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index cfc1eb70187d99..cdf26433b5c1fd 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -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 @@ -129,7 +119,7 @@ jobs: npm test -- --maxWorkers=2 npm run lint npm run flow -- check - + test-website: <<: *defaults docker: @@ -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 @@ -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: | + # This GitHub token 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. + cd danger + DANGER_GITHUB_API_TOKEN="e622517d9f1136ea8900""07c6373666312cdfaa69" npm run danger + # Workflows enables us to run multiple jobs in parallel workflows: version: 2 @@ -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: From 01b3db699e8764da2d7f29b419d195263be65879 Mon Sep 17 00:00:00 2001 From: Hector Ramos Date: Wed, 11 Oct 2017 18:50:58 -0700 Subject: [PATCH 2/3] Fix comment indent --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index cdf26433b5c1fd..190529930b3429 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -356,9 +356,9 @@ jobs: - run: name: Analyze Pull Request command: | - # This GitHub token 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. 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: From 2e2a36e16a88c179b7e994c2a74cdc060e6afcf8 Mon Sep 17 00:00:00 2001 From: Hector Ramos Date: Wed, 11 Oct 2017 18:58:57 -0700 Subject: [PATCH 3/3] Dummy commit to force Circle CI 2 to run --- .circleci/config.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 190529930b3429..6f85be5750a161 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -358,7 +358,6 @@ jobs: 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: