Add Static/Dynamic layout viewer tabs to cells page #2486
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
| name: Test | |
| permissions: | |
| contents: read | |
| on: | |
| pull_request: | |
| push: | |
| branches: | |
| - main | |
| merge_group: | |
| workflow_dispatch: | |
| jobs: | |
| pre-commit: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 | |
| - uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0 | |
| - uses: extractions/setup-just@53165ef7e734c5c07cb06b3c8e7b647c5aa16db3 # v4.0.0 | |
| - uses: j178/prek-action@bdca6f102f98e2b4c7029491a53dfd366469e33d # v2.0.4 | |
| get-python-versions: | |
| uses: ./.github/workflows/get-python-versions.yml | |
| test-code: | |
| needs: get-python-versions | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, macos-latest, windows-latest] | |
| python-version: ${{ fromJson(needs.get-python-versions.outputs.python-versions) }} | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 | |
| with: | |
| lfs: true | |
| - uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - uses: extractions/setup-just@53165ef7e734c5c07cb06b3c8e7b647c5aa16db3 # v4.0.0 | |
| - name: Test with pytest | |
| run: just test ${{ (github.ref == 'refs/heads/main' && matrix.os == 'ubuntu-latest') && '--cov=qpdk --cov-report=html --cov-report=xml' || '' }} | |
| - name: Generate coverage badge | |
| if: github.ref == 'refs/heads/main' && matrix.os == 'ubuntu-latest' | |
| run: uv run --group dev --group github genbadge coverage -i coverage.xml -o htmlcov/coverage.svg | |
| - name: Upload coverage report | |
| if: github.ref == 'refs/heads/main' && matrix.os == 'ubuntu-latest' | |
| uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 | |
| with: | |
| name: coverage-report-${{ matrix.python-version }} | |
| path: htmlcov | |
| test-code-result: | |
| runs-on: ubuntu-latest | |
| name: Test result | |
| needs: test-code | |
| if: always() | |
| steps: | |
| - name: Check test matrix results | |
| run: | | |
| if [[ "${{ needs.test-code.result }}" == "success" ]]; then | |
| echo "All test jobs succeeded" | |
| exit 0 | |
| else | |
| echo "One or more test jobs failed" | |
| exit 1 | |
| fi | |
| filter-gdsfactoryplus-versions: | |
| needs: get-python-versions | |
| runs-on: ubuntu-latest | |
| outputs: | |
| python-versions: ${{ steps.filter.outputs.python-versions }} | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 | |
| - uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0 | |
| - uses: extractions/setup-just@53165ef7e734c5c07cb06b3c8e7b647c5aa16db3 # v4.0.0 | |
| - name: Filter versions for gdsfactoryplus | |
| id: filter | |
| run: | | |
| INPUT='${{ needs.get-python-versions.outputs.python-versions }}' | |
| echo "python-versions=$(just get-gfp-versions "$INPUT")" >> "$GITHUB_OUTPUT" | |
| test-gdsfactoryplus: | |
| runs-on: ${{ matrix.os }} | |
| needs: filter-gdsfactoryplus-versions | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, macos-latest, windows-latest] | |
| python-version: ${{ fromJson(needs.filter-gdsfactoryplus-versions.outputs.python-versions) }} | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - uses: extractions/setup-just@53165ef7e734c5c07cb06b3c8e7b647c5aa16db3 # v4.0.0 | |
| - name: Test GDSFactory+ | |
| run: just test-gfp | |
| env: | |
| GFP_API_KEY: ${{ secrets.GFP_API_KEY }} # zizmor: ignore[secrets-outside-env] | |
| test-gdsfactoryplus-result: | |
| runs-on: ubuntu-latest | |
| name: GDSFactory+ test result | |
| needs: test-gdsfactoryplus | |
| if: always() | |
| steps: | |
| - name: Check GDSFactory+ test matrix results | |
| run: | | |
| if [[ "${{ needs.test-gdsfactoryplus.result }}" == "success" ]]; then | |
| echo "All GDSFactory+ test jobs succeeded" | |
| exit 0 | |
| else | |
| echo "One or more GDSFactory+ test jobs failed" | |
| exit 1 | |
| fi | |
| code-coverage: | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| uses: doplaydo/pdk-ci-workflow-public/.github/workflows/test_coverage.yml@main # zizmor: ignore[unpinned-uses] | |
| secrets: inherit # zizmor: ignore[secrets-inherit] | |
| model-coverage: | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| uses: doplaydo/pdk-ci-workflow-public/.github/workflows/model_coverage.yml@main # zizmor: ignore[unpinned-uses] | |
| secrets: inherit # zizmor: ignore[secrets-inherit] | |
| model-regression: | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| uses: doplaydo/pdk-ci-workflow-public/.github/workflows/model_regression.yml@main # zizmor: ignore[unpinned-uses] | |
| secrets: inherit # zizmor: ignore[secrets-inherit] | |
| test-matlab: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| lfs: true | |
| - uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0 | |
| - name: Install qpdk with models extra | |
| run: uv sync --extra models | |
| - name: Export QPDK_PYTHON and Python library paths | |
| run: | | |
| QPDK_PY="$(uv run python -c 'import sys; print(sys.executable)')" | |
| PY_LIBDIR="$(${QPDK_PY} -c 'import sysconfig; print(sysconfig.get_config_var("LIBDIR"))')" | |
| { | |
| echo "QPDK_PYTHON=${QPDK_PY}" | |
| echo "LD_LIBRARY_PATH=${PY_LIBDIR}${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}" | |
| } >> "$GITHUB_ENV" | |
| echo "Python: ${QPDK_PY}" | |
| echo "LIBDIR: ${PY_LIBDIR}" | |
| - name: Sanity-check qpdk import (Python side) | |
| run: uv run python -c "import qpdk; qpdk.PDK.activate(); print('qpdk activated:', qpdk.PDK.name)" | |
| - uses: matlab-actions/setup-matlab@a0180c939fb1a28de13f44f7b778b912384ced1f # v3.0.1 | |
| with: | |
| cache: true | |
| - name: Sanity-check MATLAB ↔ Python bridge | |
| uses: matlab-actions/run-command@e4b102448122ec2be10a72d3e0d83f6039711460 # v3.1.2 | |
| with: | |
| command: | | |
| diary('/tmp/matlab_bridge.log'); diary on; | |
| disp(getenv('QPDK_PYTHON')); | |
| pe = pyenv('Version', getenv('QPDK_PYTHON'), 'ExecutionMode', 'OutOfProcess'); | |
| disp(pe); | |
| py.print('python is reachable from MATLAB'); | |
| qpdk_mod = py.importlib.import_module('qpdk'); | |
| PDK = py.getattr(qpdk_mod, 'PDK'); | |
| PDK.activate(); | |
| disp(string(py.getattr(PDK, 'name'))); | |
| diary off; | |
| - name: Run MATLAB notebook source script | |
| uses: matlab-actions/run-command@e4b102448122ec2be10a72d3e0d83f6039711460 # v3.1.2 | |
| with: | |
| command: | | |
| diary('/tmp/matlab_script.log'); diary on; | |
| addpath('notebooks/src'); | |
| matlab_integration; | |
| diary off; | |
| - name: Print MATLAB diary on failure | |
| if: failure() | |
| run: | | |
| echo "=== /tmp/matlab_bridge.log ===" | |
| cat /tmp/matlab_bridge.log 2>/dev/null || echo "(missing)" | |
| echo "=== /tmp/matlab_script.log ===" | |
| cat /tmp/matlab_script.log 2>/dev/null || echo "(missing)" | |
| - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 | |
| if: failure() | |
| with: | |
| name: matlab-notebook-artifacts | |
| path: | | |
| /tmp/qpdk_matlab_demo/** | |
| /tmp/matlab_bridge.log | |
| /tmp/matlab_script.log | |
| if-no-files-found: warn |