Skip to content

Added validation for the monitors frequency range to be consistent with the frequency range defined by the sources. #7832

Added validation for the monitors frequency range to be consistent with the frequency range defined by the sources.

Added validation for the monitors frequency range to be consistent with the frequency range defined by the sources. #7832

Workflow file for this run

name: "tidy3d-frontend-tests"
on:
workflow_dispatch:
inputs:
run_tests:
description: 'Run test suite'
type: boolean
default: false
push:
branches: [ develop, latest , 'pre/*']
pull_request:
branches:
- latest
- develop
- 'pre/*'
jobs:
lint:
name: Run linting
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1
- uses: astral-sh/ruff-action@v3
with:
version: 0.5.5
- name: Run ruff format
run: ruff format --check --diff
- name: Run ruff check
run: ruff check tidy3d
test:
# Run on internal PRs/pushes OR when manually triggered with run_tests=true
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository || (github.event_name == 'workflow_dispatch' && inputs.run_tests)
name: Python ${{ matrix.python-version }} - ${{ matrix.platform }}
runs-on: ${{ matrix.platform }}
strategy:
matrix:
python-version: ['3.9', '3.10', '3.11', '3.12']
platform: [ubuntu-latest, windows-latest, macos-latest]
defaults:
run:
shell: bash
env: # Set environment variables for the whole job
PIP_ONLY_BINARY: gdstk
MPLBACKEND: agg
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Install Poetry
uses: snok/install-poetry@v1
with:
version: 1.8.2
virtualenvs-create: true
virtualenvs-in-project: true
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install project
run: |
poetry --version
poetry env use python
poetry env info
poetry run pip install --upgrade pip wheel setuptools
poetry run pip install gdstk --only-binary gdstk
poetry install -E dev
- name: Run doctests
run: |
poetry run pytest -rF --tb=short tidy3d
- name: Run tests with coverage
env:
PYTHONUNBUFFERED: "1"
run: |
poetry run pytest --cov=tidy3d -rF --tb=short tests/_test_data/_test_datasets_no_vtk.py
poetry run pytest --cov=tidy3d -rF --tb=short tests
poetry run coverage report -m
TOTAL_COVERAGE=$(poetry run coverage report --format=total)
echo "total=$TOTAL_COVERAGE" >> "$GITHUB_ENV"
echo "### Total coverage: ${TOTAL_COVERAGE}%"
- name: "Create badge"
if: ${{ github.ref == 'refs/heads/develop' }}
# https://gist.githubusercontent.com/nedbat/8c6980f77988a327348f9b02bbaf67f5
uses: schneegans/[email protected]
with:
auth: ${{ secrets.GH_TIDY3D_COVERAGE_GIST }}
gistID: 4702549574741e87deaadba436218ebd
filename: tidy3d_extension.json
label: Coverage
message: ${{ env.total }}%
minColorRange: 60
maxColorRange: 95
valColorRange: ${{ env.total }}
style: "for-the-badge"