Add autorouting to GitHub build workflow

This commit is contained in:
Marco Massarelli 2023-05-05 20:18:46 -04:00
parent 071f716d60
commit 8cccf33fc8
5 changed files with 107 additions and 2 deletions

18
.github/actions/autoroute/action.yaml vendored Normal file
View File

@ -0,0 +1,18 @@
name: 'Autoroute'
description: 'Autoroute a given DSN file to SES with FreeRouting'
inputs:
boards:
description: 'Specctra SES output file'
required: true
runs:
using: 'docker'
image: 'docker://soundmonster/freerouting_cli:v0.1.0'
entrypoint: '/bin/sh'
args:
- '-c'
- |
for board in ${{ inputs.boards }};
do
echo Processing $board
java -jar /opt/freerouting_cli.jar -de ergogen/output/pcbs/${board}.dsn -do ergogen/output/pcbs/${board}.ses
done

21
.github/actions/export-dsn/action.yaml vendored Normal file
View File

@ -0,0 +1,21 @@
name: 'Export DSN'
description: 'Export Specctra DSN from a Kicad PCB'
inputs:
boards:
description: 'Board names'
required: true
runs:
using: 'docker'
image: 'docker://soundmonster/kicad-automation-scripts: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
/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
done

View File

@ -0,0 +1,25 @@
name: 'Export Gerbers'
description: 'Export Gerber files from a Kicad PCB'
inputs:
boards:
description: 'Board name'
required: true
fab:
description: 'Fabrication profile'
default: 'jlcpcb'
flags:
description: 'Additional flags for kikit fab'
default: '--no-assembly'
runs:
using: 'docker'
image: 'docker://yaqwsx/kikit:v0.7'
entrypoint: '/bin/sh'
args:
- '-c'
- |
for board in ${{ inputs.boards }};
do
echo Processing $board
mkdir -p $GITHUB_WORKSPACE/ergogen/output/gerbers/${board} ;
kikit fab ${{ inputs.fab }} ${{ inputs.flags }} $GITHUB_WORKSPACE/ergogen/output/pcbs/${board}_routed.kicad_pcb $GITHUB_WORKSPACE/ergogen/output/gerbers/${board}
done

21
.github/actions/import-ses/action.yaml vendored Normal file
View File

@ -0,0 +1,21 @@
name: 'Import SES to Kicad'
description: 'Import Specctra SES into a Kicad PCB'
inputs:
boards:
description: 'Board name'
required: true
runs:
using: 'docker'
image: 'docker://soundmonster/kicad-automation-scripts: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
/usr/lib/python2.7/dist-packages/kicad-automation/pcbnew_automation/import_ses.py $GITHUB_WORKSPACE/ergogen/output/pcbs/${board}.kicad_pcb $GITHUB_WORKSPACE/output/pcbs/${board}.ses --output-file $GITHUB_WORKSPACE/output/pcbs/${board}_routed.kicad_pcb;
done

View File

@ -21,8 +21,28 @@ jobs:
run: npm install
- name: Generate unrouted PCBs with Ergogen (definition in package.json)
run: npm run gen
- 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
with:
boards: corney_island
- name: DRC check
uses: ./.github/actions/run-drc
with:
boards: corney_island
- name: Export Gerbers
uses: ./.github/actions/export-gerbers
with:
boards: corney_island
- name: Persist output
uses: actions/upload-artifact@v3
with:
name: unrouted-pcb
path: ergogen/output/pcbs
name: corney_island
path: ergogen/output