0
0
mirror of https://github.com/wagtail/wagtail.git synced 2024-11-29 01:22:07 +01:00
wagtail/.circleci/config.yml

155 lines
4.8 KiB
YAML
Raw Normal View History

2018-08-01 22:04:16 +02:00
version: 2
jobs:
backend:
docker:
2024-07-22 15:58:47 +02:00
- image: cimg/python:3.12
environment:
PIPENV_VENV_IN_PROJECT: true
2018-08-01 22:04:16 +02:00
steps:
- checkout
- restore_cache:
key: pipenv-v3-{{ checksum "setup.py" }}
# Only install if .venv wasnt cached.
- run: |
if [[ ! -e ".venv" ]]; then
pipenv install -e .[testing,docs]
fi
2018-08-01 22:04:16 +02:00
- save_cache:
key: pipenv-v3-{{ checksum "setup.py" }}
2018-08-01 22:04:16 +02:00
paths:
- .venv
- run: pipenv run ruff check .
- run: pipenv run ruff format --check .
- run: pipenv run semgrep --config .semgrep.yml --error .
- run: git ls-files '*.html' | xargs pipenv run djhtml --check
- run: pipenv run curlylint --parse-only wagtail
- run: pipenv run doc8 docs
- run:
name: Run tests
command: |
export PYTHONUNBUFFERED=1
WAGTAIL_CHECK_TEMPLATE_NUMBER_FORMAT=1 pipenv run python -u runtests.py --parallel=2
2018-08-01 22:04:16 +02:00
frontend:
docker:
- image: cimg/node:22.11
2018-08-01 22:04:16 +02:00
steps:
- checkout
- restore_cache:
key: frontend-v1-{{ checksum "package-lock.json" }}
# Only install if node_modules wasnt 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:
- node_modules
key: frontend-v1-{{ checksum "package-lock.json" }}
- 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
2023-02-14 12:16:48 +01:00
- run: npm run build-storybook
2018-08-01 22:04:16 +02:00
- run: npm run lint:js
- run: npm run lint:css
- 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:
2024-07-22 15:58:47 +02:00
- image: cimg/python:3.12-browsers
2021-11-12 17:27:10 +01:00
environment:
PIPENV_VENV_IN_PROJECT: true
2022-03-17 15:37:24 +01:00
DJANGO_SETTINGS_MODULE: wagtail.test.settings_ui
DJANGO_DEBUG: true
2021-11-12 17:27:10 +01:00
steps:
- checkout
- attach_workspace:
at: ~/project
- restore_cache:
key: ui_tests-pipenv-v3-{{ checksum "setup.py" }}
2021-11-12 17:27:10 +01:00
# Only install if .venv wasnt cached.
- run: |
if [[ ! -e ".venv" ]]; then
pipenv install -e .[testing]
fi
2021-11-12 17:27:10 +01:00
- save_cache:
key: ui_tests-pipenv-v3-{{ checksum "setup.py" }}
2021-11-12 17:27:10 +01:00
paths:
- .venv
- restore_cache:
key: ui_tests-npm_integration-v3-{{ checksum "client/tests/integration/package-lock.json" }}
2021-11-12 17:27:10 +01:00
# Only install if node_modules wasnt cached.
- run: |
if [[ ! -e "client/tests/integration/node_modules" ]]; then
npm --prefix ./client/tests/integration ci
fi
2021-11-12 17:27:10 +01:00
- save_cache:
key: ui_tests-npm_integration-v3-{{ checksum "client/tests/integration/package-lock.json" }}
2021-11-12 17:27:10 +01:00
paths:
- client/tests/integration/node_modules
# Also cache the global location where Puppeteer stores browsers.
# https://pptr.dev/guides/configuration/#changing-the-default-cache-directory
- ~/.cache/puppeteer
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
- run:
command: pipenv run ./wagtail/test/manage.py collectstatic --noinput
environment:
DJANGO_DEBUG: false
STATICFILES_STORAGE: manifest
2021-11-12 17:27:10 +01:00
- store_test_results:
path: ./reports/jest
nightly-build:
docker:
2024-07-22 15:58:47 +02:00
- image: cimg/python:3.12-node
steps:
- checkout
2019-06-21 12:31:04 +02:00
- run: pip install --user wheel boto3
- run: npm install
- run: npm run build
- 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:
jobs:
- backend
- frontend
- ui_tests:
requires:
- frontend
nightly:
jobs:
- nightly-build
triggers:
- schedule:
cron: '0 0 * * *'
filters:
branches:
only:
- main