diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 000000000..b6a0a51e7 --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,63 @@ +jobs: + javascript-tests: + executor: + name: node/default + # The Node version here must be kept in sync with that in `package.json`. + tag: '12.14.1' + steps: + - checkout + - node/install-packages: + # `yarn install --frozen-lockfile` is run and cache is enabled by default for this orb configuration + pkg-manager: yarn + - run: + command: yarn lint + name: Run linting + - run: + command: yarn markdownlint + name: Check markdown linting + - run: + command: yarn codecov + name: Check code coverage changes + - run: + command: yarn test:coverage + name: Run Jest tests + + builds: + environment: + NODE_ENV: production + YARN_PRODUCTION: true + docker: + - image: 'circleci/python:3.7-node' + steps: + - checkout + - restore_cache: + name: Restore Yarn Package Cache + keys: + - node-deps-v1-{{ .Branch }} + - run: pip install tox + - run: + command: tox -e heroku + name: Run heroku builds and release checks + - run: + command: tox -e docs + name: Build docs + + python-tests: + machine: true + steps: + - checkout + - docker/install-docker + - docker/install-docker-compose + - run: docker-compose build + - run: docker-compose run backend bash -c "flake8 --show-source && black --check treeherder/ && pytest --cov --cov-report=xml tests/ --runslow" + +orbs: + node: circleci/node@4.1.0 + docker: circleci/docker@1.5.0 +version: 2.1 +workflows: + run-tests: + jobs: + - javascript-tests + - builds + - python-tests diff --git a/.renovaterc b/.renovaterc index 62e8cfdb6..fa1244910 100644 --- a/.renovaterc +++ b/.renovaterc @@ -27,5 +27,4 @@ "lockFileMaintenance": { "automerge": true }, - "travis": { "enabled": true } } \ No newline at end of file diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index e2316b01f..000000000 --- a/.travis.yml +++ /dev/null @@ -1,78 +0,0 @@ -dist: bionic -# Use the latest Travis images since they are more up to date than the stable release. -group: edge -jobs: - include: - # Run JS tests - - language: node_js - # The Node version here must be kept in sync with that in `package.json`. - node_js: '12.14.1' - cache: yarn - before_install: - # Try to keep version in sync with `package.json` - - curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --version 1.22.4 - - export PATH="$HOME/.yarn/bin:$PATH" - install: - - yarn install --frozen-lockfile - script: - # `yarn build` is tested as part of the Heroku build job - - yarn lint - # `yarn lint` only checks the formatting of JS/JSX, this will also check CSS/HTML/JSON/Markdown/YAML. - - yarn format:check - - yarn markdownlint - - yarn test:coverage - - yarn codecov - - # Run Heroku build & release related code - - env: - - NODE_ENV=production YARN_PRODUCTION=true - language: python - python: '3.7' - cache: - directories: - - $HOME/.cache/yarn - - $HOME/.cache/pip - - node_modules - - .tox/py37 - install: - - pip install tox - script: - - tox -e heroku - - # Run Python tests & linters outside of the Docker containers - - language: python - services: - - docker - python: '3.7' - cache: - directories: - - $HOME/.cache/yarn - - $HOME/.cache/pip - - node_modules - - .tox/py37 - install: - - pip install tox - script: - - tox - - tox -e docs - - # Run Python tests inside of the Docker containers - - language: shell - services: - - docker - cache: - directories: - - $HOME/.cache/pip - - .tox/py37 - install: - - pip install tox - - pip install codecov - script: - - tox -e docker - # It will fail if there's no coverage data - - codecov --required -f coverage.xml - -notifications: - email: - on_success: never - on_failure: always diff --git a/CODEOWNERS b/CODEOWNERS index c191fc76f..2f73b5f9d 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -1,7 +1,7 @@ # Visit https://help.github.com/en/github/creating-cloning-and-archiving-repositories/about-code-owners#codeowners-syntax # for learning about the syntax -/.travis.yml @mozilla/treeherder-admins +/.config.yml @mozilla/treeherder-admins /app.json @mozilla/treeherder-admins /docker-compose.yml @mozilla/treeherder-admins ui/helpers/constants.js @mozilla/treeherder-admins diff --git a/README.md b/README.md index c168065d2..11a002c0d 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # Treeherder [![What's Deployed](https://img.shields.io/badge/whatsdeployed-prototype,stage,prod-green.svg)](https://whatsdeployed.io/s-dqv) -[![Build Status](https://travis-ci.org/mozilla/treeherder.png?branch=master)](https://travis-ci.org/mozilla/treeherder) +[![Build Status](https://travis-ci.org/mozilla/treeherder.png?branch=master)](https://app.circleci.com/pipelines/github/mozilla/treeherder) [![Node dependencies Status](https://david-dm.org/mozilla/treeherder/status.svg)](https://david-dm.org/mozilla/treeherder) [![Node devDependencies Status](https://david-dm.org/mozilla/treeherder/dev-status.svg)](https://david-dm.org/mozilla/treeherder?type=dev) [![Documentation Status](https://readthedocs.org/projects/treeherder/badge/?version=latest)](https://treeherder.readthedocs.io/?badge=latest) diff --git a/docs/infrastructure/administration.md b/docs/infrastructure/administration.md index e4e59d0fe..c7ef073ab 100644 --- a/docs/infrastructure/administration.md +++ b/docs/infrastructure/administration.md @@ -69,7 +69,7 @@ This is controlled via the "deploy" tab in the Heroku app dashboard: A comparison of the Git revisions deployed to each environment can be seen using [What's Deployed]. After a push is made to an auto-deployed branch, Heroku will wait for the successful completion of -the [Travis CI build] (taking approximately 8 minutes), before initiating the deployment process. +the [CircleCI build], before initiating the deployment process. The steps described in [deployment lifecycle] then occur, which take about 5 minutes. Once the deployment is complete, `heroku-bot` will comment in the `#treeherder` IRC channel, @@ -81,7 +81,7 @@ activity can also be seen on the "activity" tab in the Heroku dashboard for each [deploy-stage]: https://dashboard.heroku.com/apps/treeherder-stage/deploy/github [deploy-prod]: https://dashboard.heroku.com/apps/treeherder-prod/deploy/github [what's deployed]: https://whatsdeployed.io/s-dqv -[travis ci build]: https://travis-ci.org/mozilla/treeherder/builds +[circleci build]: https://app.circleci.com/pipelines/github/mozilla/treeherder [deployment lifecycle]: architecture.md#deployment-lifecycle [tools-treeherder]: https://lists.mozilla.org/listinfo/tools-treeherder diff --git a/package.json b/package.json index 4513d9e26..29c707ae5 100644 --- a/package.json +++ b/package.json @@ -104,7 +104,7 @@ "start": "node ./node_modules/webpack-dev-server/bin/webpack-dev-server.js --mode development", "start:stage": "node ./node_modules/webpack-dev-server/bin/webpack-dev-server.js --mode development --env.BACKEND=https://treeherder.allizom.org", "start:local": "node ./node_modules/webpack-dev-server/bin/webpack-dev-server.js --mode development --env.BACKEND=http://localhost:8000", - "test:coverage": "node ./node_modules/jest/bin/jest --silent --coverage", + "test:coverage": "node ./node_modules/jest/bin/jest -w 1 --silent --coverage", "test": "node ./node_modules/jest/bin/jest", "test:watch": "node ./node_modules/jest/bin/jest --watch" } diff --git a/treeherder/config/settings.py b/treeherder/config/settings.py index 032cd44fd..d5d829494 100644 --- a/treeherder/config/settings.py +++ b/treeherder/config/settings.py @@ -84,7 +84,7 @@ INSTALLED_APPS = [ 'treeherder.changelog', ] -# Docker/outside-of-Docker/Travis vs Heroku/Review-app +# Docker/outside-of-Docker/CircleCI vs Heroku/Review-app if DEBUG: NEW_RELIC_DEVELOPER_MODE = True # This controls whether the Django debug toolbar should be shown or not diff --git a/ui/contribute.json b/ui/contribute.json index 6e8a12f77..e37c43c61 100644 --- a/ui/contribute.json +++ b/ui/contribute.json @@ -4,7 +4,7 @@ "repository": { "url": "https://github.com/mozilla/treeherder", "license": "MPL2", - "tests": "https://travis-ci.org/mozilla/treeherder" + "tests": "https://app.circleci.com/pipelines/github/mozilla/treeherder" }, "participate": { "home": "https://wiki.mozilla.org/EngineeringProductivity/Projects/Treeherder",