Skip to content

Commit

Permalink
experiment with kibot workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
ToonVanEyck committed Sep 6, 2024
1 parent bcf91eb commit a36e49d
Show file tree
Hide file tree
Showing 4 changed files with 364 additions and 0 deletions.
126 changes: 126 additions & 0 deletions .github/workflows/kibot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
name: "Variants demo using GitHub actions"

# Controls when the action will run.
on:
push:
paths:
- '*.kicad_sch'
- '*.kicad_pcb'
- '*.kibot.yaml'
- '.github/workflows/kibot_action.yml'
pull_request:
paths:
- '*.kicad_sch'
- '*.kicad_pcb'
- '*.kibot.yaml'
- '.github/workflows/kibot_action.yml'
repository_dispatch:
types: [run_gha]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
ERC:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Run ERC
uses: INTI-CMNB/KiBot@v2_k8
with:
dir: Generated
skip: run_drc
targets: __NONE__

- name: Retrieve results
uses: actions/upload-artifact@v4
with:
name: ERC_Output
path: Generated


DRC:
runs-on: ubuntu-latest
needs: ERC

steps:
- uses: actions/checkout@v4

- name: Run DRC
uses: INTI-CMNB/KiBot@v2_k8
with:
dir: Generated
skip: run_erc
targets: __NONE__

- name: Retrieve results
uses: actions/upload-artifact@v4
with:
name: DRC_Output
path: Generated


default:
name: "Default variant"
runs-on: ubuntu-latest
needs: [ERC, DRC]

steps:
- uses: actions/checkout@v4

- uses: INTI-CMNB/KiBot@v2_k8
with:
dir: default
variant: default
skip: run_erc,run_drc

- name: upload results
uses: actions/upload-artifact@v4
with:
name: default_variant
path: default


USB:
name: "USB variant"
runs-on: ubuntu-latest
needs: [ERC, DRC]

steps:
- uses: actions/checkout@v4

- uses: INTI-CMNB/KiBot@v2_k8
with:
dir: USB
variant: USB
skip: run_erc,run_drc

- name: upload results
uses: actions/upload-artifact@v4
with:
name: USB_variant
path: USB


XTAL:
name: "XTAL variant"
runs-on: ubuntu-latest
needs: [ERC, DRC]

steps:
- uses: actions/checkout@v4

- uses: INTI-CMNB/KiBot@v2_k8
with:
dir: XTAL
variant: XTAL
skip: run_erc,run_drc

- name: upload results
uses: actions/upload-artifact@v4
with:
name: XTAL_variant
path: XTAL
1 change: 1 addition & 0 deletions .github/workflows/kicad_generate_files.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ jobs:
uses: actions/cache@v4
with:
key: kicad-8.0-ubuntu
path: /opt/KiCad

- name: Setup KiCad 8.0
if: steps.cache.outputs.cache-hit != 'true'
Expand Down
9 changes: 9 additions & 0 deletions hardware/module/side_panel/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
*.bck
*.bak
*.dcm
_autosave*
*.net
*.csv
*-bak
Fabrication
kibot_error.log
228 changes: 228 additions & 0 deletions hardware/module/side_panel/side_panel.kibot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,228 @@
# Example KiBot config file for ardu_prog.pro
kibot:
version: 1

globals:
# Filters for KiBot warnings
filters:
# - filter: Ignore PcbDraw missing components
# number: 103
# - filter: Ignore missing KiCad config, not in docker images
# number: 8
# - filter: Ignore missing KiCad 3D models, not in docker images
# number: 10
# - filter: Ignore missing KiCad config from KiAuto, not in docker images
# number: 58
# regex: kicad_common.json
# This will undo the `set_text_variables` when we run it locally
restore_project: true
# We will use a value externally formatted
time_reformat: false

preflight:
check_zone_fills: true
run_erc: true
run_drc: true
# Filters for ERC/DRC errors/warnings
# filters:
# - filter: 'We know some connectors extend outside the board'
# error: 'silk_over_copper'
# regex: 'clipped by solder mask'
set_text_variables:
# The revision will be the short git hash
# We use ${git_hash} for the REV field in the worksheet (frame)
- name: 'git_hash'
command: 'git log -1 --format="%h" $KIBOT_PCB_NAME'
before: 'Git:'
# Coherent date and time for the schematic and PCB
# This will be the time stamp of the files generation, not the commit times
# We use `${date}` for the time field in the worksheet (frame)
- name: 'date'
command: 'date --iso-8601=minutes'

