feat: add initial config for backplane #1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on: | |
push: | |
paths: | |
- '**.kicad_pcb' | |
pull_request: | |
paths: | |
- '**.kicad_pcb' | |
name: KiCad Export | |
jobs: | |
get-changed-files: | |
name: Get changed files | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.head_ref }} | |
fetch-depth: 0 | |
- name: Get changed PCB files | |
id: changed-files | |
uses: tj-actions/changed-files@v44 | |
with: | |
files: | | |
**/*.kicad_pcb | |
matrix: true | |
outputs: | |
any-changed: ${{ steps.changed-files.outputs.any_changed }} | |
matrix: ${{ steps.changed-files.outputs.all_changed_files }} | |
export: | |
if: ${{ fromJson(needs.get-changed-files.outputs.any-changed) }} | |
needs: get-changed-files | |
name: Render PCB | |
runs-on: ubuntu-latest | |
container: ghcr.io/inti-cmnb/kicad8_auto:1.7.0 | |
strategy: | |
matrix: | |
files: ${{ fromJSON(needs.get-changed-files.outputs.matrix) }} | |
max-parallel: 4 | |
fail-fast: false | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.head_ref }} | |
fetch-depth: 0 | |
- name: Cache 3D models data | |
id: models-cache | |
uses: set-soft/cache@main | |
with: | |
path: ~/cache_3d | |
key: cache_3d | |
- name: Get output directories | |
id: get-paths | |
run: | | |
# Get the directory of the PCB file | |
KICAD_DIR="$(dirname "${{ matrix.files }}")" | |
echo "kicad-dir=$KICAD_DIR" >> "$GITHUB_OUTPUT" | |
# Get the parent project directory | |
PROJECT_DIR="$(dirname "${KICAD_DIR}")" | |
echo "project-dir=$PROJECT_DIR" >> "$GITHUB_OUTPUT" | |
- name: Run KiBot | |
uses: INTI-CMNB/KiBot@v2_k8 | |
with: | |
board: ${{ matrix.files }} | |
config: ./${{ steps.get-paths.outputs.kicad-dir }}/cad.kibot.yaml | |
dir: ${{ steps.get-paths.outputs.project-dir }}/CAD/ | |
cache3D: YES | |
verbose: 4 | |
- name: Clean up log files | |
run: | | |
rm -fv ${{ steps.get-paths.outputs.project-dir }}/CAD/*.log | |
- name: Commit changes | |
uses: EndBug/add-and-commit@v9 | |
with: | |
add: ${{ steps.get-paths.outputs.project-dir }}/CAD/ | |
default_author: github_actor | |
message: "chore: KiBot CAD update" |