Rework DRC structure #86
Workflow file for this run
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 2022 GlobalFoundries PDK Authors | |
| # | |
| # Licensed under the Apache License, Version 2.0 (the "License"); | |
| # you may not use this file except in compliance with the License. | |
| # You may obtain a copy of the License at | |
| # | |
| # http://www.apache.org/licenses/LICENSE-2.0 | |
| # | |
| # Unless required by applicable law or agreed to in writing, software | |
| # distributed under the License is distributed on an "AS IS" BASIS, | |
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
| # See the License for the specific language governing permissions and | |
| # limitations under the License. | |
| name: DRC regression testing | |
| # Prevent keeping resources busy when a branch/PR is updated | |
| # https://docs.github.com/en/actions/using-jobs/using-concurrency | |
| concurrency: | |
| group: ${{ github.repository }}-${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| on: | |
| push: | |
| pull_request: | |
| paths: | |
| - 'klayout/drc/**' | |
| workflow_dispatch: | |
| jobs: | |
| build_drc-matrix: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| drc_table: ${{ steps.set-matrix.outputs.drc_table }} | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - id: set-matrix | |
| run: | | |
| cd klayout/drc/testing/unit/ | |
| drc_table=$(find . \( -iname '*.gds' -o -iname '*.gds.gz' \) \ | |
| | sed 's|^\./||; s|\.gds\.gz$||; s|\.gds$||' \ | |
| | sort \ | |
| | jq -R . | jq -sc .) | |
| echo $drc_table | |
| echo "drc_table=$drc_table" >>$GITHUB_OUTPUT | |
| setup_klayout: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: 💾 Restore KLayout .deb from cache | |
| id: cache-klayout | |
| uses: actions/cache@v5 | |
| with: | |
| path: klayout_0.30.8-1_amd64.deb | |
| key: klayout-deb-cache-ubuntu-0.30.8 | |
| - name: Download KLayout .deb if not cached | |
| if: steps.cache-klayout.outputs.cache-hit != 'true' | |
| run: | | |
| curl -L --retry 5 --retry-delay 5 --retry-all-errors \ | |
| -o klayout_0.30.8-1_amd64.deb \ | |
| https://www.klayout.org/downloads/Ubuntu-24/klayout_0.30.8-1_amd64.deb | |
| drc_regression: | |
| needs: [build_drc-matrix, setup_klayout] | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| part: [drc] | |
| test: ${{ fromJson(needs.build_drc-matrix.outputs.drc_table) }} | |
| name: ${{ matrix.part }} | ${{ matrix.test }} | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Restore KLayout .deb from cache | |
| uses: actions/cache@v5 | |
| with: | |
| path: klayout_0.30.8-1_amd64.deb | |
| key: klayout-deb-cache-ubuntu-0.30.8 | |
| - name: Install KLayout | |
| run: sudo apt-get update && sudo apt-get install ./klayout_0.30.8-1_amd64.deb | |
| - name: Get dependencies | |
| run: | | |
| pip install -r requirements.txt | |
| - name: Testing ${{ matrix.part }} for ${{ matrix.test }} | |
| run: | | |
| part="${{ matrix.part }}" | |
| make test-"${part^^}"-${{ matrix.test }} |