forked from fossasia/pslab-hardware
-
Notifications
You must be signed in to change notification settings - Fork 1
130 lines (107 loc) · 3.76 KB
/
hardware-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
name: pslab-hardware
on:
push:
branches: [ workflow ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Download project files
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install KiCAD
run: |
sudo add-apt-repository --yes ppa:kicad/kicad-7.0-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 kibot
run: |
wget https://set-soft.github.io/debian/kibot.list
sudo cp kibot.list /etc/apt/sources.list.d/
wget https://set-soft.github.io/debian/kibot.gpg
sudo cp kibot.gpg /etc/apt/
sudo apt-get update
sudo apt install kibot kidiff
- name: Install dependencies
run: |
pip install pcb-tools image
sudo apt install xvfb recordmydesktop xdotool libmagickwand-dev librsvg2-bin imagemagick poppler-utils
- name: Change Imagemagic Policy
run: sudo sed -i 's/<policy domain="coder" rights="none" pattern="PDF"/<policy domain="coder" rights="read|write" pattern="PDF"/g' /etc/ImageMagick-6/policy.xml
- name: Update kibot configuration
run: |
commit_id=$(git ls-remote https://github.com/fossasia/pslab-hardware.git refs/heads/pslab-v6 | cut -f 1)
commit_id_escaped=$(sed 's/[&/\]/\\&/g' <<< "$commit_id")
sed -i "s/old: 'HEAD'/old: '$commit_id_escaped'/g" schematics/CI.kibot.yaml
- name: Run build
run: |
cd schematics
sudo kibot -v
- name: Cache files
uses: actions/[email protected]
with:
path: |
schematics
docs
key: ${{ runner.os }}-schematics-docs
deploy:
runs-on: ubuntu-latest
steps:
- name: Download project files
uses: actions/checkout@v4
- name: Cache files
uses: actions/[email protected]
with:
path: |
schematics
docs
key: ${{ runner.os }}-schematics-docs
- name: Publish PDF schematic
uses: actions/upload-artifact@v3
with:
name: schematic-pdf
path: docs/schematics/PSLab.pdf
- name: Publish interactive bill of materials
uses: actions/upload-artifact@v3
with:
name: interactive-bom
path: docs/components/InteractiveBoM.html
- name: Publish bill of materials
uses: actions/upload-artifact@v3
with:
name: bill-of-materials
path: docs/components/BillOfMaterials.csv
- name: Publish gerbers
uses: actions/upload-artifact@v3
with:
name: gerbers
path: output/Gerber/
- name: Publish centroids
uses: actions/upload-artifact@v3
with:
name: pick-and-place
path: docs/position_files/PositionFile.csv
- name: Electric Rule Check
uses: actions/upload-artifact@v3
with:
name: electric-rule-check
path: schematics/PSLab-erc.txt
- name: Design Rule Check
uses: actions/upload-artifact@v3
with:
name: design-rule-check
path: schematics/PSLab-drc.txt
- name: Difference
uses: actions/upload-artifact@v3
with:
name: difference
path: |
docs/components/diff_pcb.pdf
docs/components/diff_schematic.pdf