Skip to content

Commit

Permalink
Update build workflows to use KiBot (no autoroute)
Browse files Browse the repository at this point in the history
  • Loading branch information
ceoloide committed Sep 30, 2023
1 parent f46178d commit ff61f4b
Show file tree
Hide file tree
Showing 6 changed files with 53 additions and 85 deletions.
8 changes: 3 additions & 5 deletions .github/actions/export-dsn/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,22 @@ name: 'Export DSN'
description: 'Export Specctra DSN from a Kicad PCB'
inputs:
boards:
description: 'Board names'
description: 'KiCad PCB names'
required: true
runs:
using: 'docker'
image: 'docker://soundmonster/kicad-automation-scripts:latest'
image: 'docker://ghcr.io/inti-cmnb/kicad7_auto@latest'
entrypoint: '/bin/sh'
args:
- '-c'
# GH actions set $HOME to a weird location and we have to move Kicad settings there first
- |
mkdir -p $HOME/.config/kicad;
cp /root/.config/kicad/* $HOME/.config/kicad;
for board in ${{ inputs.boards }};
do
echo Processing $board;
if [ -e $GITHUB_WORKSPACE/ergogen/output/pcbs/${board}.dsn ]; then
echo Cleaning up $GITHUB_WORKSPACE/ergogen/output/pcbs/${board}.dsn
rm -f $GITHUB_WORKSPACE/ergogen/output/pcbs/${board}.dsn
fi
/usr/lib/python2.7/dist-packages/kicad-automation/pcbnew_automation/export_dsn.py $GITHUB_WORKSPACE/ergogen/output/pcbs/${board}.kicad_pcb $GITHUB_WORKSPACE/ergogen/output/pcbs/${board}.dsn
$GITHUB_WORKSPACE/kibot/export_dsn.py -b $GITHUB_WORKSPACE/ergogen/output/pcbs/${board}.kicad_pcb -o $GITHUB_WORKSPACE/ergogen/output/pcbs/${board}.dsn
done
25 changes: 0 additions & 25 deletions .github/actions/export-gerbers/action.yaml

This file was deleted.

19 changes: 19 additions & 0 deletions .github/actions/kibot/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: 'Run KiBot'
description: 'Run KiBot automation to generate images and gerbers'
inputs:
boards:
description: 'KiCad PCB names'
required: true
runs:
using: 'docker'
image: 'docker://ghcr.io/inti-cmnb/kicad7_auto@latest'
entrypoint: '/bin/sh'
args:
- '-c'
# GH actions set $HOME to a weird location and we have to move Kicad settings there first
- |
for board in ${{ inputs.boards }};
do
echo Processing $board;
kibot -b ergogen/output/pcbs/${board}.kicad_pcb -c $GITHUB_WORKSPACE/kibot/boards.kibot.yaml
done
24 changes: 0 additions & 24 deletions .github/actions/run-drc/action.yaml

This file was deleted.

36 changes: 18 additions & 18 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,28 +30,28 @@ jobs:
run: npm install
- name: Generate unrouted PCBs with Ergogen (definition in package.json)
run: npm run build
- name: Export DSN
uses: ./.github/actions/export-dsn
with:
boards: corney_island
- name: Autoroute PCB
uses: ./.github/actions/autoroute
with:
boards: corney_island
- name: Import SES
uses: ./.github/actions/import-ses
- name: Run KiBot to generate images, gerbers for the plate files
uses: ./.github/actions/kibot
with:
boards: corney_island
- name: DRC check
uses: ./.github/actions/run-drc
with:
boards: corney_island
- name: Export Gerbers
uses: ./.github/actions/export-gerbers
boards: frontplate,backplate,controller_overlay,corney_island
- name: Export DSN file for Freerouting
uses: ./.github/actions/export-dsn
with:
boards: corney_island
# - name: Autoroute PCB
# uses: ./.github/actions/autoroute
# with:
# boards: corney_island
# - name: Import SES
# uses: ./.github/actions/import-ses
# with:
# boards: corney_island
# - name: DRC check
# uses: ./.github/actions/run-drc
# with:
# boards: corney_island
- name: Persist output
uses: actions/upload-artifact@v3
with:
name: corney_island
name: corney_island_unrouted
path: ergogen/output
26 changes: 13 additions & 13 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ pcbdraw_style=set-black-hasl
for plate in ${plates}
do
echo "\n\n>>>>>> Processing $plate <<<<<<\n\n"
${container_cmd} run ${container_args} ghcr.io/inti-cmnb/kicad7_auto:1.6.2 kibot -b ergogen/output/pcbs/${plate}.kicad_pcb -c kibot/boards.kibot.yaml
${container_cmd} run ${container_args} ghcr.io/inti-cmnb/kicad7_auto:latest kibot -b ergogen/output/pcbs/${plate}.kicad_pcb -c kibot/boards.kibot.yaml
done

for board in ${boards}
Expand All @@ -33,17 +33,17 @@ do
${container_cmd} run ${container_args} soundmonster/kicad-automation-scripts:latest /bin/sh -c "mkdir -p $HOME/.config/kicad; cp /root/.config/kicad/* $HOME/.config/kicad"
if [ -e ergogen/output/pcbs/${board}.kicad_pcb ]; then
echo Export DSN
${container_cmd} run ${container_args} ghcr.io/inti-cmnb/kicad7_auto:1.6.2 kibot/export_dsn.py -b ergogen/output/pcbs/${board}.kicad_pcb -o ergogen/output/pcbs/${board}.dsn
fi
if [ -e ergogen/output/pcbs/${board}.dsn ]; then
echo Autoroute PCB
${container_cmd} run ${container_args} soundmonster/freerouting_cli:v0.1.0 java -jar /opt/freerouting_cli.jar -de ergogen/output/pcbs/${board}.dsn -do ergogen/output/pcbs/${board}.ses
fi
if [ -e ergogen/output/pcbs/${board}.ses ]; then
echo "Import SES"
${container_cmd} run ${container_args} soundmonster/kicad-automation-scripts:latest /usr/lib/python2.7/dist-packages/kicad-automation/pcbnew_automation/import_ses.py ergogen/output/pcbs/${board}.kicad_pcb ergogen/output/pcbs/${board}.ses --output-file ergogen/output/pcbs/${board}_routed.kicad_pcb
fi
if [ -e ergogen/output/pcbs/${board}_routed.kicad_pcb ]; then
${container_cmd} run ${container_args} ghcr.io/inti-cmnb/kicad7_auto:1.6.2 kibot -b ergogen/output/pcbs/${board}_routed.kicad_pcb -c kibot/boards.kibot.yaml
${container_cmd} run ${container_args} ghcr.io/inti-cmnb/kicad7_auto:latest kibot/export_dsn.py -b ergogen/output/pcbs/${board}.kicad_pcb -o ergogen/output/pcbs/${board}.dsn
fi
# if [ -e ergogen/output/pcbs/${board}.dsn ]; then
# echo Autoroute PCB
# ${container_cmd} run ${container_args} soundmonster/freerouting_cli:v0.1.0 java -jar /opt/freerouting_cli.jar -de ergogen/output/pcbs/${board}.dsn -do ergogen/output/pcbs/${board}.ses
# fi
# if [ -e ergogen/output/pcbs/${board}.ses ]; then
# echo "Import SES"
# ${container_cmd} run ${container_args} soundmonster/kicad-automation-scripts:latest /usr/lib/python2.7/dist-packages/kicad-automation/pcbnew_automation/import_ses.py ergogen/output/pcbs/${board}.kicad_pcb ergogen/output/pcbs/${board}.ses --output-file ergogen/output/pcbs/${board}_routed.kicad_pcb
# fi
# if [ -e ergogen/output/pcbs/${board}_routed.kicad_pcb ]; then
# ${container_cmd} run ${container_args} ghcr.io/inti-cmnb/kicad7_auto:1.6.2 kibot -b ergogen/output/pcbs/${board}_routed.kicad_pcb -c kibot/boards.kibot.yaml
# fi
done

0 comments on commit ff61f4b

Please sign in to comment.