Skip to content

Commit e307d27

Browse files
committed
Add build pipeline
1 parent 1e729cf commit e307d27

File tree

2 files changed

+247
-0
lines changed

2 files changed

+247
-0
lines changed

.github/workflows/build.yml

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
name: U3A Build Pipeline
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
10+
11+
jobs:
12+
export-kicad:
13+
env:
14+
BaseFileName: "U3A"
15+
SchematicFileExtension: "kicad_sch"
16+
PCBFileExtension: "kicad_pcb"
17+
OutputFolder: "./output"
18+
ConfigFilePath: ".kibot/build.kibot.yaml"
19+
runs-on: ubuntu-latest
20+
steps:
21+
- name: Fetch repository
22+
uses: actions/checkout@v4
23+
24+
- name: Prepare output directory
25+
run: |
26+
mkdir -p ${{ env.OutputFolder }}
27+
cp -r ./pcb ${{ env.OutputFolder }}/kicad
28+
cp ./LICENSE.md ${{ env.OutputFolder }}
29+
30+
- name: Run KiBOT
31+
uses: INTI-CMNB/KiBot@v2_dk7
32+
with:
33+
config: ${{ env.ConfigFilePath }}
34+
dir: ${{ env.OutputFolder }}
35+
schema: "./pcb/${{ env.BaseFileName }}.${{ env.SchematicFileExtension }}"
36+
board: "./pcb/${{ env.BaseFileName }}.${{ env.PCBFileExtension }}"
37+
38+
- name: Archive artifacts
39+
uses: actions/upload-artifact@v4
40+
with:
41+
name: kicad-export
42+
path: ${{ env.OutputFolder }}
43+
retention-days: 1
44+
45+
export-freecad:
46+
env:
47+
FREECADVERSION: "1.0.2"
48+
FreeCADFileName: "./mechanical/housing.FCStd"
49+
OutputFolder: "./output"
50+
PartType: "PartDesign::Body"
51+
runs-on: ubuntu-latest
52+
steps:
53+
- name: Fetch repository
54+
uses: actions/checkout@v4
55+
56+
- name: Prepare output directory
57+
run: |
58+
mkdir -p ${{ env.OutputFolder }}
59+
cp -r ./mechanical ${{ env.OutputFolder }}
60+
cp ./LICENSE.md ${{ env.OutputFolder }}
61+
62+
- name: Install FreeCAD
63+
run: |
64+
wget https://github.com/FreeCAD/FreeCAD/releases/download/${{ env.FREECADVERSION }}/FreeCAD_${{ env.FREECADVERSION }}-conda-Linux-x86_64-py311.AppImage
65+
chmod 0777 FreeCAD_${{ env.FREECADVERSION }}-conda-Linux-x86_64-py311.AppImage
66+
./FreeCAD_${{ env.FREECADVERSION }}-conda-Linux-x86_64-py311.AppImage --appimage-extract
67+
- name: Get FreeCAD Export
68+
run: |
69+
git clone https://github.com/0x007E/pyfreecadexport.git
70+
- name: Export STEP Files
71+
run: |
72+
./squashfs-root/usr/bin/python ./pyfreecadexport/src/pyfreecadexport.py -f "${{ env.FreeCADFileName }}" -p "${{ env.PartType }}" -d "${{ env.OutputFolder }}" -e "step" -l "squashfs-root/usr/lib/"
73+
./squashfs-root/usr/bin/python ./pyfreecadexport/src/pyfreecadexport.py -f "${{ env.FreeCADFileName }}" -p "${{ env.PartType }}" -d "${{ env.OutputFolder }}" -e "stl" -l "squashfs-root/usr/lib/"
74+
75+
- name: Archive artifacts
76+
uses: actions/upload-artifact@v4
77+
with:
78+
name: freecad-export
79+
path: ${{ env.OutputFolder }}
80+
retention-days: 1

.kibot/build.kibot.yaml

