-
Notifications
You must be signed in to change notification settings - Fork 96
213 lines (206 loc) · 8.29 KB
/
artistic.yml
File metadata and controls
213 lines (206 loc) · 8.29 KB
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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
# Copyright (c) 2025 ETH Zurich and University of Bologna.
# Licensed under the Apache License, Version 2.0, see LICENSE for details.
# SPDX-License-Identifier: Apache-2.0
# Author: Philippe Sauter <phsauter@iis.ee.ethz.ch>
# Author: Thomas Benz <tbenz@iis.ee.ethz.ch>
name: ArtistIC Render
on:
workflow_dispatch:
workflow_run:
workflows: ["Full Flow"]
types: [completed]
branches: [main]
jobs:
artistic:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}
timeout-minutes: 60
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Checkout repository (with submodules)
uses: actions/checkout@v4
with:
submodules: true
- name: Free disk space
uses: ./.github/actions/free-space
- name: Get run ID of "Full Flow" workflow
id: get-run-id
run: |
OTHER_REPO="${{ github.repository }}"
WF_NAME="Full Flow"
RUN_ID=$(gh run --repo "${OTHER_REPO}" list --workflow "${WF_NAME}" --json databaseId --jq '.[0].databaseId')
echo "Detected latest run id ${RUN_ID} for workflow ${WF_NAME}"
echo "run-id=${RUN_ID}" >> "$GITHUB_OUTPUT"
env:
GH_TOKEN: ${{ github.token }}
- name: Download artifact from "Full Flow" workflow
uses: actions/download-artifact@v4
with:
name: croc-gds
github-token: ${{ github.token }}
repository: ${{ github.repository }}
run-id: ${{ steps.get-run-id.outputs.run-id }}
path: klayout
- name: Checkout ArtistIC repository
uses: actions/checkout@v4
with:
repository: pulp-platform/artistic
ref: 33986fa39e07d89a8337d65e84b01113bf18ea03
path: artistic
- name: Update package lists and install Inkscape, img2pdf
run: |
sudo apt-get update
sudo apt-get install -y inkscape img2pdf
- name: Customize input logo
run : |
sed "s/#DATE#/$(date '+%Y-%m-%d')/g" doc/artwork/logo_chip.svg > doc/artwork/logo.svg
sed -i "s/#HASH#/$(git rev-parse --short HEAD)/g" doc/artwork/logo.svg
sed -i "s|#REPO#|gh.io/$GITHUB_REPOSITORY|g" doc/artwork/logo.svg
inkscape doc/artwork/logo.svg -w 660 -h 660 -o doc/artwork/logo.png
- name: Upload logo
uses: actions/upload-artifact@v4
with:
name: png-logo
path: doc/artwork/logo.png
continue-on-error: true
- name: Install ImageMagick
run: |
sudo apt-get install -y imagemagick
- name: Install packages in OSEDA
uses: ./.github/actions/oseda-cmd
with:
cmd: "pip install --break-system-packages gdspy"
- name: Meercat setup, export top-level GDS
uses: ./.github/actions/oseda-cmd
with:
cmd: "ls -lah klayout; cd artistic; mkdir -p meerkat_work; python3 scripts/meerkat_interface.py -i ../../klayout/croc_chip.gds -m croc_tm.gds.gz -g croc_logo.gds -o croc_chip.gds.gz -w meerkat_work -l 134; cd meerkat_work; klayout -zz -rm ../scripts/export_top_metal.py; gzip -d croc_tm.gds.gz"
- name: Upload top-level GDS
uses: actions/upload-artifact@v4
with:
name: top-level-gds
path: artistic/meerkat_work/croc_tm.gds
continue-on-error: true
- name: Translate the logo to mono
run: |
convert doc/artwork/logo.png -remap pattern:gray50 artistic/meerkat_work/logo_mono.png
- name: Upload mono logo
uses: actions/upload-artifact@v4
with:
name: mono-logo
path: artistic/meerkat_work/logo_mono.png
continue-on-error: true
- name: Generate logo GDS
uses: ./.github/actions/oseda-cmd
with:
cmd: "cd artistic; python3 scripts/meerkat.py -m '145,145,145,145' -i meerkat_work/logo_mono.png -g meerkat_work/croc_tm.gds -l 134 -n croc -s meerkat_work/croc_logo.svg -o meerkat_work/croc_logo.gds"
- name: Upload logo GDS
uses: actions/upload-artifact@v4
with:
name: logo-gds
path: artistic/meerkat_work/croc_logo.gds
continue-on-error: true
- name: Upload logo SVG
uses: actions/upload-artifact@v4
with:
name: logo-svg
path: artistic/meerkat_work/croc_logo.svg
continue-on-error: true
- name: Merge logo GDS with chip GDS
uses: ./.github/actions/oseda-cmd
with:
cmd: "cd artistic; cd meerkat_work; klayout -zz -rm ../scripts/merge_logo.py"
- name: Upload chip GDS
uses: actions/upload-artifact@v4
with:
name: chip-gds
path: artistic/meerkat_work/croc_chip.gds.gz
continue-on-error: true
- name: Prepare render
run: |
mkdir -p artistic/renderics
cp -v .github/config/croc_ci.json artistic/renderics/croc_ci.json
cp -v .github/config/croc_map_ci.json artistic/renderics/croc_map_ci.json
sed "s|/fosic/designs|/home/runner/work/croc|g" artistic/renderics/croc_ci.json > artistic/renderics/croc_ci_runner.json
sed "s|/fosic/designs|/home/runner/work/croc|g" artistic/renderics/croc_map_ci.json > artistic/renderics/croc_map_ci_runner.json
- name: Analyze render
uses: ./.github/actions/oseda-cmd
with:
cmd: "cd artistic; make analyze CFG_FILE=/fosic/designs/croc/artistic/renderics/croc_ci.json > renderics/analyze.txt"
- name: Upload render summary
uses: actions/upload-artifact@v4
with:
name: render-summary
path: artistic/renderics/analyze.txt
continue-on-error: true
- name: Upload color preview
uses: actions/upload-artifact@v4
with:
name: render-color-preview
path: artistic/renderics/colors_croc.svg
continue-on-error: true
- name: Render b/w layer tiles
uses: ./.github/actions/oseda-cmd
with:
cmd: "cd artistic; make gen_raw CFG_FILE=/fosic/designs/croc/artistic/renderics/croc_ci.json"
- name: Render PDFs
run: |
cd artistic; make -j gen_pdfs CFG_FILE=renderics/croc_ci_runner.json
- name: Finish render
run: |
mv artistic/renderics//DPI__croc_0-0.png artistic/renderics/croc_render.png
mv artistic/renderics//PDF__croc_0-0.pdf artistic/renderics/croc_render.pdf
convert artistic/renderics/croc_render.png artistic/renderics/croc_render.jpg
- name: Upload render PNG
uses: actions/upload-artifact@v4
with:
name: render-png
path: artistic/renderics/croc_render.png
continue-on-error: true
- name: Upload render PDF
uses: actions/upload-artifact@v4
with:
name: render-pdf
path: artistic/renderics/croc_render.pdf
continue-on-error: true
- name: Upload render JPG
uses: actions/upload-artifact@v4
with:
name: render-jpg
path: artistic/renderics/croc_render.jpg
continue-on-error: true
# Map render and deploy below:
- name: Render b/w map layer tiles
uses: ./.github/actions/oseda-cmd
with:
cmd: "cd artistic; make gen_raw CFG_FILE=/fosic/designs/croc/artistic/renderics/croc_map_ci.json"
- name: Render Map Tiles
run: |
cd artistic; make -j gen_tiles CFG_FILE=renderics/croc_map_ci_runner.json
- name: Mapify Tiles
run: |
cd artistic; python3 scripts/mapify.py renderics/croc_map_ci_runner.json | sh
- name: Copy index.html
run: |
cp .github/config/gh-pages-map.html artistic/mapify/index.html
- name: Upload OpenStreetMap DB
uses: actions/upload-artifact@v4
with:
name: map-db
path: artistic/mapify
continue-on-error: true
- name: Copy GDS to be deployed
run: |
cp artistic/meerkat_work/croc_logo.gds artistic/mapify/croc_logo.gds
- name: Upload OpenStreetMap DB to pages
uses: actions/upload-pages-artifact@v3
with:
path: artistic/mapify
- name: Deploy pages (on main only)
if: github.ref == 'refs/heads/main'
id: deployment
uses: actions/deploy-pages@v4