Skip to content

Add CI/CD pipeline generation tool and update README#6

Merged
meenurani1 merged 1 commit into
mainfrom
feature/cicd-pipeline-generation
Jun 2, 2026
Merged

Add CI/CD pipeline generation tool and update README#6
meenurani1 merged 1 commit into
mainfrom
feature/cicd-pipeline-generation

Conversation

@meenurani1
Copy link
Copy Markdown
Collaborator

Summary

  • Adds create_cicd_pipeline MCP tool that generates a complete GitHub Actions workflow file for running Robot Framework tests
  • Auto-detects the Python version from the current environment (no hardcoding)
  • Updates README with documentation for the new CI/CD tool and the browser action tools added in PR Add live browser action tools for direct Selenium control #5

New Tool — create_cicd_pipeline

Generates a .github/workflows/robot-tests.yml file ready to drop into any Robot Framework project.

Parameters:

Parameter Default Description
project_name robot-tests Workflow and artifact name
python_version auto-detected Picked from the running environment; can be overridden
test_directory tests/ Path to Robot Framework tests
trigger_branches main Comma-separated branches that trigger the workflow
schedule (empty) Optional cron expression, e.g. 0 9 * * 1-5
output_dir results/ Where Robot Framework writes results
requirements_file requirements.txt pip requirements file

Generated workflow includes:

  • Trigger on push + pull request (configurable branches)
  • Optional scheduled runs via cron
  • Python setup with pip cache
  • Chrome (stable, headless) via browser-actions/setup-chrome
  • Installs from requirements.txt if present, falls back to core packages
  • Runs tests with headlesschrome browser variable
  • Uploads full results folder as artifact (30-day retention)
  • Parses output.xml and reports pass/fail counts; fails the job if any test fails

Example usage:

create_cicd_pipeline(
    project_name="my-rf-tests",
    trigger_branches="main, develop",
    schedule="0 9 * * 1-5",
    test_directory="tests/",
)
# Save output to .github/workflows/robot-tests.yml

README Updates

Test Plan

  • create_cicd_pipeline() with default params generates valid YAML
  • Python version matches the environment (sys.version_info)
  • Multiple branches in trigger_branches all appear in the workflow
  • schedule block appears only when a cron expression is provided
  • Fallback install runs when no requirements.txt is specified
  • Generated workflow runs successfully in a GitHub Actions environment

Copilot AI review requested due to automatic review settings June 2, 2026 19:05
@meenurani1 meenurani1 merged commit 3ca48d5 into main Jun 2, 2026
1 check passed
@meenurani1 meenurani1 deleted the feature/cicd-pipeline-generation branch June 2, 2026 19:06
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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() in mcp_server.py to generate a Robot Framework GitHub Actions workflow (push/PR triggers, optional schedule, Chrome setup, dependency install, artifact upload, and results parsing).
  • Updates README.md with 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 thread mcp_server.py
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 thread mcp_server.py
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 thread mcp_server.py
Comment on lines +1462 to +1466
if [ -f {requirements_file} ]; then
pip install -r {requirements_file}
else
{fallback_install}
fi
Comment thread mcp_server.py
Comment on lines +1480 to +1484
robot \\
--outputdir {output_dir} \\
--variable BROWSER:headlesschrome \\
--loglevel INFO \\
{test_directory}
Comment thread mcp_server.py
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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants