Skip to content

Commit 611ec14

Browse files
authored
chore: workflow for schematic changes (#122)
1 parent 450d977 commit 611ec14

22 files changed

Lines changed: 31290 additions & 33293 deletions

.github/workflows/hardware-ci.yml

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: PSLab-Hardware
1+
name: pslab-hardware
22

33
on:
44
push:
@@ -31,12 +31,12 @@ jobs:
3131
wget https://github.com/INTI-CMNB/InteractiveHtmlBom/releases/download/v2.3.4-2/interactivehtmlbom.inti-cmnb_2.3.4-2_all.deb
3232
sudo dpkg -i interactivehtmlbom.inti-cmnb_2.3.4-2_all.deb
3333
pip install pcb-tools image
34-
sudo apt install xvfb recordmydesktop xdotool libmagickwand-dev librsvg2-bin imagemagick
34+
sudo apt install xvfb recordmydesktop xdotool libmagickwand-dev librsvg2-bin imagemagick poppler-utils
3535
3636
- name: Run build
3737
run: |
3838
cd schematics
39-
kibot -vv
39+
kibot -v
4040
4141
- name: Publish PDF schematic
4242
uses: actions/upload-artifact@v2
@@ -88,10 +88,29 @@ jobs:
8888
composite -stereo 0 old-bottom.png new-bottom.png diff-bottom.png
8989
composite -stereo 0 old-signal.png new-signal.png diff-signal.png
9090
composite -stereo 0 old-power.png new-power.png diff-power.png
91+
mv PSLab.pdf old-PSLab.pdf
92+
cp ../docs/schematics/PSLab.pdf .
93+
pdftoppm old-PSLab.pdf old-PSLab -png -rx 300 -ry 300
94+
pdftoppm PSLab.pdf new-PSLab -png -rx 300 -ry 300
95+
convert -colorspace gray old-PSLab-1.png old-PSLab.png
96+
convert -colorspace gray new-PSLab-1.png new-PSLab.png
97+
composite -stereo 0 old-PSLab.png new-PSLab.png diff-schematic.png
9198
rm -rf old-* new-*
9299
git checkout --orphan temporary
93100
git add .
94101
git commit -m "chore: updating board diff images"
95102
git branch -D diff-img
96103
git branch -m diff-img
97104
git push origin diff-img -f --quiet > /dev/null
105+
106+
- name: Electric Rule Check
107+
uses: actions/upload-artifact@v2
108+
with:
109+
name: electric-rule-check
110+
path: schematics/PSLab-erc.txt
111+
112+
- name: Design Rule Check
113+
uses: actions/upload-artifact@v2
114+
with:
115+
name: design-rule-check
116+
path: schematics/PSLab-drc.txt
Lines changed: 131 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,131 @@
1+
name: pull-request-builds
2+
3+
on:
4+
pull_request:
5+
branches: [ pslab-v6 ]
6+
paths:
7+
- '**.sch'
8+
- '**.kicad_pcb'
9+
- '**.kicad_mod'
10+
- '**.lib'
11+
- '**.pro'
12+
13+
jobs:
14+
build:
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- name: Download project files
19+
uses: actions/checkout@v2
20+
21+
- name: Install KiCAD
22+
run: |
23+
sudo add-apt-repository --yes ppa:kicad/kicad-5.1-releases
24+
sudo apt update
25+
sudo apt install --install-recommends kicad -y -qq
26+
27+
- name: Copy configuration files
28+
run: |
29+
cd ~/.config
30+
mkdir kicad
31+
cd kicad
32+
wget https://gist.githubusercontent.com/CloudyPadmal/dad9975e02bf39d6a3d2851ca53981cc/raw/0f342a3bba82b1af9789be689e5c00b4ad914015/kicad_common
33+
34+
- name: Install dependencies
35+
run: |
36+
pip install --no-compile kibot
37+
wget https://github.com/INTI-CMNB/InteractiveHtmlBom/releases/download/v2.3.4-2/interactivehtmlbom.inti-cmnb_2.3.4-2_all.deb
38+
sudo dpkg -i interactivehtmlbom.inti-cmnb_2.3.4-2_all.deb
39+
pip install pcb-tools image
40+
sudo apt install xvfb recordmydesktop xdotool libmagickwand-dev librsvg2-bin imagemagick poppler-utils
41+
42+
- name: Run build
43+
run: |
44+
cd schematics
45+
kibot -v
46+
47+
- name: Publish PDF schematic
48+
uses: actions/upload-artifact@v2
49+
with:
50+
name: schematic-pdf
51+
path: docs/schematics/PSLab.pdf
52+
53+
- name: Publish interactive bill of materials
54+
uses: actions/upload-artifact@v2
55+
with:
56+
name: interactive-bom
57+
path: docs/components/InteractiveBoM.html
58+
59+
- name: Publish bill of materials
60+
uses: actions/upload-artifact@v2
61+
with:
62+
name: bill-of-materials
63+
path: docs/components/BillOfMaterials.csv
64+
65+
- name: Publish gerbers
66+
uses: actions/upload-artifact@v2
67+
with:
68+
name: gerbers
69+
path: output/Gerber/
70+
71+
- name: Publish centroids
72+
uses: actions/upload-artifact@v2
73+
with:
74+
name: pick-and-place
75+
path: docs/position_files/PositionFile.csv
76+
77+
- name: Setup board diff images
78+
run: |
79+
git config --global user.email "noreply@pslab.io"
80+
git config --global user.name "PSLab"
81+
python scripts/pslab_gerber_generator.py
82+
git clone --quiet --branch=diff-img https://$GITHUB_ACTOR:${{ secrets.GITHUB_TOKEN }}@github.com/$GITHUB_REPOSITORY diff-img > /dev/null
83+
cd diff-img
84+
convert -colorspace gray front-layer.png old-front.png
85+
convert -colorspace gray bottom-layer.png old-bottom.png
86+
convert -colorspace gray signal-layer.png old-signal.png
87+
convert -colorspace gray power-layer.png old-power.png
88+
mv ../output/Images/* .
89+
convert -colorspace gray front-layer.png new-front.png
90+
convert -colorspace gray bottom-layer.png new-bottom.png
91+
convert -colorspace gray signal-layer.png new-signal.png
92+
convert -colorspace gray power-layer.png new-power.png
93+
composite -stereo 0 old-front.png new-front.png diff-front.png
94+
composite -stereo 0 old-bottom.png new-bottom.png diff-bottom.png
95+
composite -stereo 0 old-signal.png new-signal.png diff-signal.png
96+
composite -stereo 0 old-power.png new-power.png diff-power.png
97+
mv PSLab.pdf old-PSLab.pdf
98+
cp ../docs/schematics/PSLab.pdf .
99+
pdftoppm old-PSLab.pdf old-PSLab -png -rx 300 -ry 300
100+
pdftoppm PSLab.pdf new-PSLab -png -rx 300 -ry 300
101+
convert -colorspace gray old-PSLab-1.png old-PSLab.png
102+
convert -colorspace gray new-PSLab-1.png new-PSLab.png
103+
composite -stereo 0 old-PSLab.png new-PSLab.png diff-schematic.png
104+
rm -rf old-* new-*
105+
git add .
106+
git commit -m "chore: updating board diff images for #${{ github.event.number }}"
107+
git push origin diff-img --quiet > /dev/null
108+
109+
- name: Pull request comment
110+
uses: actions/github-script@v4
111+
with:
112+
github-token: ${{ secrets.GITHUB_TOKEN }}
113+
script: |
114+
github.issues.createComment({
115+
issue_number: context.issue.number,
116+
owner: context.repo.owner,
117+
repo: context.repo.repo,
118+
body: '👋 Thanks for sharing!'
119+
})
120+
121+
- name: Electric Rule Check
122+
uses: actions/upload-artifact@v2
123+
with:
124+
name: electric-rule-check
125+
path: schematics/PSLab-erc.txt
126+
127+
- name: Design Rule Check
128+
uses: actions/upload-artifact@v2
129+
with:
130+
name: design-rule-check
131+
path: schematics/PSLab-drc.txt

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ _autosave-*
1616
*.pro-bak
1717
fp-info-cache
1818
*erc.txt
19+
*drc.txt
1920

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

3031
# IDE specifics
3132
*.DS_Store
33+
*.ogv

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# pslab-hardware
22

3-
[![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)
3+
[![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)
44
[![Gitter](https://badges.gitter.im/fossasia/pslab.svg)](https://gitter.im/fossasia/pslab?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
55
[![Twitter Follow](https://img.shields.io/twitter/follow/pslabio.svg?style=social&label=Follow&maxAge=2592000?style=flat-square)](https://twitter.com/pslabio)
66

docs/components/InteractiveBoM.html

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

docs/position_files/PositionFile.csv

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

docs/schematics/PSLab.pdf

-152 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)