Skip to content

Commit b16246a

Browse files
committed
ci: add code generation tests
This enhances the CI tests with the code generation and compilation test from two diagrams. This should cover code generation for simple diagrams and diagrams including subsystems. Signed-off-by: Michal Lenc <[email protected]>
1 parent 269fda4 commit b16246a

File tree

4 files changed

+61
-34
lines changed

4 files changed

+61
-34
lines changed

.github/workflows/.blocks.yml

Lines changed: 0 additions & 34 deletions
This file was deleted.

.github/workflows/.build.yml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: Build
2+
3+
on: [ push, pull_request ]
4+
5+
jobs:
6+
blocks:
7+
name: "Blocks Build"
8+
runs-on: ubuntu-latest
9+
10+
steps:
11+
- uses: actions/checkout@v4
12+
- name: Install dependencies
13+
run: "sudo apt-get update && sudo apt-get install libgsl-dev
14+
libxml2-dev libxslt1-dev libopenblas-dev libcomedi-dev
15+
gcc-arm-linux-gnueabihf"
16+
17+
- name: Export PYSUPSICTRL
18+
run: "export PYSUPSICTRL=${{ github.workspace }}"
19+
20+
- name: LinuxRT
21+
run: "make full_lib"
22+
23+
- name: Linux MZ APO
24+
run: "make linux_mzapo"
25+
26+
- name: Arduino Firmata
27+
run: "make arduino_firmata"
28+
29+
- name: LinuxRT with SHV
30+
run: "make full_lib SHV=1"
31+
32+
- name: Linux MZ APO with SHV
33+
run: "make linux_mzapo SHV=1"
34+
35+
generation:
36+
name: "Code Generation"
37+
runs-on: ubuntu-latest
38+
needs: blocks
39+
40+
steps:
41+
- uses: actions/checkout@v4
42+
- name: Install dependencies
43+
run: "sudo apt-get update && sudo apt-get install libgsl-dev
44+
libxml2-dev libxslt1-dev libopenblas-dev libcomedi-dev
45+
libxkbcommon-x11-0 libxcb-cursor-dev libxcb-xinerama0
46+
freeglut3-dev gcc-arm-linux-gnueabihf"
47+
48+
- name: Setup Python
49+
run: "pip install -r requirements.txt"
50+
51+
- name: Export PYSUPSICTRL
52+
run: "export PYSUPSICTRL=${{ github.workspace }}"
53+
54+
- name: Setup Linux Blocks
55+
run: "make full_lib"
56+
57+
- name: Generate Simple Diagram
58+
run: "QT_QPA_PLATFORM=offscreen ./pysim-run.sh -g Tests/diagrams/simple_linux_rt.dgm"
59+

Tests/diagrams/simple_linux_rt.dgm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"init": {"code": "pysimCoder", "ver": 0.95, "date": "18.05.2025 - 21:53:57"}, "simulate": {"template": "rt.tmf", "Ts": "0.01", "AddObj": "", "AddCDefs": "", "AddMakeArgs": "", "script": "", "intgMethod": "standard RK4", "epsAbs": "1e-6", "epsRel": "1e-6", "Tf": "10", "prio": ""}, "SHV": {"used": false, "ip": "127.0.0.1", "port": "3755", "user": "admin", "passwd": "admin!123", "devid": "untitled", "mount": "test", "tree": "GAVL"}, "blocks": [{"name": "NULL", "inp": 1, "outp": 0, "inset": true, "outset": false, "icon": "NULL", "params": "nullBlk", "help": "Not used signals must be connecte to the inputs of this block.\n\nAttention: It is not possible to have unconnected signals in a block diagram yet!\n\n", "dims": [80, 60], "flip": false, "pos": [190.0, 20.0]}, {"name": "Gain", "inp": 1, "outp": 1, "inset": true, "outset": true, "icon": "MULT", "params": "matmultBlk|Gains: 1:double", "help": "Implements the multiplication of the input with a matrix of coefficients.\n", "dims": [80, 60], "flip": false, "pos": [-130.0, 20.0]}, {"name": "Sine_wave", "inp": 0, "outp": 1, "inset": false, "outset": false, "icon": "SINUS", "params": "sineBlk|Amplitude: 1: double|Freq [Hz]: 1: double|Phase: 0: double|Bias: 0: double|Delay: 0: double", "help": "This block implements a Sinus input signal\n\nParameters:\nAmplitude\nFrequency (Hz)\nPhase\nBias\nDelay\n", "dims": [80, 60], "flip": false, "pos": [-440.0, 20.0]}], "connections": [{"pos1": [-90.0, 20.0], "pos2": [150.0, 20.0], "points": [[30.0, 20.0], [30.0, 20.0]]}, {"pos1": [-400.0, 20.0], "pos2": [-170.0, 20.0], "points": [[-300.0, 20.0], [-300.0, 20.0]]}], "subsystems": []}

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,4 @@ tornado>=6.1 # Apache Software License 2.0
1313
scikit-build>=0.15.0 # MIT
1414
pyshv>=0.8.0 #MIT
1515
typing-extensions>=4.13.1 # PSF-2.0
16+
PyQt6 # GPLv3

0 commit comments

Comments
 (0)