Add CI/CD pipeline generation tool and update README#6
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a new MCP tool to generate a ready-to-commit GitHub Actions workflow for running Robot Framework tests, and expands the README to document both the CI/CD generator and the previously added live browser control tools.
Changes:
- Introduces
create_cicd_pipeline()inmcp_server.pyto generate a Robot Framework GitHub Actions workflow (push/PR triggers, optional schedule, Chrome setup, dependency install, artifact upload, and results parsing). - Updates
README.mdwith documentation for live browser control tools and the new CI/CD pipeline generator.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| README.md | Documents live browser tools and the new CI/CD pipeline generation tool with examples. |
| mcp_server.py | Adds create_cicd_pipeline() to generate a GitHub Actions workflow YAML for Robot Framework test runs. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+1408
to
+1414
| if not python_version or not python_version.strip(): | ||
| python_version = f"{sys.version_info.major}.{sys.version_info.minor}" | ||
| branches = [b.strip() for b in trigger_branches.split(",") if b.strip()] | ||
| if not branches: | ||
| return "VALIDATION ERROR: trigger_branches cannot be empty." | ||
|
|
||
| branch_lines = "\n".join(f" - {b}" for b in branches) |
Comment on lines
+1422
to
+1425
| # Build the fallback requirements block used when no requirements.txt exists | ||
| fallback_install = ( | ||
| "pip install robotframework robotframework-seleniumlibrary selenium" | ||
| ) |
Comment on lines
+1462
to
+1466
| if [ -f {requirements_file} ]; then | ||
| pip install -r {requirements_file} | ||
| else | ||
| {fallback_install} | ||
| fi |
Comment on lines
+1480
to
+1484
| robot \\ | ||
| --outputdir {output_dir} \\ | ||
| --variable BROWSER:headlesschrome \\ | ||
| --loglevel INFO \\ | ||
| {test_directory} |
Comment on lines
+1500
to
+1509
| if [ -f {output_dir}output.xml ]; then | ||
| python - <<'PY' | ||
| import xml.etree.ElementTree as ET, sys | ||
| tree = ET.parse("{output_dir}output.xml") | ||
| stats = tree.find(".//total/stat") | ||
| if stats is not None: | ||
| passed = stats.get("pass", "?") | ||
| failed = stats.get("fail", "?") | ||
| print(f"Results — passed: {{passed}}, failed: {{failed}}") | ||
| sys.exit(1 if int(failed) > 0 else 0) |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
create_cicd_pipelineMCP tool that generates a complete GitHub Actions workflow file for running Robot Framework testsNew Tool —
create_cicd_pipelineGenerates a
.github/workflows/robot-tests.ymlfile ready to drop into any Robot Framework project.Parameters:
project_namerobot-testspython_versiontest_directorytests/trigger_branchesmainschedule0 9 * * 1-5output_dirresults/requirements_filerequirements.txtGenerated workflow includes:
browser-actions/setup-chromerequirements.txtif present, falls back to core packagesheadlesschromebrowser variableoutput.xmland reports pass/fail counts; fails the job if any test failsExample usage:
README Updates
browser_*tools from PR Add live browser action tools for direct Selenium control #5Test Plan
create_cicd_pipeline()with default params generates valid YAMLsys.version_info)trigger_branchesall appear in the workflowscheduleblock appears only when a cron expression is providedrequirements.txtis specified