-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
44 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,80 +1,77 @@ | ||
no-backports: &no-backports | ||
name: Skip any branches called backport* | ||
command: | | ||
if [[ "${CIRCLE_BRANCH}" = *"backport"* ]]; then | ||
circleci step halt | ||
fi | ||
skip-check: &skip-check | ||
name: Check for [ci skip] | ||
command: bash .circleci/early_exit.sh | ||
|
||
merge-check: &merge-check | ||
name: Check if we need to merge upstream master | ||
command: | | ||
if [[ -n "${CIRCLE_PR_NUMBER}" ]]; then | ||
git fetch origin --tags | ||
git fetch origin +refs/pull/$CIRCLE_PR_NUMBER/merge:pr/$CIRCLE_PR_NUMBER/merge | ||
git checkout -qf pr/$CIRCLE_PR_NUMBER/merge | ||
fi | ||
apt-run: &apt-install | ||
name: Install apt packages | ||
command: | | ||
apt update | ||
apt install -y graphviz build-essential | ||
sudo apt update | ||
sudo apt install -y graphviz build-essential | ||
tox-install: &tox-install | ||
name: Install Tox | ||
command: | | ||
sudo pip install tox codecov | ||
version: 2 | ||
jobs: | ||
twine-check: | ||
egg-info-37: | ||
docker: | ||
- image: continuumio/miniconda3 | ||
- image: circleci/python:3.7 | ||
steps: | ||
- checkout | ||
- run: python setup.py egg_info | ||
|
||
pycodestyle: | ||
docker: | ||
- image: circleci/python:3.7 | ||
steps: | ||
- checkout | ||
- run: sudo pip install pycodestyle | ||
- run: pycodestyle --count | ||
|
||
tests: | ||
docker: | ||
- image: circleci/python:3.7 | ||
steps: | ||
- checkout | ||
- run: *no-backports | ||
- run: *skip-check | ||
- run: *merge-check | ||
- run: pip install -U pep517 | ||
- run: python -m pep517.build --source . | ||
- run: python -m pip install -U --user --force-reinstall twine | ||
- run: python -m twine check dist/* | ||
- run: *apt-install | ||
- run: *tox-install | ||
- run: tox -e py37 | ||
- run: codecov | ||
|
||
html-docs: | ||
docker: | ||
- image: continuumio/miniconda3 | ||
- image: circleci/python:3.7 | ||
steps: | ||
- checkout | ||
- run: *no-backports | ||
- run: *skip-check | ||
- run: *merge-check | ||
- run: *apt-install | ||
- run: pip install -U tox | ||
- run: tox -e build_docs | ||
- run: | ||
name: Prepare for upload | ||
command: | | ||
# If it's not a PR, don't upload | ||
if [ -z "${CIRCLE_PULL_REQUEST}" ]; then | ||
rm -r docs/_build/html/* | ||
else | ||
# If it is a PR, delete sources, because it's a lot of files | ||
# which we don't really need to upload | ||
rm -r docs/_build/html/_sources | ||
fi | ||
- run: *tox-install | ||
- run: tox -e py37-build_docs | ||
- store_artifacts: | ||
path: docs/_build/html | ||
|
||
- run: | ||
name: "Built documentation is available at:" | ||
command: DOCS_URL="${CIRCLE_BUILD_URL}/artifacts/${CIRCLE_NODE_INDEX}/${CIRCLE_WORKING_DIRECTORY/#\~/$HOME}/docs/_build/html/index.html"; echo $DOCS_URL | ||
|
||
workflows: | ||
version: 2 | ||
|
||
twine-check: | ||
egg-info: | ||
jobs: | ||
- twine-check | ||
- egg-info-37 | ||
|
||
pycodestyle: | ||
jobs: | ||
- pycodestyle | ||
|
||
test-documentation: | ||
jobs: | ||
- html-docs | ||
|
||
notify: | ||
webhooks: | ||
- url: https://giles.cadair.dev/circleci | ||
tests: | ||
jobs: | ||
- tests |