Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
bdb565a
deploy-pr-doc: add deploy PR documentation label and workflow
lukequeenan-ansys Oct 10, 2025
cd2fada
chore: adding changelog file 16.documentation.md [dependabot-skip]
pyansys-ci-bot Oct 10, 2025
854d549
ci: update deploy PR documentation token to use PYANSYS_CI_BOT_TOKEN …
lukequeenan-ansys Oct 10, 2025
4232119
feat: add deployment for development documentation and update depende…
lukequeenan-ansys Oct 10, 2025
cd23df6
chore: update doc-build action version to v10.1 and comment out doc-d…
lukequeenan-ansys Oct 10, 2025
86b3cea
feat: enable deployment of PR documentation with updated configuration
lukequeenan-ansys Oct 10, 2025
0ec0588
Seems that the documentation is wrong, need to use the CI_BOT_TOKEN a…
lukequeenan-ansys Oct 10, 2025
cea1f24
feat: add codecov configuration for coverage reporting. Added vulnera…
lukequeenan-ansys Oct 10, 2025
df8c341
attempt code coverage report
lukequeenan-ansys Oct 10, 2025
4d26379
feat: enhance test coverage reporting in CI workflow
lukequeenan-ansys Oct 10, 2025
30475ec
feat: update coverage reporting format to include XML output
lukequeenan-ansys Oct 10, 2025
03f8a6c
feat: add user specification to Docker run command to see if this fix…
lukequeenan-ansys Oct 11, 2025
42ed146
ci(pull): only deploy doc-dev from main
jorgepiloto Oct 14, 2025
6392016
fix: update Docker image version and adjust coverage report paths in …
lukequeenan-ansys Oct 14, 2025
a73f181
fix path
lukequeenan-ansys Oct 14, 2025
8f464db
fix: update Docker run command to use bind mount for project director…
lukequeenan-ansys Oct 14, 2025
1ffd6d0
fix: add ownership preparation and restoration steps for Docker conta…
lukequeenan-ansys Oct 15, 2025
ceaab09
fix: update paths for ownership change and coverage report in CI work…
lukequeenan-ansys Oct 15, 2025
95bb3b8
fix: enhance ownership restoration logic in CI workflow
lukequeenan-ansys Oct 15, 2025
734d5c5
do I finally understand what's going on?
lukequeenan-ansys Oct 15, 2025
cb3b75b
bump pytest and pytest-cov
lukequeenan-ansys Oct 15, 2025
4366611
Removed instructions related to build_requirements.txt. There was one…
adan-wang-2 Oct 21, 2025
be61d88
Update .github/workflows/ci_cd_pr.yml
lukequeenan-ansys Oct 21, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,14 @@
- changed-files:
- any-glob-to-any-file: ['examples/**/*.py', 'doc/source/examples.rst']

# HACK: the label is declared with the only purpose of avoiding the
# GitHub labeler bot from removing it. This is a known issue reported in the
# official action/labeler repo https://github.com/actions/labeler/issues/763
'deploy-pr-doc':
- all:
- changed-files:
- all-globs-to-all-files: ['THIS-NEVER-MATCHES-A-FILE']

## -- Other labels ------------------------------------------------------------
'style:code':
- any:
Expand Down
4 changes: 4 additions & 0 deletions .github/labels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@
description: Skip documentation runs in CI/CD
color: 0677ba

- name: 'deploy-pr-doc'
description: Deploy pull request documentation
color: 0677ba

# -- Dependencies labels -----------------------------------------------------

