Copyright (c) 2024 Antmicro
A GitHub Action for testing embedded software in the Renode simulation environment using the Robot Framework.
See how to use Robot with Renode in the relevant chapter in our documentation.
This action allows you to write a test in Robot using Renode's predefined keyword library and execute them automatically in GitHub Actions, which results in very nice test logs and summaries.
See action.yml
steps:
- uses: antmicro/[email protected]
with:
renode-version: 'latest'
tests-to-run: 'tests/**/*.robot'
renode-version
- required, indicates the Renode version to be downloaded from https://builds.renode.io. Can belatest
tests-to-run
- path to Robot files you want to executerenode-run-path
- optional, path where renode-run should store Renode. Useful when using cache (see below). Default: temporary directory.renode-arguments
- optional, additional arguments passed to Renode. See Renode README for details. Default: no additional arguments.artifacts-path
- optional, path where test artifacts should be stored. This includes Robot logs and HTML reports. Default: current directory.
If you use this action many times in a single job, Renode gets downloaded only once.
However, if you want to use the same Renode instance across multiple jobs, it's advisable to use cache.
jobs:
first-job:
steps:
- name: Prepare Renode settings
run: |
echo "RENODE_VERSION=latest" >> $GITHUB_ENV
echo "RENODE_RUN_DIR=/some/directory" >> $GITHUB_ENV
- name: Download Renode
uses: antmicro/[email protected]
with:
renode-version: '${{ env.RENODE_VERSION }}'
renode-run-path: '${{ env.RENODE_RUN_DIR }}'
- name: Cache Renode installation
uses: actions/cache@v2
id: cache-renode
with:
path: '${{ env.RENODE_RUN_DIR }}'
key: cache-renode-${{ env.RENODE_VERSION }}
second-job:
steps:
- name: Prepare Renode settings
run: |
echo "RENODE_VERSION=latest" >> $GITHUB_ENV
echo "RENODE_RUN_DIR=/some/directory" >> $GITHUB_ENV
- name: Restore Renode
uses: actions/cache@v2
id: cache-renode
with:
path: '${{ env.RENODE_RUN_DIR }}'
key: cfu-cache-renode-${{ env.RENODE_VERSION }}
- name: Run tests
uses: antmicro/[email protected]
with:
renode-version: '${{ env.RENODE_VERSION }}'
tests-to-run: tests-*.robot
renode-run-path: '${{ env.RENODE_RUN_DIR }}'