outputs:
- name: 'bom_xlsx'
comment: "Spreadsheet for the Bill of Materials"
type: bom
dir: BoM
options: &bom_options
xlsx:
datasheet_as_link: MFP
title: 'KiBot variants example'
max_col_width: 40
highlight_empty: false
columns:
- Row
- References
- Quantity Per PCB
- field: Value
join: ['voltage', 'current', 'power', 'tolerance']
- field: MFN
name: Manufacturer
- field: MFP
name: Manf. Part
- Footprint
normalize_values: true

- name: 'bom_html'
comment: "HTML for the Bill of Materials"
type: bom
dir: BoM
options:
<<: *bom_options
format: HTML
html:
datasheet_as_link: MFP
title: 'KiBot variants example'
highlight_empty: false

- name: ibom
comment: 'Prototype mounting guide'
type: ibom
dir: BoM
options:
layer_view: F

- name: 'print_sch'
comment: "Schematic PDF"
type: pdf_sch_print
dir: Schematic
options:
# Append the variant to the title
title: "+ (%V variant)"

- name: gerbers
comment: Gerbers
type: gerber
dir: Gerbers
layers:
- copper
- Edge.Cuts
- F.SilkS
- B.SilkS
- F.Mask
- B.Mask
- F.Paste
- F.Adhes
- F.Fab
- F.CrtYd
- Dwgs.User

- name: drill
comment: Drill files
type: excellon
dir: Drill
options:
map:
type: pdf
pth_and_npth_single_file: false

- name: position
comment: Pick & Place
type: position
dir: Position
options:
separate_files_for_front_and_back: false

- name: print_pdf
comment: "PDF for the PCB"
type: pcb_print
dir: PCB
options:
force_edge_cuts: true
keep_temporal_files: true
# Append the variant to the title
title: "+ (%V variant)"
# This is the worksheet we selected in the project, no need to specify it again
# sheet_reference_layout: pcb_print.kicad_wks
scaling: 2.0
pages:
- layers: [ F.Paste, F.Adhes, Dwgs.User, F.Fab ]
sheet: 'Fabrication layers'
- layers:
- layer: F.Cu
- layer: F.Mask
color: '#14332440'
- layer: F.SilkS
- layer: Dwgs.User
sheet: 'Top layer'
- layers: [ GND.Cu, Dwgs.User ]
sheet: 'GND plane'
- layers: [ Power.Cu, Dwgs.User ]
sheet: 'Power plane'
- layers:
- layer: B.Cu
- layer: B.Mask
color: '#14332440'
- layer: B.SilkS
- layer: Dwgs.User
sheet: 'Bottom layer'
mirror: true

- name: board_top
comment: "Top layer view"
type: pcbdraw
dir: PCB
options:
format: jpg
dpi: 300

- name: board_top_filled
comment: "Top layer view with components"
type: pcbdraw
dir: PCB
output_id: '-filled'
options:
format: jpg
dpi: 300
show_components: all

- name: board_bottom
comment: "Bottom layer view"
type: pcbdraw
dir: PCB
options:
format: jpg
dpi: 300
bottom: true

- name: board_bottom_filled
comment: "Bottom layer view with components"
type: pcbdraw
dir: PCB
output_id: '-filled'
options:
format: jpg
dpi: 300
bottom: true
show_components: all

- name: 3D
comment: "STEP 3D model"
type: step
dir: 3D

- name: 3D_top_view
comment: "3D render from top"
type: render_3d
dir: 3D
options:
zoom: 4
rotate_x: 3
rotate_z: 3
ray_tracing: true

- name: 3D_top_view_HQ
comment: "3D render from top (High Quality)"
type: blender_export
dir: 3D
options:
render_options:
transparent_background: true
samples: 20
point_of_view:
rotate_x: 30
rotate_z: -20
outputs:
- type: blender
- type: render

0 comments on commit a36e49d

Please sign in to comment.