make mockup pattern only load the heaving parts when needed #233
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 }}', | |
| }); |