Lines changed: 167 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,167 @@
1+
kibot:
2+
version: 1
3+
4+
globals:
5+
# Filters for KiBot warnings
6+
filters:
7+
- filter: Ignore PcbDraw missing components
8+
number: 103
9+
- filter: Ignore missing KiCad config, not in docker images
10+
number: 8
11+
- filter: Ignore missing KiCad 3D models, not in docker images
12+
number: 10
13+
- filter: Ignore missing KiCad config from KiAuto, not in docker images
14+
number: 58
15+
regex: kicad_common.json
16+
# This will undo the `set_text_variables` when we run it locally
17+
restore_project: true
18+
# We will use a value externally formatted
19+
time_reformat: false
20+
21+
preflight:
22+
check_zone_fills: true
23+
fill_zones: true
24+
run_erc: true
25+
run_drc: true
26+
filters:
27+
- filter: 'does not match copy in library'
28+
error: 'lib_footprint_mismatch'
29+
regex: 'does not match copy in library'
30+
- filter: 'Hole clearance violation'
31+
error: 'hole_clearance'
32+
regex: 'Hole clearance violation'
33+
set_text_variables:
34+
- name: 'date'
35+
command: 'date +%d.%m.%Y'
36+
37+
outputs:
38+
- name: 'bom_xlsx'
39+
comment: "Spreadsheet for the Bill of Materials"
40+
type: bom
41+
dir: './bom'
42+
options: &bom_options
43+
xlsx:
44+
datasheet_as_link: MFP
45+
max_col_width: 40
46+
highlight_empty: false
47+
columns:
48+
- Row
49+
- References
50+
- Footprint
51+
- field: Vendor
52+
name: Vendor
53+
- field: VendorId
54+
name: VendorId
55+
- Quantity Per PCB
56+
normalize_values: true
57+
58+
- name: 'print_sch'
59+
comment: 'Schematic PDF'
60+
type: pdf_sch_print
61+
dir: './schematic'
62+
options:
63+
monochrome: true
64+
65+
- name: print_pdf_top
66+
comment: 'PCB PDF TOP'
67+
type: pcb_print
68+
dir: './pcb'
69+
options:
70+
force_edge_cuts: true
71+
keep_temporal_files: false
72+
format: 'PDF'
73+
output : 'PCB.%x'
74+
plot_sheet_reference: true
75+
scaling: 2.0
76+
pages:
77+
- layers:
78+
- layer: F.Cu
79+
sheet: '(Top Copper)'
80+
mirror: false
81+
monochrome: true
82+
- layers:
83+
- layer: B.Cu
84+
sheet: '(Bottom Copper)'
85+
mirror: false
86+
monochrome: true
87+
mirror: true
88+
- layers:
89+
- layer: F.Silkscreen
90+
sheet: '(Top Silkscreen)'
91+
mirror: false
92+
monochrome: true
93+
- layers:
94+
- layer: B.Silkscreen
95+
sheet: '(Bottom Silkscreen)'
96+
mirror: false
97+
monochrome: true
98+
mirror: true
99+
- layers:
100+
- layer: F.Fab
101+
sheet: '(Top Fabrication)'
102+
mirror: false
103+
monochrome: true
104+
- layers:
105+
- layer: B.Fab
106+
sheet: '(Bottom Fabrication)'
107+
mirror: false
108+
monochrome: true
109+
mirror: true
110+
- layers: [ F.Silkscreen, User.Drawings ]
111+
sheet: '(Top Drawings)'
112+
mirror: false
113+
monochrome: true
114+
- layers: [ F.Silkscreen, User.Drawings2 ]
115+
sheet: '(Top Drawings2)'
116+
monochrome: true
117+
mirror: false
118+
119+
- name: 'gerbers'
120+
comment: 'Gerber Files'
121+
type: gerber
122+
dir: './gerber'
123+
layers:
124+
- F.Cu
125+
- B.Cu
126+
- F.Adhesive
127+
- B.Adhesive
128+
- F.Paste
129+
- B.Paste
130+
- F.Silkscreen
131+
- B.Silkscreen
132+
- F.Mask
133+
- B.Mask
134+
- Edge.Cuts
135+
136+
- name: drill
137+
comment: Drill files
138+
type: excellon
139+
dir: './drill'
140+
options:
141+
map:
142+
type: pdf
143+
pth_and_npth_single_file: true
144+
145+
- name: board_top_filled
146+
comment: "Top layer view with components"
147+
type: pcbdraw
148+
dir: './image'
149+
options:
150+
format: jpg
151+
dpi: 300
152+
show_components: all
153+
154+
- name: board_bottom_filled
155+
comment: "Bottom layer view with components"
156+
type: pcbdraw
157+
dir: './image'
158+
options:
159+
format: jpg
160+
dpi: 300
161+
bottom: true
162+
show_components: all
163+
164+
- name: mechanical
165+
comment: "STEP model"
166+
type: step
167+
dir: './step'

0 commit comments

Comments
 (0)