Skip to content

CI: use circleci #7603

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

Merged
merged 2 commits into from
Oct 28, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
73 changes: 73 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
version: 2.1

default: &default
steps:
- checkout
- run: git submodule sync
- run: git submodule update --init
- run: pip install --user tox
- run: scripts/circle/install_node.sh
- run:
name: Add node to the path
command: |
echo 'export PATH=~/.nvm/versions/node/v${NODE_VERSION}/bin:$PATH' >> $BASH_ENV
source $BASH_ENV
- run: tox

jobs:
tests:
<<: *default
docker:
- image: 'cimg/python:3.6'
environment:
TOXENV: py36,codecov
TOX_POSARGS: ''
- image: 'docker.elastic.co/elasticsearch/elasticsearch:6.8.12'
name: search

lint:
<<: *default
docker:
- image: 'cimg/python:3.6'
environment:
TOXENV: lint

migrations:
<<: *default
docker:
- image: 'cimg/python:3.6'
environment:
TOXENV: migrations

docs:
<<: *default
docker:
- image: 'cimg/python:3.6'
environment:
TOXENV: docs

docs-lint:
<<: *default
docker:
- image: 'cimg/python:3.6'
environment:
TOXENV: docs-lint

eslint:
<<: *default
docker:
- image: 'cimg/python:3.6'
environment:
TOXENV: eslint
NODE_VERSION: 10.17.0
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like we can speed up things by running all these in one job, otherwise circle will create a new container per each job and we can only have 5 concurrent jobs

Copy link
Member

@ericholscher ericholscher Oct 27, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't fully follow. Meaning just have 1 job that calls tox and it runs all 5 steps? I think we do that on the ad server: https://github.com/rtfd/ethical-ad-server/blob/ede6a0a0d2f9609f9e6426f59b4666219038a882/.circleci/config.yml#L27

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, just call tox with all except for the py36 environment (since that requires ES running, but maybe isn't that bad having ES running during all tests?). Also, splitting will give us the linter failures more quickly :D

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think 1 job per tox step is easier to parse while reading the errors. Right now we have 6 check notifications in this PR (1 per job) and you know immediately what (docs, lint, etc) failed without going to CircleCI.

Also, if we have 1 job per tox step, don't they run in parallel?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, if we have 1 job per tox step, don't they run in parallel?

Yeah, but then circle will be creating one container per each task, and with our current plan we can only have 5 concurrent jobs. So other PRs will need to wait till there is space available.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can run tox -e <env> on separate steps so is more clear what failed


workflows:
version: 2
test:
jobs:
- lint
- migrations
- docs
- docs-lint
- eslint
- tests
52 changes: 0 additions & 52 deletions .travis.yml

This file was deleted.

File renamed without changes.
7 changes: 0 additions & 7 deletions scripts/travis/install_elasticsearch.sh

This file was deleted.

4 changes: 0 additions & 4 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@ minversion=2.9.0
envlist = py36,lint,docs
skipsdist = True

[travis]
python =
3.6: py36, codecov

[testenv]
description = run test suite for the application with {basepython}
setenv =
Expand Down