Skip to content

Fix typing for get_cross_sections and add tests #6350

Fix typing for get_cross_sections and add tests

Fix typing for get_cross_sections and add tests #6350

Workflow file for this run

name: Test pre-commit, code and docs
on:
pull_request:
push:
branches:
- main
jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Test pre-commit hooks
run: |
python -m pip install --upgrade pip
pip install pre-commit
pre-commit run -a
test_code:
runs-on: ${{ matrix.os }}
strategy:
max-parallel: 12
matrix:
python-version: ["3.11"]
os: [ubuntu-latest, windows-latest, macos-latest]
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v3
with:
path: |
~/.cache/pip
key: ${{ hashFiles('pyproject.toml') }}
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
make install
make data-download
pip freeze > requirements.txt
pip freeze
- name: Test with pytest
run: |
pip install pytest
pytest
- uses: actions/upload-artifact@v3
with:
name: requirements
path: requirements.txt
test_code_coverage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Install dependencies
run: |
make install data-download
- name: Test with pytest
run: |
pytest --cov=gdsfactory
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: false
test_docs:
runs-on: ${{ matrix.os }}
strategy:
max-parallel: 12
matrix:
python-version: ["3.11"]
os: [ubuntu-latest]
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v3
with:
path: |
~/.gdsfactory/
key: 0.0.1
restore-keys: 0.0.1
- name: Install dependencies
run: |
python -m pip install --upgrade pip
make dev
- name: Test documentation
env:
GDSFACTORY_DISPLAY_TYPE: klayout
KFACTORY_DISPLAY_TYPE: image
run: |
make docs
- name: Expose docs artifact
uses: actions/upload-artifact@v3
if: always()
with:
name: docs
path: docs/_build/html/