- name: 'dependencies'
Expand Down
90 changes: 82 additions & 8 deletions .github/workflows/ci_cd_pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@ on:
env:
MAIN_PYTHON_VERSION: '3.13'
LIBRARY_NAME: 'ansys-lumerical-core'
DOCKER_IMAGE_LUMERICAL_UNIFIED: 'ghcr.io/ansys-internal/lumerical-unified:latest'
DOCKER_IMAGE_LUMERICAL_UNIFIED: 'ghcr.io/ansys-internal/lumerical-unified:v252_3'
DOCKER_CONTAINER_LUMERICAL_UNIFIED_NAME: 'lumerical-unified'
PIP_EXTRA_INDEX_URL: 'https://${{ secrets.PYANSYS_PYPI_PRIVATE_PAT }}@pkgs.dev.azure.com/pyansys/_packaging/pyansys/pypi/simple/'
DOCUMENTATION_CNAME: 'lumerical.docs.pyansys.com'

permissions:
contents: read
Expand All @@ -20,6 +21,18 @@ concurrency:

jobs:

# vulnerabilities:
# name: Vulnerabilities
# runs-on: ubuntu-latest
# steps:
# - name: PyAnsys Vulnerability check (on main)
# if: github.ref == 'refs/heads/main'
# uses: ansys/actions/check-vulnerabilities@v10.1
# with:
# python-version: ${{ env.MAIN_PYTHON_VERSION }}
# python-package-name: ${{ env.LIBRARY_NAME }}
# token: ${{ secrets.PYANSYS_CI_BOT_TOKEN }}
# dev-mode: ${{ github.ref != 'refs/heads/main' }}
labeler:
name: "Labels"
permissions:
Expand Down Expand Up @@ -83,16 +96,31 @@ jobs:

doc-build:
name: "Doc build"
if: github.event.action != 'closed'
runs-on: ubuntu-latest
needs: doc-style
steps:
- uses: ansys/actions/doc-build@v10
- uses: ansys/actions/doc-build@v10.1
with:
skip-install: true
python-version: ${{ env.MAIN_PYTHON_VERSION }}
use-python-cache: false
needs-quarto: true

doc-deploy-pr:
name: "Deploy PR documentation"
runs-on: ubuntu-latest
needs: doc-build
if: always() && (needs.doc-build.result == 'success' || needs.doc-build.result == 'skipped')
steps:
- uses: ansys/actions/doc-deploy-pr@v10.1
with:
cname: ${{ env.DOCUMENTATION_CNAME }}
token: ${{ secrets.PYANSYS_CI_BOT_TOKEN }}
bot-user: ${{ secrets.PYANSYS_CI_BOT_USERNAME }}
bot-email: ${{ secrets.PYANSYS_CI_BOT_EMAIL }}
maximum-pr-doc-deployments: 10

wheelhouse:
name: "Wheelhouse / ${{ matrix.os }} / ${{ matrix.python }}"
runs-on: ${{ matrix.os }}
Expand Down Expand Up @@ -135,22 +163,68 @@ jobs:
run: |
docker pull ${{ env.DOCKER_IMAGE_LUMERICAL_UNIFIED }}

- name: "Prepare ownership for container user (lumerical)"
env:
LUMERICAL_UID: 1000
LUMERICAL_GID: 1000
run: |
echo "ORIG_UID=$(id -u)" >> $GITHUB_ENV
echo "ORIG_GID=$(id -g)" >> $GITHUB_ENV
sudo chown -R "$LUMERICAL_UID:$LUMERICAL_GID" .
ls -la

- name: "Run Lumerical Unified Container"
run: |
docker run \
--detach -it \
--network="host" \
--name ${{ env.DOCKER_CONTAINER_LUMERICAL_UNIFIED_NAME }} \
--env ANSYSLMD_LICENSE_FILE=1055@${{ secrets.LICENSE_SERVER }} \
--volume ${PWD}:/home/ansys/pylumerical \
${{ env.DOCKER_IMAGE_LUMERICAL_UNIFIED }}
--env ANSYSLMD_LICENSE_FILE=1055@${{ secrets.LICENSE_SERVER }} \
--mount type=bind,source=${PWD},target=/home/lumerical/pylumerical \
${{ env.DOCKER_IMAGE_LUMERICAL_UNIFIED }}

