Code Monkey home page Code Monkey logo

rpa_challenge's Introduction

Demo: Find number of recipes in foodie.fi website

Demo project for running Robot Framework tasks in Docker and in GitHub Workflows.

Background

Demo is inspired by the Mimmit Koodaa RPA summer challenge 2020. Project is also a submission to a GitHub Actions Hackathon on DEV as it demonstrates usage of GitHub Actions.

Project demonstrates

  1. How to run Robot Framework Tasks using Docker without need to install Python and Robot Framework to a computer
  2. How to run Robot Framework Tasks in GitHub Workflow using GithubActions:
    • Automated runs for commits in the main branch and pull requests. Action can be also triggered manually (configuration: .github/workflows/trigger_search.yml)
    • Run Tasks when a new issue is opened. Action uses issue title to search a recipe in foodie.fi/recipes and closes issue by commenting number of search results in a comment. This is the wacky wildcard submission for the DEV.to Hackathon ๐Ÿ•๐Ÿ๐Ÿฅ•.

Run Tasks locally using Docker

Prerequisites

  1. Install Docker Desktop if not installed
  2. Place tasks to a folder tasks
  3. Create folder reports

Docker command

This approach works for all Robot Framework tasks/tests that utilise libraries pre-installed to the ppodgorsek/robot-framework Docker container.

To run Tasks, paste following to a Mac/Linux terminal or Windows Powershell:

docker run \
    -v ${PWD}/reports:/opt/robotframework/reports:Z \
    -v ${PWD}/tasks:/opt/robotframework/tests:Z \
    ppodgorsek/robot-framework:latest

Or to run tasks in this repository, use this command (command passes variable RECIPE_TO_SEARCH and mounts results file containing a number of search results out of the container):

docker run \
    -v ${PWD}/reports:/opt/robotframework/reports:Z \
    -v ${PWD}/tasks:/opt/robotframework/tests:Z \
    -v ${PWD}/reports/file://opt/robotframework/temp/reports/file/ \
    -e ROBOT_OPTIONS="--variable RECIPE_TO_SEARCH:pizza" \
    ppodgorsek/robot-framework:latest

Run docker in GitHub Actions

ppodgorsek/robot-framework requires autenthication to be added to a docker run command: --user $(id -u):$(id -g) \. Authentication can be run also locally:

docker run \
    -v ${PWD}/reports:/opt/robotframework/reports:Z \
    -v ${PWD}/tasks:/opt/robotframework/tests:Z \
    -v ${PWD}/reports/file://opt/robotframework/temp/reports/file/ \
    -e ROBOT_OPTIONS="--variable RECIPE_TO_SEARCH:pizza" \
    --user $(id -u):$(id -g) \
    ppodgorsek/robot-framework:latest

Github Actions

Actions tab of this repository showcases GitHub Workflow. That runs Robot Framework task that finds recipe on foodie.fi site and prints a number of results.

Workflows are defined in a folder .github/workflows/.

To trigger the recipe search, open issue to this project and place a recipe you want to search to a title. Then wait around one minute and when issue is closed, search results are posted as a comment.

GitHub issue with a title "pizza". Issue is closed by a "GitHub Actions bot" and reply message contains user mention and number of search results "@laojala - pizza: 109"

License

This project is licensed under the MIT License.

Acknowledgments

Related Projects

rpa_challenge's People

Contributors

laojala avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.