-
-
Notifications
You must be signed in to change notification settings - Fork 4k
/
Copy pathconfig.yml
159 lines (153 loc) · 5 KB
/
config.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
version: 2
jobs:
backend:
docker:
- image: cimg/python:3.12
steps:
- checkout
- run: python --version > .python_version
- restore_cache:
key: &venv-cache venv-v1-{{ checksum "setup.py" }}-{{ checksum ".python_version" }}
# Only install if .venv wasn’t cached.
- run: |
if [[ ! -e ".venv" ]]; then
python -m venv .venv
source .venv/bin/activate
python -m pip install -e .[testing,docs]
fi
echo "source $(pwd)/.venv/bin/activate" >> $BASH_ENV
- save_cache:
key: *venv-cache
paths:
- .venv
- run: ruff check .
- run: ruff format --check .
- run: semgrep --config .semgrep.yml --error .
- run: git ls-files '*.html' | xargs djhtml --check
- run: curlylint --parse-only wagtail
- run: doc8 docs
- run:
name: Run tests
command: |
export PYTHONUNBUFFERED=1
WAGTAIL_CHECK_TEMPLATE_NUMBER_FORMAT=1 python -u runtests.py --parallel=2
frontend:
docker:
- image: cimg/node:22.11
steps:
- checkout
- restore_cache:
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
- save_cache:
paths:
- node_modules
key: frontend-v1-{{ checksum "package-lock.json" }}
- run: npm run build
# Save static files for subsequent jobs.
- persist_to_workspace:
root: ~/project
paths:
- wagtail
- run: npm run build-storybook
- run: npm run lint:js
- run: npm run lint:css
- run: npm run lint:format
- run: npm run test:unit:coverage -- --runInBand
- run: bash <(curl -s https://codecov.io/bash) -F frontend
ui_tests:
docker:
- image: cimg/python:3.12-browsers
environment:
DJANGO_SETTINGS_MODULE: wagtail.test.settings_ui
DJANGO_DEBUG: 'true'
steps:
- checkout
- attach_workspace:
at: ~/project
- run: python --version > .python_version
- restore_cache:
key: &ui_tests-venv-cache ui_tests-venv-v1-{{ checksum "setup.py" }}-{{ checksum ".python_version" }}
# Only install if .venv wasn’t cached.
- run: |
if [[ ! -e ".venv" ]]; then
python -m venv .venv
source .venv/bin/activate
python -m pip install -e .[testing]
fi
echo "source $(pwd)/.venv/bin/activate" >> $BASH_ENV
- save_cache:
key: *ui_tests-venv-cache
paths:
- .venv
- restore_cache:
key: &ui_tests-npm-cache ui_tests-npm_integration-v3-{{ checksum "client/tests/integration/package-lock.json" }}
# Only install if node_modules wasn’t cached.
- run: |
if [[ ! -e "client/tests/integration/node_modules" ]]; then
npm --prefix ./client/tests/integration ci
fi
- save_cache:
key: *ui_tests-npm-cache
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
- run: ./wagtail/test/manage.py migrate
- run:
command: ./wagtail/test/manage.py runserver 0:8000
background: true
- run: ./wagtail/test/manage.py createcachetable
- run:
command: ./wagtail/test/manage.py createsuperuser --noinput
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: ./wagtail/test/manage.py collectstatic --noinput
environment:
DJANGO_DEBUG: 'false'
STATICFILES_STORAGE: manifest
- store_test_results:
path: ./reports/jest
nightly-build:
docker:
- image: cimg/python:3.12-node
steps:
- checkout
- 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
workflows:
version: 2
test:
jobs:
- backend
- frontend
- ui_tests:
requires:
- frontend
nightly:
jobs:
- nightly-build
triggers:
- schedule:
cron: '0 0 * * *'
filters:
branches:
only:
- main