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
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: Bouni

---

<!-- --------Before Creating a New Issue-----------
* Limit report to a single issue.
* Search the issue tracker to verify the issue has not already been reported.
* Complete all instructions between `template markers <>.
* Keep report contents limited to the necessary information required to fix the issue.
---------Add your issue details below----------- -->

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

# KiCad Version
<!-- Copy version information (from main menu Help->About KiCad ->Copy Version Info) and paste it between the triple backticks below to preserve the formatting. -->
```
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: ''
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
11 changes: 11 additions & 0 deletions third_party/Bouni/kicad-jlcpcb-tools/.github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file

version: 2
updates:
- package-ecosystem: "github-actions" # See documentation for possible values
directory: "/" # Location of package manifests
schedule:
interval: "daily"
101 changes: 101 additions & 0 deletions third_party/Bouni/kicad-jlcpcb-tools/.github/workflows/bootstrap.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
---
name: "Bootstrap the initial component database"
on:
workflow_dispatch: # allow for manually trigger workflow
jobs:
bootstrap_database:
name: "Bootstrap component database"
runs-on: ubuntu-latest
environment: github-pages
steps:
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends \
python3 python3-pip wget zip unzip p7zip-full sqlite3
- name: Maximize build space
uses: easimon/maximize-build-space@master
with:
root-reserve-mb: 512
swap-size-mb: 1024
remove-dotnet: 'true'
- name: Free more Space, Found in https://github.com/actions/runner-images/issues/2840#issuecomment-790492173
run: |
sudo rm -rf /usr/share/dotnet
sudo rm -rf /opt/ghc
sudo rm -rf "/usr/local/share/boost"
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
- name: Checkout
uses: actions/checkout@v6
- name: Show versions
run: |
sqlite3 --version
python3 --version
python3 -c "import sqlite3; import pprint; db = sqlite3.connect(':memory:'); cursor = db.execute('PRAGMA COMPILE_OPTIONS'); pprint.pprint(cursor.fetchall())"
- name: Install python dependencies
run: |
pip install humanize
pip install -e .
- name: Update database
run: |
set -x

# Print the current disk usage, might help with future "no disk space left" issues
echo "============================================================================================================================="
df -h
echo "============================================================================================================================="

cd db_build

mkdir db_working
cd db_working
wget -q https://yaqwsx.github.io/jlcparts/data/cache.zip
for seq in $(seq -w 01 30); do
wget -q https://yaqwsx.github.io/jlcparts/data/cache.z$seq || true
done
7z x cache.zip
for seq in $(seq -w 01 30); do
rm cache.z$seq || true
done

cd ..

python3 jlcparts_db_convert.py --skip-generate --fix-components-db-descriptions --clean-components-db --archive-components-db

ls -lah db_working/

rm db_working/cache.sqlite3

# Print the current disk usage, might help with future "no disk space left" issues
echo "============================================================================================================================="
df -h
echo "============================================================================================================================="

- name: Upload pages artifact
uses: actions/upload-pages-artifact@v4
with:
name: github-pages
path: db_build/archive
deploy:
name: "Deploy"
runs-on: ubuntu-latest
needs: bootstrap_database
permissions:
actions: write
contents: write
pages: write
id-token: write
# Deploy to the github-pages environment
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
if: github.ref == 'refs/heads/main'
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v5
# delete-artifact
- name: Clean
uses: geekyeggo/delete-artifact@v6
with:
name: github-pages
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
---
# This is a workflow to generate the zip file and metadata.json for KiCAD PCM
# https://gitlab.com/kicad/addons/metadata/-/merge_requests/14

name: KiCAD PCM packaging
on: # yamllint disable-line rule:truthy
release:
branches: [main]
types:
- published
workflow_dispatch:

jobs:
create_archive:
runs-on: ubuntu-latest
steps:
- name: Get latest tag
uses: oprypin/find-latest-tag@v1
with:
repository: Bouni/kicad-jlcpcb-tools
releases-only: true
id: latest-release

- name: Checkout repo
uses: actions/checkout@v6

- name: Create archive
run: sh ./PCM/create_pcm_archive.sh ${{ steps.latest-release.outputs.tag }}

- name: Upload zip as asset to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ./PCM/KiCAD-PCM-${{ steps.latest-release.outputs.tag }}.zip
asset_name: KiCAD-PCM-${{ steps.latest-release.outputs.tag }}.zip
overwrite: true
tag: ${{ steps.latest-release.outputs.tag }}

