Skip to content

Commit

Permalink
chore: workflow for schematic changes (fossasia#122)
Browse files Browse the repository at this point in the history
  • Loading branch information
CloudyPadmal authored May 30, 2021
1 parent 450d977 commit 611ec14
Show file tree
Hide file tree
Showing 22 changed files with 31,290 additions and 33,293 deletions.
25 changes: 22 additions & 3 deletions .github/workflows/hardware-ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: PSLab-Hardware
name: pslab-hardware

on:
push:
Expand Down Expand Up @@ -31,12 +31,12 @@ jobs:
wget https://github.com/INTI-CMNB/InteractiveHtmlBom/releases/download/v2.3.4-2/interactivehtmlbom.inti-cmnb_2.3.4-2_all.deb
sudo dpkg -i interactivehtmlbom.inti-cmnb_2.3.4-2_all.deb
pip install pcb-tools image
sudo apt install xvfb recordmydesktop xdotool libmagickwand-dev librsvg2-bin imagemagick
sudo apt install xvfb recordmydesktop xdotool libmagickwand-dev librsvg2-bin imagemagick poppler-utils
- name: Run build
run: |
cd schematics
kibot -vv
kibot -v
- name: Publish PDF schematic
uses: actions/upload-artifact@v2
Expand Down Expand Up @@ -88,10 +88,29 @@ jobs:
composite -stereo 0 old-bottom.png new-bottom.png diff-bottom.png
composite -stereo 0 old-signal.png new-signal.png diff-signal.png
composite -stereo 0 old-power.png new-power.png diff-power.png
mv PSLab.pdf old-PSLab.pdf
cp ../docs/schematics/PSLab.pdf .
pdftoppm old-PSLab.pdf old-PSLab -png -rx 300 -ry 300
pdftoppm PSLab.pdf new-PSLab -png -rx 300 -ry 300
convert -colorspace gray old-PSLab-1.png old-PSLab.png
convert -colorspace gray new-PSLab-1.png new-PSLab.png
composite -stereo 0 old-PSLab.png new-PSLab.png diff-schematic.png
rm -rf old-* new-*
git checkout --orphan temporary
git add .
git commit -m "chore: updating board diff images"
git branch -D diff-img
git branch -m diff-img
git push origin diff-img -f --quiet > /dev/null
- name: Electric Rule Check
uses: actions/upload-artifact@v2
with:
name: electric-rule-check
path: schematics/PSLab-erc.txt

- name: Design Rule Check
uses: actions/upload-artifact@v2
with:
name: design-rule-check
path: schematics/PSLab-drc.txt
131 changes: 131 additions & 0 deletions .github/workflows/pullrequest-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
name: pull-request-builds

on:
pull_request:
branches: [ pslab-v6 ]
paths:
- '**.sch'
- '**.kicad_pcb'
- '**.kicad_mod'
- '**.lib'
- '**.pro'

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Download project files
uses: actions/checkout@v2

- name: Install KiCAD
run: |
sudo add-apt-repository --yes ppa:kicad/kicad-5.1-releases
sudo apt update
sudo apt install --install-recommends kicad -y -qq
- name: Copy configuration files
run: |
cd ~/.config
mkdir kicad
cd kicad
wget https://gist.githubusercontent.com/CloudyPadmal/dad9975e02bf39d6a3d2851ca53981cc/raw/0f342a3bba82b1af9789be689e5c00b4ad914015/kicad_common
- name: Install dependencies
run: |
pip install --no-compile kibot
wget https://github.com/INTI-CMNB/InteractiveHtmlBom/releases/download/v2.3.4-2/interactivehtmlbom.inti-cmnb_2.3.4-2_all.deb
sudo dpkg -i interactivehtmlbom.inti-cmnb_2.3.4-2_all.deb
pip install pcb-tools image
sudo apt install xvfb recordmydesktop xdotool libmagickwand-dev librsvg2-bin imagemagick poppler-utils
- name: Run build
run: |
cd schematics
kibot -v
- name: Publish PDF schematic
uses: actions/upload-artifact@v2
with:
name: schematic-pdf
path: docs/schematics/PSLab.pdf

- name: Publish interactive bill of materials
uses: actions/upload-artifact@v2
with:
name: interactive-bom
path: docs/components/InteractiveBoM.html

- name: Publish bill of materials
uses: actions/upload-artifact@v2
with:
name: bill-of-materials
path: docs/components/BillOfMaterials.csv

- name: Publish gerbers
uses: actions/upload-artifact@v2
with:
name: gerbers
path: output/Gerber/

- name: Publish centroids
uses: actions/upload-artifact@v2
with:
name: pick-and-place
path: docs/position_files/PositionFile.csv

- name: Setup board diff images
run: |
git config --global user.email "[email protected]"
git config --global user.name "PSLab"
python scripts/pslab_gerber_generator.py
git clone --quiet --branch=diff-img https://$GITHUB_ACTOR:${{ secrets.GITHUB_TOKEN }}@github.com/$GITHUB_REPOSITORY diff-img > /dev/null
cd diff-img
convert -colorspace gray front-layer.png old-front.png
convert -colorspace gray bottom-layer.png old-bottom.png
convert -colorspace gray signal-layer.png old-signal.png
convert -colorspace gray power-layer.png old-power.png
mv ../output/Images/* .
convert -colorspace gray front-layer.png new-front.png
convert -colorspace gray bottom-layer.png new-bottom.png
convert -colorspace gray signal-layer.png new-signal.png
convert -colorspace gray power-layer.png new-power.png
composite -stereo 0 old-front.png new-front.png diff-front.png
composite -stereo 0 old-bottom.png new-bottom.png diff-bottom.png
composite -stereo 0 old-signal.png new-signal.png diff-signal.png
composite -stereo 0 old-power.png new-power.png diff-power.png
mv PSLab.pdf old-PSLab.pdf
cp ../docs/schematics/PSLab.pdf .
pdftoppm old-PSLab.pdf old-PSLab -png -rx 300 -ry 300
pdftoppm PSLab.pdf new-PSLab -png -rx 300 -ry 300
convert -colorspace gray old-PSLab-1.png old-PSLab.png
convert -colorspace gray new-PSLab-1.png new-PSLab.png
composite -stereo 0 old-PSLab.png new-PSLab.png diff-schematic.png
rm -rf old-* new-*
git add .
git commit -m "chore: updating board diff images for #${{ github.event.number }}"
git push origin diff-img --quiet > /dev/null
- name: Pull request comment
uses: actions/github-script@v4
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
github.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: '👋 Thanks for sharing!'
})
- name: Electric Rule Check
uses: actions/upload-artifact@v2
with:
name: electric-rule-check
path: schematics/PSLab-erc.txt

- name: Design Rule Check
uses: actions/upload-artifact@v2
with:
name: design-rule-check
path: schematics/PSLab-drc.txt
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ _autosave-*
*.pro-bak
fp-info-cache
*erc.txt
*drc.txt

# Netlist files (exported from Eeschema)
*.net
Expand All @@ -29,3 +30,4 @@ fp-info-cache

# IDE specifics
*.DS_Store
*.ogv
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# pslab-hardware

[![PSLab-Hardware](https://github.com/CloudyPadmal/pslab-hardware/actions/workflows/hardware-ci.yml/badge.svg)](https://github.com/CloudyPadmal/pslab-hardware/actions/workflows/hardware-ci.yml)
[![PSLab-Hardware](https://github.com/fossasia/pslab-hardware/actions/workflows/hardware-ci.yml/badge.svg)](https://github.com/fossasia/pslab-hardware/actions/workflows/hardware-ci.yml)
[![Gitter](https://badges.gitter.im/fossasia/pslab.svg)](https://gitter.im/fossasia/pslab?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
[![Twitter Follow](https://img.shields.io/twitter/follow/pslabio.svg?style=social&label=Follow&maxAge=2592000?style=flat-square)](https://twitter.com/pslabio)

Expand Down
2 changes: 1 addition & 1 deletion docs/components/InteractiveBoM.html

Large diffs are not rendered by default.

30 changes: 15 additions & 15 deletions docs/position_files/PositionFile.csv
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Ref,Val,Package,PosX,PosY,Rot,Side
"BT1","CR1225","BatteryHolder_LINX_BAT-HLD-012-SMT",176.3475,-106.8490,0.0000,top
"BT1","CR1225","BatteryHolder_LINX_BAT-HLD-012-SMT",176.0935,-106.2140,0.0000,top
"C1","0.1uF","C_0603_1608Metric",149.2330,-103.8645,0.0000,top
"C2","0.1uF","C_0603_1608Metric",92.2100,-82.1475,270.0000,top
"C3","0.1uF","C_0603_1608Metric",131.8975,-72.3050,0.0000,top
Expand Down Expand Up @@ -54,21 +54,21 @@ Ref,Val,Package,PosX,PosY,Rot,Side
"D5","WS2812B","LED_WS2812B_PLCC4_5.0x5.0mm_P3.2mm",115.1100,-82.7400,0.0000,top
"D6","LL4148","D_MiniMELF",120.7000,-88.5600,270.0000,top
"F1","1A","Fuse_1206_3216Metric",99.0400,-67.4400,90.0000,top
"FID1","Fiducial","Fiducial_0.5mm_Mask1.5mm",92.9085,-106.9125,0.0000,top
"FID2","Fiducial","Fiducial_0.5mm_Mask1.5mm",187.0000,-106.0000,0.0000,top
"FID3","Fiducial","Fiducial_0.5mm_Mask1.5mm",187.0000,-63.0000,0.0000,top
"J1","DoublePins","PinSocket_2x14_P2.54mm_Vertical",-184.7295,-68.7490,180.0000,bottom
"J2","Power Pins","PinSocket_1x08_P2.54mm_Vertical",174.1250,-62.5895,270.0000,top
"J3","Wave Generator","PinSocket_1x08_P2.54mm_Vertical",148.5980,-111.2305,90.0000,top
"J4","I2C","PinSocket_1x04_P2.54mm_Vertical",131.4300,-62.7500,90.0000,top
"J5","I2C","PinSocket_1x04_P2.54mm_Vertical",143.8500,-62.7500,90.0000,top
"J6","ESP01","ESP-01",94.6934,-104.5462,90.0000,top
"J7","UART","PinSocket_1x04_P2.54mm_Vertical",133.5808,-111.0740,90.0000,top
"J9","SPI","PinSocket_1x06_P2.54mm_Vertical",126.6300,-62.7500,270.0000,top
"J11","Li-Ion Battery","JST_EH_B2B-EH-A_1x02_P2.50mm_Vertical",95.9565,-109.7700,0.0000,top
"FID1","Fiducial","Fiducial_0.5mm_Mask1.5mm",94.0000,-107.2500,0.0000,top
"FID2","Fiducial","Fiducial_0.5mm_Mask1.5mm",188.0000,-106.0000,0.0000,top
"FID3","Fiducial","Fiducial_0.5mm_Mask1.5mm",188.0000,-62.4000,0.0000,top
"J1","DoublePins","PinSocket_2x14_P2.54mm_Vertical",187.4600,-67.8600,0.0000,top
"J2","Power Pins","PinSocket_1x08_P2.54mm_Vertical",156.9800,-62.7800,90.0000,top
"J3","Wave Generator","PinSocket_1x08_P2.54mm_Vertical",149.3600,-111.0400,90.0000,top
"J4","I2C","PinSocket_1x04_P2.54mm_Vertical",131.5800,-62.7800,90.0000,top
"J5","I2C","PinSocket_1x04_P2.54mm_Vertical",144.2800,-62.7800,90.0000,top
"J6","ESP01","ESP-01",94.3690,-104.7535,90.0000,top
"J7","UART","PinSocket_1x04_P2.54mm_Vertical",136.6600,-111.0740,90.0000,top
"J9","SPI","PinSocket_1x06_P2.54mm_Vertical",113.8000,-62.7800,90.0000,top
"J11","Li-Ion Battery","JST_EH_B2B-EH-A_1x02_P2.50mm_Vertical",94.7500,-110.2145,0.0000,top
"L1","10uH","L_0603_1608Metric",143.0700,-82.2700,90.0000,top
"L2","2.2uH","L_Coilcraft_XAL5030",111.2600,-110.2780,90.0000,top
"P1","SDCard","microSD_HC_Hirose_DM3AT-SF-PEJM5",99.3300,-91.9000,270.0000,top
"P1","SDCard","microSD_HC_Hirose_DM3AT-SF-PEJM5",99.3220,-92.3710,270.0000,top
"Q1","MMBT3906","SOT-23",175.5600,-74.8100,0.0000,top
"Q2","MMBT3904","SOT-23",120.7000,-77.0000,180.0000,top
"Q3","MMBT3906","SOT-23",135.4800,-66.4800,180.0000,top
Expand Down Expand Up @@ -141,7 +141,7 @@ Ref,Val,Package,PosX,PosY,Rot,Side
"R66","60.4K","R_0603_1608Metric",123.5790,-95.2885,0.0000,top
"SW1","BOOT","SW_SPST_B3U-1000P",127.6430,-96.4350,0.0000,top
"SW2","MCLR Reset","SW_SPST_B3U-1000P",128.3415,-78.7185,270.0000,top
"SW3","USB_C - Generic","USB_C_Receptacle_XKB_U262-16XN-4BVC11",92.8400,-74.8500,270.0000,top
"SW3","USB_C - Generic","USB_C_Receptacle_XKB_U262-16XN-4BVC11",92.8400,-75.4800,270.0000,top
"U1","LDFM33PUR","DFN-6-1EP_3x3mm_P0.95mm_EP1.7x2.6mm",97.3500,-63.2600,180.0000,top
"U2","74HC126","SOIC-14_3.9x8.7mm_P1.27mm",134.6280,-103.0390,0.0000,top
"U3","PIC24EP256GP204","TQFP-44_10x10mm_P0.8mm",137.9935,-90.2755,90.0000,top
Expand Down
Binary file modified docs/schematics/PSLab.pdf
Binary file not shown.
Loading

0 comments on commit 611ec14

Please sign in to comment.