Demo project for running Robot Framework tasks in Docker and in GitHub Workflows.
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.
- How to run Robot Framework Tasks using Docker without need to install Python and Robot Framework to a computer
- 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 ๐๐๐ฅ.
- Install Docker Desktop if not installed
- Place tasks to a folder
tasks
- Create folder
reports
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
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
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.
This project is licensed under the MIT License.
- Docker Image used for running Robot Framewoek Tasks:
- Issue matching auto-closer Action that closes recipe searchs:
- My other GitHub Actions demo that implements CI for Robot Framework tests: