Embedded CI/CD

# Gate every firmware pull request without fragile HIL racks.

Physical USB board farms flake, queue up, and break when a cable comes loose. Run your compiled ELF binaries on deterministic board twins in GitHub Actions and GitLab CI on every commit.

## Drop-in GitHub Actions workflow

Store a scoped workspace token in `CIRCUITTWIN_TOKEN` and add the official action. It verifies the signed `ct` binary, uploads deduplicated ELFs by SHA-256, runs your fault matrix, and posts a JUnit summary right on the PR.

.github/workflows/firmware-ci.yml

```
name: Firmware CI
on: [push, pull_request]
jobs:
  simulate:
    runs-on: ubuntu-24.04
    steps:
      - uses: actions/checkout@v4
      - run: cmake --build build
      - uses: circuittwin/action@v1
        with:
          suite: ct/suite.yaml
          token: ${{ secrets.CIRCUITTWIN_TOKEN }}
          comment-on-pr: 'true'
```

## Drop-in GitLab CI/CD component

Use our catalog component to populate the GitLab Merge Request test widget automatically with zero shell boilerplate.

.gitlab-ci.yml

```
include:
  - component: gitlab.com/circuittwin/ci/circuittwin-tests@~latest
    inputs:
      suite: ct/suite.yaml
```

## Test fault injection matrices automatically

Physical benches struggle to reproduce intermittent bus drops or stuck sensors on demand. In a YAML test suite, sweep one firmware image across normal boot, disconnected I2C sensors, shorted CAN lines, and power brownouts in parallel. Cached cells do not consume your weekly matrix allowance.

- **Local parity:** Run `ct test run ct/suite.yaml` on your laptop to reproduce any CI failure byte for byte.
- **Trace artifacts:** Pass `--record out/` to archive `trace.jsonl`, `isr.jsonl`, `races.jsonl`, and `signals.vcd` waveforms on failures.
- **Air-gapped runners:** Team and Enterprise plans support signed 30-day offline licenses with `--network none`.

## Frequently asked questions

### Do I need self-hosted runners with USB boards attached?

No. Run your firmware test suites on standard cloud runners like ubuntu-24.04 in GitHub Actions or GitLab SaaS runners. Signed offline licenses are also available for air-gapped runners.

### Are firmware CI runs deterministic across machines?

Yes. CircuitTwin advances virtual time deterministically from instruction execution. Identical firmware, board twin, and fault inputs yield identical verdicts and SHA-256-hashed traces on Windows, Linux, and macOS.

### What report formats does CircuitTwin output for CI?

ct cloud suite run writes JUnit XML for native GitHub and GitLab test widgets, structured JSON reports, and Markdown summaries for pull request comments.

### How does CircuitTwin handle unmodelled hardware in CI?

If firmware reads or writes an unmodelled register, the case ends inconclusive and exits non-zero (exit code 1 for suites, exit code 4 for single ct run). A missing model never causes a false green build.

[CI reference docs](https://circuittwin.ai/docs/ci) [Suites & fault matrices](https://circuittwin.ai/docs/testing) [CircuitTwin vs HIL benches](https://circuittwin.ai/compare/hil-benches) [CI & fault guides](https://circuittwin.ai/guides)

> ## Run your first firmware suite in CI
>
> Start on the Free plan, commit a YAML suite alongside your firmware, and gate pull requests with deterministic pass/fail verdicts.
>
> [Start now](https://app.circuittwin.ai/try) [Read CI docs](https://circuittwin.ai/docs/ci) [Connect a coding agent](https://circuittwin.ai/docs/agents)
