-
-
Notifications
You must be signed in to change notification settings - Fork 104
152 lines (130 loc) · 5.01 KB
/
Copy pathcoredev-robot-tests.yml
File metadata and controls
152 lines (130 loc) · 5.01 KB
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
name: Robot Tests (Coredev)
on:
issue_comment:
types: [created]
jobs:
create-check:
if: >
github.event.issue.pull_request &&
contains(github.event.comment.body, '/run-coredev-robottests')
runs-on: ubuntu-latest
outputs:
check_run_id: ${{ steps.create.outputs.check_run_id }}
sha: ${{ steps.create.outputs.sha }}
steps:
- name: Get PR SHA and create Check Run
id: create
uses: actions/github-script@v9
with:
script: |
const pr = await github.rest.pulls.get({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: context.issue.number,
});
const sha = pr.data.head.sha;
const check = await github.rest.checks.create({
owner: context.repo.owner,
repo: context.repo.repo,
name: 'Coredev robot tests',
head_sha: sha,
status: 'in_progress',
details_url: `https://github.com/${context.repo.owner}/${context.repo.repo}/actions/runs/${context.runId}`,
});
core.setOutput('sha', sha);
core.setOutput('check_run_id', String(check.data.id));
robot-tests:
needs: create-check
name: Coredev robot tests
runs-on: ubuntu-latest
env:
PYTHONWARNINGS: ignore
GIT_CLONE_DEPTH: 1
zope_i18n_compile_mo_files: 'true'
ROBOTSUITE_LOGLEVEL: ERROR
ROBOTSUITE_PREFIX: ONLYROBOT
NODE_OPTIONS: "--max_old_space_size=8192"
steps:
- name: Acknowledge command
uses: peter-evans/create-or-update-comment@v4
with:
comment-id: ${{ github.event.comment.id }}
reactions: '+1'
token: ${{ secrets.GITHUB_TOKEN }}
- name: Info
run: |
echo "Workflow triggered with comment '/run-coredev-robottests' "
echo "on PR #${{ github.event.issue.number }}"
- name: locale
# needed for CMFPlone testUnicodeSplitter test on Ubuntu
run: |
sudo locale-gen nl_NL@euro
sudo update-locale
# ── 1. Checkout repositories ─────────────────────────────────────────────
- name: Checkout mockup PR
uses: actions/checkout@v4
with:
ref: ${{ needs.create-check.outputs.sha }}
- name: Checkout buildout.coredev
uses: actions/checkout@v4
with:
repository: plone/buildout.coredev
path: tests
# ── 2. Node.js setup ──────────────────────────────────────────────────────
- name: Install pnpm
uses: pnpm/action-setup@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: "22"
cache: pnpm
- name: Install pnpm dependencies
run: pnpm install
# ── 3. Python / make install ─────────────────────────────────────────────
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: pip
cache-dependency-path: tests/requirements.txt
- name: Mark plone.staticresources as source checkout
run: |
echo " plone.staticresources" >> tests/checkouts.cfg
- name: Install (checks out plone.staticresources via mxdev)
working-directory: tests
run: make install
# ── 2b. Build mockup bundle into tests/src/plone.staticresources ─────────
- name: Build mockup for tests (webpack)
run: pnpm build:webpack:tests
# ── 4. Install Playwright / rfbrowser ────────────────────────────────────
- name: install rfbrowser
working-directory: tests
run: .venv/bin/rfbrowser init chromium
- name: Run Coredev robot tests
working-directory: tests
run: ROBOTSUITE_PREFIX=ONLYROBOT TEST_ARGS="--all -t ONLYROBOT" make test
- name: Upload robot test results
if: always()
uses: actions/upload-artifact@v4
with:
name: robot-results
path: |
tests/test_*
tests/robot_*
if-no-files-found: ignore
update-check:
needs: [create-check, robot-tests]
if: needs.create-check.outputs.check_run_id
runs-on: ubuntu-latest
steps:
- name: Update Check Run
uses: actions/github-script@v9
with:
script: |
await github.rest.checks.update({
owner: context.repo.owner,
repo: context.repo.repo,
check_run_id: ${{ needs.create-check.outputs.check_run_id }},
status: 'completed',
conclusion: '${{ needs.robot-tests.result }}',
});