Skip to content

πŸ“‘ Running HIL Tests with GitHub Actions

HIL Logo

Welcome to the Hardware-in-the-Loop (HIL) CI/CD tutorial project!
This repository contains materials, documentation, source code, and examples used in a video tutorial series about running real embedded hardware tests using GitHub Actions.

πŸŽ₯ Video series playlist:
https://www.youtube.com/@MyEmbeddedWay/playlists


πŸ“ Repository Structure -> TBD

.
β”œβ”€β”€ .github/      
β”‚   └── workflows/              # GitHub Actions automation pipelines
β”œβ”€β”€ docs/                       # MkDocs documentation source
β”œβ”€β”€ hw/                         # Hardware configurations for example project
β”œβ”€β”€ lib/                        # External librarioes used in example project
β”œβ”€β”€ src/                        # Example project source code
β”œβ”€β”€ test/
β”‚   β”œβ”€β”€ _config_scripts/        # Config scripts for running all project targers
β”‚   β”œβ”€β”€ template/               # Uint tests module tempate
β”‚   β”œβ”€β”€ unity/                  # Unity frameowrk
β”‚   β”œβ”€β”€ hil_tests/              # hil tests folder
β”‚   └── peripheras_config.yaml  # py-micro-hil framework cofiguration file
└── README.md                   # You're here πŸ™‚

πŸš€ What You Will Learn

This repository teaches you how to:

  • πŸ›  Set up a Raspberry Pi HIL Test Server
  • πŸ”Œ Connect Raspberry Pi to ST-Link and the target MCU
  • πŸ§ͺ Write automated HIL tests using py-micro-hil
  • βš™οΈ Install applications from sources
  • πŸ€– Run real hardware tests inside GitHub Actions
  • πŸ“¦ Publish test artifacts & logs

πŸ“š Documentation

All documentation lives inside the docs/ directory and is published automatically to the project’s GitHub Pages site: https://niwciu.github.io/GHA_HIL/

β–Ά HIL Fundamentals

  • What is HIL?
  • Why use HIL in CI/CD?
  • Hardware & software requirements

β–Ά Raspberry Pi HIL Server Setup

  • OS installation
  • Installing stlink
  • Installing py-micro-hil
  • Lighttpd setup
  • Connecting RPi to your microcontroller

β–Ά Writing HIL Tests - working with test framework

  • Python API basics
  • Example test scripts
  • Fixtures & test structure
  • Debugging common issues

β–Ά GitHub Actions Integration

  • Workflow structure explained
  • Flashing firmware automatically
  • Running py-micro-hil tests remotely
  • Collecting logs & artifacts

β–Ά Example Project

  • Minimal firmware
  • HIL test suite
  • Full CI pipeline

πŸ”§ Requirements

Hardware

  • Raspberry Pi 3/4/5
  • ST-Link V2/V3
  • Target microcontroller (STM32 recommended)
  • Cables & power supply

Software

  • Raspberry Pi imager - https://www.raspberrypi.com/software/
  • GCC / G++ / CMake / lighttpd
  • stlink - https://github.com/stlink-org/stlink
  • py-micro-hil - https://pypi.org/project/py-micro-hil/
  • GitHub Actions runner (self-hosted)

β–Ά Quick Start

TBD


πŸ§ͺ Example GitHub Actions Workflow

TBD


πŸ—‚οΈ Roadmap

  • Publish MkDocs website
  • Documentation update
  • Framework test and update
  • Framework documentation update
  • Provide YAML workflow templates

🀝 Contributing

PRs and suggestions are welcome!
Feel free to open an issue if you want new topics covered.


πŸ“œ License

MIT or any license you choose.


πŸŽ‰ Your HIL CI/CD environment is now ready to build!


myEmbeddedWayBanner