antmicro / renode-test-action

GitHub Action allowing to run tests in the Renode framework

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Test in Renode GitHub Action

Copyright (c) 2024 Antmicro

View on Antmicro Open Source Portal

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.

Usage

Test action

See action.yml

steps:
- uses: antmicro/renode-test-action@v3.1.0
  with:
    renode-version: 'latest'
    tests-to-run: 'tests/**/*.robot'

Using cache

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/renode-test-action@v3.1.0
       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/renode-test-action@v3.1.0
       with:
         renode-version: '${{ env.RENODE_VERSION }}'
         tests-to-run: tests-*.robot
         renode-run-path: '${{ env.RENODE_RUN_DIR }}'

About

GitHub Action allowing to run tests in the Renode framework

License:Apache License 2.0


Languages

Language:Shell 81.3%Language:RobotFramework 18.7%