зеркало из https://github.com/mozilla/treeherder.git
Replace Travis with CircleCi (#6935)
* Add .circleci/config.yml * Initial set up with node and yarn config * set up heroku builds * add python test config * remove most travis references and travis.yml
This commit is contained in:
Родитель
e91dcaadce
Коммит
21d5561673
|
@ -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
|
|
@ -27,5 +27,4 @@
|
|||
"lockFileMaintenance": {
|
||||
"automerge": true
|
||||
},
|
||||
"travis": { "enabled": true }
|
||||
}
|
78
.travis.yml
78
.travis.yml
|
@ -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
|
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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"
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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",
|
||||
|
|
Загрузка…
Ссылка в новой задаче