config.yml 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. version: 2
  2. jobs:
  3. backend:
  4. docker:
  5. - image: circleci/python:3.7.3
  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
  18. - run: pipenv run isort --check-only --diff .
  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: pipenv run doc8 docs
  26. - run: DATABASE_NAME=wagtail.db pipenv run python -u runtests.py
  27. frontend:
  28. docker:
  29. - image: circleci/node:10
  30. steps:
  31. - checkout
  32. - restore_cache:
  33. keys:
  34. - node-v1-{{ .Branch }}-{{ checksum "package-lock.json" }}
  35. - node-v1-{{ .Branch }}-
  36. - node-v1-
  37. - run: npm install --no-save
  38. - save_cache:
  39. paths:
  40. - ~/project/node_modules/
  41. key: node-v1-{{ .Branch }}-{{ checksum "package-lock.json" }}
  42. - run: npm run build
  43. - run: npm run lint:js
  44. - run: npm run lint:css
  45. - run: npm run test:unit:coverage -- --runInBand
  46. - run: npm run dist
  47. - run: bash <(curl -s https://codecov.io/bash) -F frontend
  48. nightly-build:
  49. docker:
  50. - image: circleci/python:3.7.3
  51. steps:
  52. - checkout
  53. - run: cd ~ && wget https://nodejs.org/dist/v10.23.1/node-v10.23.1-linux-x64.tar.gz
  54. - run: cd /usr/local/ && sudo tar --strip-components 1 -xzf ~/node-v10.23.1-linux-x64.tar.gz
  55. - run: pip install --user wheel boto3
  56. - run: npm install
  57. - run: npm run dist
  58. - run: PYTHONPATH=. python scripts/nightly/get_version.py > __init__.py
  59. - run: mv __init__.py wagtail/__init__.py
  60. - run: python setup.py bdist_wheel
  61. - run: python scripts/nightly/upload.py
  62. workflows:
  63. version: 2
  64. test:
  65. jobs:
  66. - backend
  67. - frontend
  68. nightly:
  69. jobs:
  70. - nightly-build
  71. triggers:
  72. - schedule:
  73. cron: "0 0 * * *"
  74. filters:
  75. branches:
  76. only:
  77. - main