CI/CD
-
Okay, so we would have 3 main things to do in our CI:
- Generate STEP files from FreeCAD
- Generate PDF files from KiCad
- Unittest (in the future) and generate binary/hex file
As from my point of view all of three sections should be separated in different repos and combined using
git submodules
, though there are few problems I see, mostly inCAD
:- CI/CD must know from which input files generate output files - as for now they are kind of mixed in main
CAD
folder, so my proposition is to create separate folder for:
1.13D_printed
parts, as these need to be converted from*.FCStd
into*.step
1.2.2D drawings
parts, likeCurrent Collector Drawing
orGasket Drawings
which needs to be translated from*.FCStd
into*.pdf
1.3. Renders which would require rendering whole assemblies - those could be placed inAssembly
folder
We would end up with structure of:
. ├── 2D_drawings ├── 3D_print └── Assembly
-
Electronics
is pretty simple, as there will be only KiCAD project, maybe the some kind of electronical/electrical calculations, though I think we are far from it now -
Similar with
Firmware
, there would be simply two folders:src
andtests
, but that is also a next step
I would love to hear other opinions, my idea is to create CI/CD as simple as possible, due to fact that I understand that many ppl who would like to contribute with CAD files might be not familiar with any CI/CD, and for that I came up with that folder idea
-
Okay so for CAD, I created a simple tutorial, mostly for myself, as I wanna go to sleep soon, and might forget what to do
This might be not optimal, or obsolete, I did not find another FreeCAD's docker image
EDIT: I have found a newer FreeCAD image, though it cointain GUI as well, thus works really weird without X server
-
Pull FreeCAD's docker image (maybe we would need to create an new FreeCAD's image, as this one seems to be pretty old FreeCAD wiki
-
run it in
CAD
folder:
docker run --rm -it -v ${PWD}:/home/CAD amrit3701/freecad-cli:latest python3.8
- Now we are in docker's image Python interpreter
Let's assume that we do have this tree as I mentioned in previous post:
We are choosing first one from
3D_printed
folder (ofc in the future we would iterate over files in given directory)>>> doc = FreeCAD.open(os.path.join("3D_printed", os.listdir("3D_printed")[0]))
We find
body
object which (I hope) will be on 1st place:>>> doc.findObjects()[0].Shape.exportStep(f'{doc.Name}.step')
Voila! We do have our STEP file
-
-
Oh, nice work! Would this be using the Woodpecker CI that Codeberg has? https://docs.codeberg.org/ci/
I also found where the LumenPNP developers have all their CI/CD workflows, for FreeCAD and KiCAD and such:
https://github.com/opulo-inc/lumenpnp/tree/main/.github/workflows
Maybe these could be used with minimal modification?
-
Stephen Hawes of Opulo has compiled some of their tools here:
The AutoBOM one seems to be based on those workflows above and looks pretty interesting