Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions .github/workflows/class-keys.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# The BOM resolver reads the class keys from library/class-keys.json; the key tables in
# docs/part-library-standard.md are the human-readable copy. Fail when the two disagree.
name: Class keys

on:
push:
branches: [master]
paths: ["docs/part-library-standard.md", "library/class-keys.json", "tools/manufacturing.py",
".github/workflows/class-keys.yml"]
pull_request:
paths: ["docs/part-library-standard.md", "library/class-keys.json", "tools/manufacturing.py",
".github/workflows/class-keys.yml"]

permissions:
contents: read

jobs:
class-keys:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- run: python3 tools/manufacturing.py check-class-keys
45 changes: 45 additions & 0 deletions .github/workflows/erc-drc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# ERC and DRC of the KiCad projects a pull request adds: every folder whose .kicad_pro file is new
# in the pull request is checked with check-erc-drc.sh. Projects that already exist on the base
# branch are not checked.
name: ERC and DRC

on:
pull_request:
paths: ["**.kicad_pro", "**.kicad_sch", "**.kicad_pcb", "check-erc-drc.sh", ".github/workflows/erc-drc.yml"]

permissions:
contents: read

jobs:
find:
runs-on: ubuntu-latest
outputs:
projects: ${{ steps.find.outputs.projects }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- id: find
env:
BASE: ${{ github.event.pull_request.base.sha }}
run: |
projects=$(git diff --name-only --diff-filter=A "$BASE"...HEAD -- '*.kicad_pro' \
| xargs -r -n1 dirname | sort -u | jq -R . | jq -cs .)
echo "New KiCad projects: $projects"
echo "projects=$projects" >> "$GITHUB_OUTPUT"

check:
needs: find
if: needs.find.outputs.projects != '[]'
runs-on: ubuntu-latest
container:
image: kicad/kicad:10.0
options: --user root
strategy:
fail-fast: false
matrix:
project: ${{ fromJSON(needs.find.outputs.projects) }}
name: ${{ matrix.project }}
steps:
- uses: actions/checkout@v4
- run: ./check-erc-drc.sh --project="${{ matrix.project }}"
25 changes: 25 additions & 0 deletions .github/workflows/ruff.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Lint and format check of the Python tools with ruff, configured in ruff.toml.
name: Ruff

on:
push:
branches: [master]
paths: ["**.py", "ruff.toml", ".github/workflows/ruff.yml"]
pull_request:
paths: ["**.py", "ruff.toml", ".github/workflows/ruff.yml"]

permissions:
contents: read

jobs:
ruff:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
# Same version as the local .venv, so CI and local runs agree.
- run: pip install ruff==0.17.6
- run: ruff check --output-format=github tools
- run: ruff format --check --diff tools
32 changes: 32 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# KiCad lock files
*.lck

# KiCad backups
*-backups/
*.bak
*.bck
*-bak
*.kicad_pcb-bak
*.kicad_sch-bak
*.sch-bak
*~

# KiCad autosave files
_autosave-*
\#auto_saved_files\#

# KiCad local history
.history/

# KiCad caches
fp-info-cache
*.kicad_prl

# Legacy KiCad temporary files
*.000
*.$$$

# Python
.venv/
__pycache__/
*.pyc
Loading
Loading