- name: Trigger custom kicad repo rebuild
uses: benc-uk/workflow-dispatch@v1
with:
workflow: Rebuild repository
ref: refs/heads/main
repo: Bouni/bouni-kicad-repository
token: ${{ secrets.PERSONAL_TOKEN }}
inputs: '{ "VERSION": "${{env.VERSION}}", "DOWNLOAD_SHA256": "${{env.DOWNLOAD_SHA256}}", "DOWNLOAD_SIZE": "${{env.DOWNLOAD_SIZE}}", "DOWNLOAD_URL": "${{env.DOWNLOAD_URL}}", "INSTALL_SIZE": "${{env.INSTALL_SIZE}}" }'
43 changes: 43 additions & 0 deletions third_party/Bouni/kicad-jlcpcb-tools/.github/workflows/linter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
---
name: Lint and format everything
on: # yamllint disable-line rule:truthy
push:
branches:
- main
pull_request:
jobs:
markdownlint:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Setup NodeJS
uses: actions/setup-node@v6
- name: Install markdownlint
run: npm install -g markdownlint-cli
- name: Run markdownlint
run: markdownlint "**/*.md"
ruff:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Check code with ruff
uses: chartboost/ruff-action@v1
with:
version: 0.11.4
args: check
src: "."
deadcode:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v6
with:
python-version: "3.11"
- name: Install deadcode
run: pip install deadcode
- name: Run deadcode
run: deadcode .
23 changes: 23 additions & 0 deletions third_party/Bouni/kicad-jlcpcb-tools/.github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
name: Tests
on: # yamllint disable-line rule:truthy
push:
branches:
- main
pull_request:
jobs:
tests:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Install pytest
run: pip install pytest
- name: Install python packages
run: pip install .
- name: Run core tests
working-directory: core
run: pytest version.py
- name: Run common tests
working-directory: common
run: pytest
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
---
name: "Update parts database"
on:
schedule:
- cron: "0 5 * * *"
workflow_dispatch: # allow for manually trigger workflow
jobs:
build_and_update:
name: "Update component database and frontend"
runs-on: ubuntu-latest
environment: github-pages
steps:
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends \
python3 python3-pip wget zip unzip p7zip-full sqlite3
- name: Maximize build space
uses: easimon/maximize-build-space@master
with:
root-reserve-mb: 512
swap-size-mb: 1024
remove-dotnet: 'true'
- name: Free more Space, Found in https://github.com/actions/runner-images/issues/2840#issuecomment-790492173
run: |
sudo rm -rf /usr/share/dotnet
sudo rm -rf /opt/ghc
sudo rm -rf "/usr/local/share/boost"
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
- name: Checkout
uses: actions/checkout@v6
- name: Show versions
run: |
sqlite3 --version
python3 --version
python3 -c "import sqlite3; import pprint; db = sqlite3.connect(':memory:'); cursor = db.execute('PRAGMA COMPILE_OPTIONS'); pprint.pprint(cursor.fetchall())"
- name: Install python dependencies
run: |
pip install humanize
pip install -e .
- name: Update database
run: |
set -x

# Print the current disk usage, might help with future "no disk space left" issues
echo "============================================================================================================================="
df -h
echo "============================================================================================================================="

cd db_build

# fetch the cached database
python3 jlcparts_db_convert.py \
--fetch-components-db \
--update-components-db \
--clean-components-db \
--components-db-base-url=http://z2amiller.github.io/kicad-jlcpcb-tools \
--archive-components-db \
--obsolete-parts-threshold-days=365

# remove the raw source db, as we don't want to package that one
rm db_working/cache.sqlite3
# some info output for sanity check
ls -lah db_working
du -cslh db_working

# Print the current disk usage, might help with future "no disk space left" issues
echo "============================================================================================================================="
df -h
echo "============================================================================================================================="

- name: Upload all-item parts db
uses: actions/upload-pages-artifact@v4
with:
name: github-pages
path: db_build/archive
deploy:
name: "Deploy"
runs-on: ubuntu-latest
needs: build_and_update
permissions:
actions: write
contents: write
pages: write
id-token: write
# Deploy to the github-pages environment
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
if: github.ref == 'refs/heads/main'
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v5
# delete-artifact
- name: Clean
uses: geekyeggo/delete-artifact@v6
with:
name: github-pages
Loading