From ff61f4bd584e48819a19083501dd5f4bff849633 Mon Sep 17 00:00:00 2001 From: Marco Massarelli Date: Sat, 30 Sep 2023 13:28:44 -0400 Subject: [PATCH] Update build workflows to use KiBot (no autoroute) --- .github/actions/export-dsn/action.yaml | 8 ++--- .github/actions/export-gerbers/action.yaml | 25 --------------- .github/actions/kibot/action.yaml | 19 ++++++++++++ .github/actions/run-drc/action.yaml | 24 --------------- .github/workflows/build.yaml | 36 +++++++++++----------- build.sh | 26 ++++++++-------- 6 files changed, 53 insertions(+), 85 deletions(-) delete mode 100644 .github/actions/export-gerbers/action.yaml create mode 100644 .github/actions/kibot/action.yaml delete mode 100644 .github/actions/run-drc/action.yaml diff --git a/.github/actions/export-dsn/action.yaml b/.github/actions/export-dsn/action.yaml index a6c7fbb..23b6071 100644 --- a/.github/actions/export-dsn/action.yaml +++ b/.github/actions/export-dsn/action.yaml @@ -2,18 +2,16 @@ 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; @@ -21,5 +19,5 @@ runs: 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 \ No newline at end of file diff --git a/.github/actions/export-gerbers/action.yaml b/.github/actions/export-gerbers/action.yaml deleted file mode 100644 index 58bb665..0000000 --- a/.github/actions/export-gerbers/action.yaml +++ /dev/null @@ -1,25 +0,0 @@ -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}/${board}.kicad_pcb - done \ No newline at end of file diff --git a/.github/actions/kibot/action.yaml b/.github/actions/kibot/action.yaml new file mode 100644 index 0000000..855de75 --- /dev/null +++ b/.github/actions/kibot/action.yaml @@ -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 \ No newline at end of file diff --git a/.github/actions/run-drc/action.yaml b/.github/actions/run-drc/action.yaml deleted file mode 100644 index e30beb1..0000000 --- a/.github/actions/run-drc/action.yaml +++ /dev/null @@ -1,24 +0,0 @@ -name: 'Run DRC' -description: 'Run Design Rules Check on generated PCB' -inputs: - boards: - description: Bboard 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 - /usr/lib/python2.7/dist-packages/kicad-automation/pcbnew_automation/run_drc.py $GITHUB_WORKSPACE/ergogen/output/pcbs/${board}_routed.kicad_pcb $GITHUB_WORKSPACE/ergogen/output/pcbs/${board}_drc/ - echo "## DRC result $board" >> "$GITHUB_STEP_SUMMARY" - echo '```' >> "$GITHUB_STEP_SUMMARY" - cat $GITHUB_WORKSPACE/ergogen/output/pcbs/${board}_drc/drc_result.rpt >> "$GITHUB_STEP_SUMMARY" - echo '```' >> "$GITHUB_STEP_SUMMARY" - done diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index a4d6073..c5c7685 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -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 + - name: Run KiBot to generate images, gerbers for the plate files + uses: ./.github/actions/kibot + with: + 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: Export Gerbers - uses: ./.github/actions/export-gerbers - 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 \ No newline at end of file diff --git a/build.sh b/build.sh index f18e59c..5a953ca 100755 --- a/build.sh +++ b/build.sh @@ -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} @@ -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 \ No newline at end of file