GDSFactory 9 #1356
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 code | |
| on: | |
| pull_request: | |
| push: | |
| branches: | |
| - main | |
| jobs: | |
| pre-commit: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| max-parallel: 12 | |
| matrix: | |
| plugin: [femwell, gmsh, meow, sax, tidy3d, klayout, vlsir] | |
| os: [ubuntu-latest] | |
| python-version: [3.11] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: astral-sh/setup-uv@v5 | |
| - name: Install dependencies | |
| run: | | |
| uv venv -p ${{ matrix.python-version }} | |
| uv pip install .[${{ matrix.plugin }},dev] setuptools | |
| - name: Test pre-commit hooks | |
| run: | | |
| uv run pre-commit run --files gplugins/${{ matrix.plugin }}/* | |
| test_code_pip: | |
| needs: pre-commit | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| max-parallel: 12 | |
| matrix: | |
| plugin: [femwell, gmsh, meow, sax, tidy3d, klayout, vlsir] | |
| os: [ubuntu-latest, macos-latest, windows-latest] | |
| python-version: [3.11, 3.12, 3.13] | |
| name: Test ${{ matrix.plugin }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Mambaforge | |
| uses: conda-incubator/setup-miniconda@v3 | |
| with: | |
| miniforge-version: latest | |
| activate-environment: env | |
| use-mamba: true | |
| python-version: ${{ matrix.python-version }} | |
| - name: Add conda to system path | |
| run: | | |
| echo $CONDA/bin >> $GITHUB_PATH | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v5 | |
| - name: Install dependencies | |
| env: | |
| UV_SYSTEM_PYTHON: 1 | |
| run: | | |
| sudo apt-get install -y libglu1-mesa | |
| make uv venv test-data | |
| - name: Test with pytest | |
| run: | | |
| uv pip install .[${{ matrix.plugin }},dev] setuptools | |
| uv run pytest gplugins/${{ matrix.plugin }} | |
| test_code_coverage: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Mambaforge | |
| uses: conda-incubator/setup-miniconda@v3 | |
| with: | |
| miniforge-version: latest | |
| activate-environment: env | |
| use-mamba: true | |
| python-version: "3.11" | |
| - name: Add conda to system path | |
| run: | | |
| echo $CONDA/bin >> $GITHUB_PATH | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v5 | |
| - name: Install dependencies | |
| env: | |
| UV_SYSTEM_PYTHON: 1 | |
| run: | | |
| sudo apt-get install -y libglu1-mesa | |
| make uv venv test-data | |
| uv sync | |
| - name: Test with pytest | |
| run: | | |
| uv run pytest --cov=gplugins | |
| - name: Upload coverage to Codecov | |
| uses: codecov/codecov-action@v5 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| fail_ci_if_error: false |