Rev 2 of PCB design #47
This file contains hidden or 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
name: KiCad CI | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
workflow_dispatch: | |
jobs: | |
drc: | |
name: Check PCB DRC | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup APT repositories | |
run: | | |
sudo add-apt-repository --yes ppa:kicad/kicad-9.0-releases | |
sudo apt update | |
- uses: awalsh128/cache-apt-pkgs-action@latest | |
with: | |
packages: kicad kicad-demos kicad-doc-en kicad-footprints kicad-libraries kicad-packages3d kicad-symbols poppler-utils | |
version: 1.0 | |
execute_install_scripts: true | |
- name: Run DRC | |
run: | | |
kicad-cli pcb drc --output=drc.rpt --exit-code-violations --severity-error tuxkeychain.kicad_pcb | |
status=$? | |
if [ $status -ne 0 ]; then | |
echo "DRC failed with exit code $status" | |
exit $status | |
fi | |
- name: Cat DRC Report | |
if: always() | |
run: | | |
if [ -f drc.rpt ]; then | |
cat drc.rpt | |
else | |
echo "DRC report not found" | |
fi | |
- name: Upload DRC Report | |
uses: actions/upload-artifact@v4 | |
if: always() | |
with: | |
name: drc-report | |
path: drc.rpt | |
erc: | |
name: Check Schematic ERC | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup APT repositories | |
run: | | |
sudo add-apt-repository --yes ppa:kicad/kicad-9.0-releases | |
sudo apt update | |
- uses: awalsh128/cache-apt-pkgs-action@latest | |
with: | |
packages: kicad kicad-demos kicad-doc-en kicad-footprints kicad-libraries kicad-packages3d kicad-symbols poppler-utils | |
version: 1.0 | |
execute_install_scripts: true | |
- name: Attempt to fix install issues | |
run: | | |
sudo apt install -y --no-install-recommends kicad-packages3d | |
- name: Run ERC | |
run: | | |
kicad-cli sch erc --output=erc.rpt --exit-code-violations --severity-error tuxkeychain.kicad_sch | |
status=$? | |
if [ $status -ne 0 ]; then | |
echo "ERC failed with exit code $status" | |
exit $status | |
fi | |
- name: Cat ERC Report | |
if: always() | |
run: | | |
if [ -f erc.rpt ]; then | |
cat erc.rpt | |
else | |
echo "ERC report not found" | |
fi | |
- name: Upload ERC Report | |
uses: actions/upload-artifact@v4 | |
if: always() | |
with: | |
name: erc-report | |
path: erc.rpt | |
pdf: | |
name: Generate PDFs | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install KiCad 9.0 | |
run: | | |
sudo add-apt-repository --yes ppa:kicad/kicad-9.0-releases | |
sudo apt update | |
sudo apt install --install-recommends kicad | |
- name: Generate PDFs | |
run: | | |
kicad-cli pcb export pdf --output=pcb.pdf --layers=F.Cu,In1.Cu,In2.Cu,B.Cu,Edge.Cuts,F.Silkscreen,B.Silkscreen tuxkeychain.kicad_pcb | |
kicad-cli sch export pdf --output=schematic.pdf tuxkeychain.kicad_sch | |
- name: Upload PDFs | |
uses: actions/upload-artifact@v4 | |
with: | |
name: pdfs | |
path: | | |
pcb.pdf | |
schematic.pdf |