ArtistIC Render #33
This file contains hidden or 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
| # 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 |