Skip to content

Commit f0fb91f

Browse files
committed
tech(bundle): add GHA which runs coredev robottests with compiled bundle.
1 parent b7e4255 commit f0fb91f

3 files changed

Lines changed: 105 additions & 0 deletions

File tree

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
name: Robot Tests (Coredev)
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
- 5.4.x
8+
pull_request:
9+
branches:
10+
- master
11+
- 5.4.x
12+
13+
jobs:
14+
robot-tests:
15+
name: Coredev robot tests
16+
runs-on: ubuntu-latest
17+
env:
18+
PYTHONWARNINGS: ignore
19+
GIT_CLONE_DEPTH: 1
20+
zope_i18n_compile_mo_files: 'true'
21+
ROBOTSUITE_LOGLEVEL: ERROR
22+
ROBOTSUITE_PREFIX: ONLYROBOT
23+
NODE_OPTIONS: "--max_old_space_size=8192"
24+
25+
steps:
26+
- name: locale
27+
# needed for CMFPlone testUnicodeSplitter test on Ubuntu
28+
run: |
29+
sudo locale-gen nl_NL@euro
30+
sudo update-locale
31+
32+
# ── 1. Checkout repositories ─────────────────────────────────────────────
33+
- name: Checkout mockup
34+
uses: actions/checkout@v4
35+
36+
- name: Checkout buildout.coredev
37+
uses: actions/checkout@v4
38+
with:
39+
repository: plone/buildout.coredev
40+
path: tests
41+
42+
# ── 2. Node.js setup ──────────────────────────────────────────────────────
43+
- name: Set up Node.js
44+
uses: actions/setup-node@v4
45+
with:
46+
node-version: "22"
47+
cache: yarn
48+
49+
- name: Install yarn dependencies
50+
run: yarn install
51+
52+
# ── 3. Python / make install ─────────────────────────────────────────────
53+
- name: Set up Python 3.12
54+
uses: actions/setup-python@v5
55+
with:
56+
python-version: "3.12"
57+
cache: pip
58+
cache-dependency-path: tests/requirements.txt
59+
60+
- name: Mark plone.staticresources as source checkout for mxdev
61+
working-directory: tests
62+
run: |
63+
python3 -c "
64+
import configparser
65+
cfg = configparser.ConfigParser()
66+
cfg.read('mxcheckouts.ini')
67+
if not cfg.has_section('plone.staticresources'):
68+
cfg.add_section('plone.staticresources')
69+
cfg.set('plone.staticresources', 'use', 'true')
70+
with open('mxcheckouts.ini', 'w') as f:
71+
cfg.write(f)
72+
"
73+
74+
- name: make install (checks out plone.staticresources via mxdev)
75+
working-directory: tests
76+
run: make install
77+
78+
# ── 2b. Build mockup bundle into tests/src/plone.staticresources ─────────
79+
- name: Build mockup for tests (webpack)
80+
run: yarn build:webpack:tests
81+
82+
# ── 4. Install Playwright / rfbrowser ────────────────────────────────────
83+
- name: make rfbrowser
84+
working-directory: tests
85+
run: make rfbrowser
86+
87+
# ── 5. Coredev robot tests ───────────────────────────────────────────────
88+
- name: Run Coredev robot tests
89+
working-directory: tests
90+
run: TEST_ARGS="--all -t ONLYROBOT" make test
91+
92+
- name: Upload robot test results
93+
if: always()
94+
uses: actions/upload-artifact@v4
95+
with:
96+
name: robot-results
97+
path: tests/parts/tests/
98+
if-no-files-found: ignore

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@
8787
"build:webpack": "NODE_ENV=production webpack --config webpack.config.js",
8888
"build:webpack:dev": "NODE_ENV=development webpack --config webpack.config.js",
8989
"build:webpack:plone": "NODE_ENV=production DEPLOYMENT=plone webpack --config webpack.config.js",
90+
"build:webpack:tests": "NODE_ENV=production DEPLOYMENT=tests webpack --config webpack.config.js",
9091
"build:webpack:docs": "NODE_ENV=production DEPLOYMENT=docs webpack --config webpack.config.js",
9192
"build:webpack:dev:plone": "NODE_ENV=development DEPLOYMENT=plone webpack --config webpack.config.js",
9293
"build:docs": "ELEVENTY_ENV=production npx @11ty/eleventy --pathprefix=mockup",

webpack.config.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,12 @@ module.exports = () => {
162162
"../plone.staticresources/src/plone/staticresources/static/bundle-plone/"
163163
);
164164
}
165+
if (process.env.DEPLOYMENT === "tests") {
166+
config.output.path = path.resolve(
167+
__dirname,
168+
"./tests/src/plone.staticresources/src/plone/staticresources/static/bundle-plone/"
169+
);
170+
}
165171

166172
//console.log(JSON.stringify(config, null, 4));
167173

0 commit comments

Comments
 (0)