DEV Community

Cover image for Robot Framework - Setup CI using GitHub Actions
Laura Ojala
Laura Ojala

Posted on • Updated on

Robot Framework - Setup CI using GitHub Actions

Submission for the DEV: GitHub Actions For Open Source πŸ¦•πŸ¦–

My Workflow

Continuous Integration (CI) workflow for running Robot Framework tests. Demo has two Workflows that provide these use cases:

  • Run Robot Framework tests:
    • when new commits are pushed to the main branch
    • when new commits are pushed to a Pull request
    • run tests with a pre-defined schedule
    • Trigger tests manually. Input variables for a test run.
  • Reporting:
    • Store Robot Framework reports from test runs
    • Post summary of results as comment to a commit. Comment is posted only to the main (master) branch.

Submission Category

Maintainer Must-Haves

Link to Code

GitHub logo laojala / robot_docker_demo

Robot Framework - Setup CI using GitHub Actions

Robot Framework CI Demo

This project demonstrates how to setup Continous Integration for Robot Framework tests using GitHub Actions.

Use Cases

Demo covers these use cases:

  • Run Robot Framework tests
    • when new commits are pushed to the main branch
    • when new commits are pushed to a Pull request
    • run tests with a pre-defined schedule
    • Trigger tests manually. Input variables for a test run.
  • Reporting
    • Store Robot Framework reports from test runs
    • Post summary of results as a comment to a commit. The comment is posted only to the main (master) branch.

In other words, a separate CI server (such as Jenkins) is not needed to run Robot Framework tests.

Why use Actions for CI?

Using GitHub Actions for setup CI is almost better than sourdough bread πŸžπŸŽ‰ Setup is straightforward and usage is free for public repositories (see pricing for other types of repositories).

Setup described here is very…

Additional Resources / Info

The project is intended as a demo about how to integrate Robot Framework tests to the CI.

Description of the tests

The project implements a simple "dinosaur test" that takes two inputs and tests if those are dinosaurs. Test is coded using Robot Framework and it's standard Libraries. Project has also a cron-schedule for running tests for this dinosaur test once a year and running tests for the pull requests and for commits to the main branch.

Image below displays how the Dinosaur test can be triggered manually in the Actions:

Screenshot of GitHub workflow_dispatch event trigger when user has clicked button "Run Workflow". There is a form-type of input overlay with fields: "Use workflow from: Master", "Creature that is expected to be dinosaur:<br>
achillobator", "Creature that is not a dinosaur:<br>
pteranodon", and "Tag for tests to run. Use '*' to run all: dinosaur". Button in the bottom has text "Run workflow"

Further resources

I have created another demo project that describes Docker usage with Robot Framework RPA tasks. This project contains GitHub Actions BOT for closing issues. Project describes in detail how to run Robot Framework tests inside a ready-made Docker container:

Top comments (0)