forked from fossasia/pslab-hardware
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: workflow for schematic changes (fossasia#122)
- Loading branch information
1 parent
450d977
commit 611ec14
Showing
22 changed files
with
31,290 additions
and
33,293 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
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 |
This file contains 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
This file contains 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
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains 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
Binary file not shown.
Oops, something went wrong.