| name: user_project_ci |
| |
| on: |
| push: |
| branches: |
| - main |
| pull_request: |
| workflow_dispatch: |
| |
| permissions: |
| contents: write |
| pages: write |
| id-token: write |
| |
| env: |
| PDK_ROOT: '/home/runner/work/pdk' |
| OPENLANE_ROOT: '/home/runner/work/openlane' |
| PDK: 'gf180mcuC' |
| PDK_TECH: 'gf180mcu' |
| SETUP_CACHE_KEY: 'gfmpw-0d' |
| |
| concurrency: ${{ github.workflow }}-${{ github.ref }} |
| |
| jobs: |
| gds: |
| runs-on: ubuntu-latest |
| steps: |
| - uses: actions/checkout@v3 |
| with: |
| submodules: 'recursive' |
| |
| - name: cache setup |
| id: cache-setup |
| uses: actions/cache@v3 |
| with: |
| path: | |
| ${{ env.PDK_ROOT }} |
| ${{ env.OPENLANE_ROOT }} |
| caravel/ |
| mgmt_core_wrapper/ |
| openlane.tar |
| key: ${{ runner.os }}-setup-${{ env.SETUP_CACHE_KEY }} |
| |
| - if: steps.cache-setup.outputs.cache-hit != 'true' |
| name: setup |
| run: | |
| make setup |
| docker save efabless/openlane > openlane.tar |
| |
| - if: steps.cache-setup.outputs.cache-hit == 'true' |
| name: restore setup |
| run: | |
| docker load < openlane.tar |
| |
| - name: debug |
| run: | |
| find $OPENLANE_ROOT/ |
| find $PDK_ROOT/ |
| |
| - name: setup python |
| uses: actions/setup-python@v4 |
| with: |
| python-version: '3.10' |
| |
| - name: harden serv_0 |
| run: | |
| make serv_0 |
| find openlane/serv_0/runs/serv_0/ |
| |
| - name: harden serv_1 |
| run: | |
| make serv_1 |
| find openlane/serv_1/runs/serv_1/ |
| |
| - name: harden serv_2 |
| run: | |
| make serv_2 |
| find openlane/serv_2/runs/serv_2/ |
| |
| - name: harden user_project_wrapper |
| run: | |
| make user_project_wrapper |
| find openlane/user_project_wrapper/runs/user_project_wrapper/ |
| |
| - name: show user_project_wrapper metrics |
| run: | |
| python << EOF >> $GITHUB_STEP_SUMMARY |
| import csv |
| import pathlib |
| |
| print('# user_project_wrapper') |
| print('## metrics') |
| metrics = pathlib.Path('openlane/user_project_wrapper/runs/user_project_wrapper/reports/metrics.csv') |
| with metrics.open() as f: |
| d = list(csv.DictReader(f))[0] |
| print('key|value') |
| print('---|-----') |
| for k,v in d.items(): |
| print(f'{k}|{v}') |
| EOF |
| |
| - name: show user_project_wrapper reports |
| run: | |
| cat << EOF >> $GITHUB_STEP_SUMMARY |
| ## manufacturability |
| |
| \`\`\` |
| `cat openlane/user_project_wrapper/runs/user_project_wrapper/reports/manufacturability.rpt` |
| \`\`\` |
| EOF |
| - name: cache gds |
| uses: actions/cache@v3 |
| with: |
| path: | |
| def/ |
| gds/ |
| lef/ |
| mag/ |
| maglef/ |
| sdc/ |
| sdf/ |
| signoff/ |
| spef/ |
| spi/ |
| verilog/ |
| key: ${{ runner.os }}-gds-${{ github.run_id }} |
| |
| commit: |
| if: github.ref_name == 'main' |
| needs: |
| - gds |
| runs-on: ubuntu-latest |
| steps: |
| - uses: actions/checkout@v3 |
| with: |
| submodules: 'recursive' |
| |
| - name: restore gds cache |
| uses: actions/cache@v3 |
| with: |
| path: | |
| def/ |
| gds/ |
| lef/ |
| mag/ |
| maglef/ |
| sdc/ |
| sdf/ |
| signoff/ |
| spef/ |
| spi/ |
| verilog/ |
| key: ${{ runner.os }}-gds-${{ github.run_id }} |
| |
| - name: commit |
| run: | |
| git status |
| git config --local user.name "tinybot" |
| git config --local user.email "bot@tinytapeout.com" |
| git add . |
| git commit -m "harden project [skip ci]" |
| git push origin main |
| |
| layout: |
| needs: gds |
| runs-on: ubuntu-latest |
| steps: |
| - uses: actions/checkout@v3 |
| |
| - name: setup python |
| uses: actions/setup-python@v4 |
| with: |
| python-version: '3.10' |
| - name: restore gds cache |
| uses: actions/cache@v3 |
| with: |
| path: | |
| def/ |
| gds/ |
| lef/ |
| mag/ |
| maglef/ |
| sdc/ |
| sdf/ |
| signoff/ |
| spef/ |
| spi/ |
| verilog/ |
| key: ${{ runner.os }}-gds-${{ github.run_id }} |
| |
| - name: install KLayout |
| run: | |
| wget https://www.klayout.org/downloads/Ubuntu-22/klayout_0.27.13-1_amd64.deb |
| sudo apt update |
| sudo apt install libqt5core5a libqt5designer5 libqt5gui5 libqt5multimedia5 libqt5multimediawidgets5 libqt5network5 libqt5opengl5 libqt5printsupport5 libqt5sql5 libqt5svg5 libqt5widgets5 libqt5xml5 libqt5xmlpatterns5 |
| sudo dpkg -i klayout_0.27.13-1_amd64.deb |
| |
| - name: create layout png |
| run: | |
| QT_QPA_PLATFORM=minimal klayout gds/serv_0.gds -z -r scripts/klayout_save_image.py |
| cp layout.png layout-serv0.png |
| QT_QPA_PLATFORM=minimal klayout gds/user_project_wrapper.gds -z -r scripts/klayout_save_image.py |
| - name: populate img cache |
| uses: actions/cache@v3 |
| with: |
| path: | |
| layout.png |
| layout-serv.png |
| key: ${{ runner.os }}-img-${{ github.run_id }} |
| |
| pages: |
| if: github.ref_name == 'main' |
| needs: |
| - layout |
| environment: |
| name: github-pages |
| url: ${{ steps.deployment.outputs.page_url }} |
| outputs: |
| page_url: ${{ steps.deployment.outputs.page_url }} |
| runs-on: ubuntu-latest |
| steps: |
| - name: restore img cache |
| uses: actions/cache@v3 |
| with: |
| path: | |
| layout.png |
| layout-serv.png |
| key: ${{ runner.os }}-img-${{ github.run_id }} |
| - name: setup pages |
| uses: actions/configure-pages@v2 |
| - name: upload artifact |
| uses: actions/upload-pages-artifact@v1 |
| with: |
| path: '.' |
| - name: deploy to github pages |
| id: deployment |
| uses: actions/deploy-pages@v1 |
| |
| preview: |
| needs: pages |
| runs-on: ubuntu-latest |
| steps: |
| - name: add gds preview |
| run: | |
| PAGE_URL=${{ needs.pages.outputs.page_url }} |
| PAGE_URL=$(echo "$PAGE_URL" | sed -e 's/\/$//') |
| cat << EOF >> $GITHUB_STEP_SUMMARY |
| # layout |
|  |
| EOF |