- name: "Install project"
- name: "Install Project Dependencies and Run Tests"
run: |
docker exec \
--workdir /home/ansys/pylumerical \
--workdir /home/lumerical/pylumerical \
${{ env.DOCKER_CONTAINER_LUMERICAL_UNIFIED_NAME }} /bin/bash --login -c \
"python -m pip install -e .[tests] && pytest tests"
"python -m pip install -e .[tests] && \
pytest --cov="/home/lumerical/.local/lib/python3.13/site-packages/ansys/api/lumerical/" \
--cov="./tests/unit" --cov-report=xml:.cov/xml --cov-report=html:.cov/html --verbose"

- name: "Restore original ownership"
if: always()
env:
ORIG_UID: ${{ env.ORIG_UID }}
ORIG_GID: ${{ env.ORIG_GID }}
run: |
if [[ -z "$ORIG_UID" || -z "$ORIG_GID" || ! "$ORIG_UID" =~ ^[0-9]+$ || ! "$ORIG_GID" =~ ^[0-9]+$ ]]; then
if [[ -z "$ORIG_UID" || ! "$ORIG_UID" =~ ^[0-9]+$ ]]; then
echo "Skipping chown: ORIG_UID ('$ORIG_UID') is not set or not a valid integer (expected a numeric UID)."
elif [[ -z "$ORIG_GID" || ! "$ORIG_GID" =~ ^[0-9]+$ ]]; then
echo "Skipping chown: ORIG_GID ('$ORIG_GID') is not set or not a valid integer (expected a numeric GID)."
else
echo "Skipping chown: Unknown error with ORIG_UID ('$ORIG_UID') or ORIG_GID ('$ORIG_GID')."
fi
else
sudo chown -R "$ORIG_UID:$ORIG_GID" .
fi
ls -la

- name: Upload Coverage Results
if: always()
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: coverage-html-ubuntu
path: .cov/html
retention-days: 7

- name: Upload coverage to Codecov
uses: codecov/codecov-action@5a1091511ad55cbe89839c7260b706298ca349f7 # v5.5.1
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
files: .cov/xml

- name: "Stop lumerical services"
if: always()
Expand Down
12 changes: 12 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
coverage:
range: 70..100
round: down
precision: 2
status:
project:
default:
target: 80%

codecov:
notify:
wait_for_ci: yes
1 change: 1 addition & 0 deletions doc/source/changelog/16.documentation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add deploy PR documentation label and workflow
17 changes: 1 addition & 16 deletions doc/source/contributing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,10 @@ you to modify the source and enhance it.
python -m pip install -U pip
python -m pip install -e .

#. Install additional requirements as needed for build, documentation, and tests:
#. Install additional requirements as needed for documentation and tests:

.. code:: bash

python -m pip install -r requirements_build.txt
python -m pip install .[tests]
python -m pip install .[doc]

Expand Down Expand Up @@ -135,20 +134,6 @@ You can also clean the documentation build directory by running:
make clean



Distributing
------------

If you would like to create either source or wheel files, start by installing
the building requirements and then executing the build module:

.. code:: bash

python -m pip install -r requirements/requirements_build.txt
python -m build
python -m twine check dist/*


.. LINKS AND REFERENCES

.. _pre-commit: https://pre-commit.com/
Expand Down
7 changes: 5 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ dependencies = [

[project.optional-dependencies]
tests = [
"pytest==7.4.3",
"pytest-cov==4.1.0",
"pytest==8.4.2",
"pytest-cov==7.0.0",
]
doc = [
"ansys-sphinx-theme[autoapi]==1.4.2",
Expand All @@ -45,6 +45,9 @@ doc = [
"sphinx-copybutton==0.5.2",
"sphinx_design==0.6.1",
]
examples = [
"matplotlib==3.10.0",
]

[tool.flit.module]
name = "ansys.lumerical.core"
Expand Down
2 changes: 0 additions & 2 deletions requirements_build.txt

This file was deleted.

Loading