config.yml 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. version: 2
  2. jobs:
  3. backend:
  4. docker:
  5. - image: circleci/python:3.6.4
  6. steps:
  7. - checkout
  8. - restore_cache:
  9. keys:
  10. - pip-packages-v1-{{ .Branch }}
  11. - pip-packages-v1-
  12. - run: pipenv install -e .[testing]
  13. - save_cache:
  14. paths:
  15. - ~/.local/
  16. key: pip-package-v1-{{ .Branch }}
  17. - run: pipenv run flake8 wagtail
  18. - run: pipenv run isort --check-only --diff --recursive wagtail
  19. # Filter out known false positives, while preserving normal output and error codes.
  20. # See https://github.com/motet-a/jinjalint/issues/18.
  21. # And https://circleci.com/docs/2.0/configuration-reference/#default-shell-options.
  22. - run:
  23. shell: /bin/bash -e
  24. command: pipenv run jinjalint --parse-only wagtail | grep -v 'welcome_page.html:6:70' | tee /dev/tty | wc -l | grep -q '0'
  25. - run: DATABASE_NAME=wagtail.db pipenv run python -u runtests.py
  26. frontend:
  27. docker:
  28. - image: circleci/node:8.11.3
  29. steps:
  30. - checkout
  31. - restore_cache:
  32. keys:
  33. - node-v1-{{ .Branch }}-{{ checksum "package-lock.json" }}
  34. - node-v1-{{ .Branch }}-
  35. - node-v1-
  36. - run: npm install --no-save
  37. - save_cache:
  38. paths:
  39. - ~/project/node_modules/
  40. key: node-v1-{{ .Branch }}-{{ checksum "package-lock.json" }}
  41. - run: npm run lint:js
  42. - run: npm run lint:css
  43. - run: npm run test:unit:coverage -- --runInBand
  44. - run: npm rebuild node-sass
  45. - run: npm run dist
  46. - run: bash <(curl -s https://codecov.io/bash) -F frontend
  47. nightly-build:
  48. docker:
  49. - image: circleci/python:3.7.3
  50. steps:
  51. - checkout
  52. - run: cd ~ && wget https://nodejs.org/dist/v8.7.0/node-v8.7.0-linux-x64.tar.gz
  53. - run: cd /usr/local/ && sudo tar --strip-components 1 -xzf ~/node-v8.7.0-linux-x64.tar.gz
  54. - run: pip install --user wheel boto3
  55. - run: npm install
  56. - run: npm run dist
  57. - run: PYTHONPATH=. python scripts/nightly/get_version.py > __init__.py
  58. - run: mv __init__.py wagtail/__init__.py
  59. - run: python setup.py bdist_wheel
  60. - run: python scripts/nightly/upload.py
  61. workflows:
  62. version: 2
  63. test:
  64. jobs:
  65. - backend
  66. - frontend
  67. nightly:
  68. jobs:
  69. - nightly-build
  70. triggers:
  71. - schedule:
  72. cron: "0 0 * * *"
  73. filters:
  74. branches:
  75. only:
  76. - master