2018-08-01 22:04:16 +02:00
|
|
|
|
version: 2
|
|
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
|
backend:
|
|
|
|
|
docker:
|
2021-09-18 18:11:43 +02:00
|
|
|
|
- image: cimg/python:3.8.11
|
2021-12-02 10:13:48 +01:00
|
|
|
|
environment:
|
|
|
|
|
PIPENV_VENV_IN_PROJECT: true
|
2018-08-01 22:04:16 +02:00
|
|
|
|
steps:
|
|
|
|
|
- checkout
|
|
|
|
|
- restore_cache:
|
2021-12-02 10:13:48 +01:00
|
|
|
|
key: pipenv-v1-{{ checksum "setup.py" }}
|
|
|
|
|
# Only install if .venv wasn’t cached.
|
|
|
|
|
- run: |
|
|
|
|
|
if [[ ! -e ".venv" ]]; then
|
2022-03-10 07:34:51 +01:00
|
|
|
|
pipenv install -e .[testing,docs]
|
2021-12-02 10:13:48 +01:00
|
|
|
|
fi
|
2018-08-01 22:04:16 +02:00
|
|
|
|
- save_cache:
|
2021-12-02 10:13:48 +01:00
|
|
|
|
key: pipenv-v1-{{ checksum "setup.py" }}
|
2018-08-01 22:04:16 +02:00
|
|
|
|
paths:
|
2021-12-02 10:13:48 +01:00
|
|
|
|
- .venv
|
2020-10-02 17:56:26 +02:00
|
|
|
|
- run: pipenv run flake8
|
2020-10-19 21:10:28 +02:00
|
|
|
|
- run: pipenv run isort --check-only --diff .
|
2022-02-11 16:16:57 +01:00
|
|
|
|
- run: pipenv run black --target-version py37 --check --diff .
|
2022-02-10 07:37:00 +01:00
|
|
|
|
- run: git ls-files '*.html' | xargs pipenv run djhtml --check
|
2022-05-20 18:16:51 +02:00
|
|
|
|
- run: pipenv run curlylint --parse-only wagtail
|
2020-10-21 13:38:52 +02:00
|
|
|
|
- run: pipenv run doc8 docs
|
2018-08-21 18:05:17 +02:00
|
|
|
|
- run: DATABASE_NAME=wagtail.db pipenv run python -u runtests.py
|
2018-08-01 22:04:16 +02:00
|
|
|
|
|
|
|
|
|
frontend:
|
|
|
|
|
docker:
|
2022-01-31 15:51:38 +01:00
|
|
|
|
- image: circleci/node:16
|
2018-08-01 22:04:16 +02:00
|
|
|
|
steps:
|
|
|
|
|
- checkout
|
|
|
|
|
- restore_cache:
|
2021-12-02 10:15:34 +01:00
|
|
|
|
key: frontend-v1-{{ checksum "package-lock.json" }}
|
|
|
|
|
# Only install if node_modules wasn’t cached.
|
|
|
|
|
- run: |
|
|
|
|
|
if [[ ! -e "node_modules" ]]; then
|
|
|
|
|
npm install --no-save --no-optional --no-audit --no-fund --progress=false
|
|
|
|
|
fi
|
2018-08-01 22:04:16 +02:00
|
|
|
|
- save_cache:
|
|
|
|
|
paths:
|
2021-12-02 10:15:34 +01:00
|
|
|
|
- node_modules
|
|
|
|
|
key: frontend-v1-{{ checksum "package-lock.json" }}
|
2021-12-23 05:21:23 +01:00
|
|
|
|
- run: npm run build
|
2021-11-12 17:27:10 +01:00
|
|
|
|
# Save static files for subsequent jobs.
|
|
|
|
|
- persist_to_workspace:
|
|
|
|
|
root: ~/project
|
|
|
|
|
paths:
|
|
|
|
|
- wagtail
|
2018-08-01 22:04:16 +02:00
|
|
|
|
- run: npm run lint:js
|
|
|
|
|
- run: npm run lint:css
|
2022-02-04 12:45:08 +01:00
|
|
|
|
- run: npm run lint:format
|
2018-08-01 22:04:16 +02:00
|
|
|
|
- run: npm run test:unit:coverage -- --runInBand
|
|
|
|
|
- run: bash <(curl -s https://codecov.io/bash) -F frontend
|
|
|
|
|
|
2021-11-12 17:27:10 +01:00
|
|
|
|
ui_tests:
|
|
|
|
|
docker:
|
|
|
|
|
- image: cimg/python:3.8.11-browsers
|
|
|
|
|
environment:
|
|
|
|
|
PIPENV_VENV_IN_PROJECT: true
|
2022-03-17 15:37:24 +01:00
|
|
|
|
DJANGO_SETTINGS_MODULE: wagtail.test.settings_ui
|
2021-11-12 17:27:10 +01:00
|
|
|
|
steps:
|
|
|
|
|
- checkout
|
|
|
|
|
- attach_workspace:
|
|
|
|
|
at: ~/project
|
|
|
|
|
- restore_cache:
|
|
|
|
|
key: pipenv-v1-{{ checksum "setup.py" }}
|
|
|
|
|
# Only install if .venv wasn’t cached.
|
|
|
|
|
- run: |
|
|
|
|
|
if [[ ! -e ".venv" ]]; then
|
|
|
|
|
pipenv install -e .[testing]
|
|
|
|
|
fi
|
|
|
|
|
- save_cache:
|
|
|
|
|
key: pipenv-v1-{{ checksum "setup.py" }}
|
|
|
|
|
paths:
|
|
|
|
|
- .venv
|
|
|
|
|
- restore_cache:
|
|
|
|
|
key: ui_tests-npm_integration-v1-{{ checksum "client/tests/integration/package-lock.json" }}
|
|
|
|
|
# Only install if node_modules wasn’t cached.
|
|
|
|
|
- run: |
|
|
|
|
|
if [[ ! -e "client/tests/integration/node_modules" ]]; then
|
2021-12-12 01:14:41 +01:00
|
|
|
|
npm --prefix ./client/tests/integration ci
|
2021-11-12 17:27:10 +01:00
|
|
|
|
fi
|
|
|
|
|
- save_cache:
|
|
|
|
|
key: ui_tests-npm_integration-v1-{{ checksum "client/tests/integration/package-lock.json" }}
|
|
|
|
|
paths:
|
|
|
|
|
- client/tests/integration/node_modules
|
2022-03-17 15:37:24 +01:00
|
|
|
|
- run: pipenv run ./wagtail/test/manage.py migrate
|
2021-11-12 17:27:10 +01:00
|
|
|
|
- run:
|
2022-03-17 15:37:24 +01:00
|
|
|
|
command: pipenv run ./wagtail/test/manage.py runserver 0:8000
|
2021-11-12 17:27:10 +01:00
|
|
|
|
background: true
|
2022-03-17 15:37:24 +01:00
|
|
|
|
- run: pipenv run ./wagtail/test/manage.py createcachetable
|
2021-11-12 17:27:10 +01:00
|
|
|
|
- run:
|
2022-03-17 15:37:24 +01:00
|
|
|
|
command: pipenv run ./wagtail/test/manage.py createsuperuser --noinput
|
2021-11-12 17:27:10 +01:00
|
|
|
|
environment:
|
|
|
|
|
DJANGO_SUPERUSER_EMAIL: admin@example.com
|
|
|
|
|
DJANGO_SUPERUSER_USERNAME: admin
|
|
|
|
|
DJANGO_SUPERUSER_PASSWORD: changeme
|
|
|
|
|
- run:
|
|
|
|
|
command: npm run test:integration -- --runInBand --reporters=default --reporters=jest-junit
|
|
|
|
|
environment:
|
|
|
|
|
JEST_JUNIT_OUTPUT_DIR: reports/jest
|
2022-08-24 15:42:22 +02:00
|
|
|
|
- run:
|
|
|
|
|
command: pipenv run ./wagtail/test/manage.py collectstatic --noinput
|
|
|
|
|
environment:
|
|
|
|
|
STATICFILES_STORAGE: manifest
|
2021-11-12 17:27:10 +01:00
|
|
|
|
- store_test_results:
|
|
|
|
|
path: ./reports/jest
|
|
|
|
|
|
2019-06-21 12:13:34 +02:00
|
|
|
|
nightly-build:
|
|
|
|
|
docker:
|
2022-01-31 15:51:38 +01:00
|
|
|
|
- image: cimg/python:3.8.11-node
|
2019-06-21 12:13:34 +02:00
|
|
|
|
steps:
|
|
|
|
|
- checkout
|
2019-06-21 12:31:04 +02:00
|
|
|
|
- run: pip install --user wheel boto3
|
2019-06-21 12:13:34 +02:00
|
|
|
|
- run: npm install
|
2021-12-23 05:21:23 +01:00
|
|
|
|
- run: npm run build
|
2019-06-21 12:13:34 +02:00
|
|
|
|
- run: PYTHONPATH=. python scripts/nightly/get_version.py > __init__.py
|
|
|
|
|
- run: mv __init__.py wagtail/__init__.py
|
|
|
|
|
- run: python setup.py bdist_wheel
|
|
|
|
|
- run: python scripts/nightly/upload.py
|
|
|
|
|
|
2018-08-01 22:04:16 +02:00
|
|
|
|
workflows:
|
|
|
|
|
version: 2
|
|
|
|
|
test:
|
2019-06-21 12:13:34 +02:00
|
|
|
|
jobs:
|
|
|
|
|
- backend
|
|
|
|
|
- frontend
|
2021-11-12 17:27:10 +01:00
|
|
|
|
- ui_tests:
|
|
|
|
|
requires:
|
|
|
|
|
- frontend
|
2019-06-21 12:13:34 +02:00
|
|
|
|
|
|
|
|
|
nightly:
|
|
|
|
|
jobs:
|
|
|
|
|
- nightly-build
|
|
|
|
|
triggers:
|
|
|
|
|
- schedule:
|
|
|
|
|
cron: '0 0 * * *'
|
|
|
|
|
filters:
|
|
|
|
|
branches:
|
|
|
|
|
only:
|
2021-03-03 19:33:19 +01:00
|
|
|
|
- main
|