From e358d35b1e7d779d6097a8d891d36dee27d5025f Mon Sep 17 00:00:00 2001 From: Roberto Pastor Muela <37798125+RobPasMue@users.noreply.github.com> Date: Fri, 14 Nov 2025 08:00:02 +0100 Subject: [PATCH 01/10] ci: prepare for releasing --- .github/workflows/{ci_cd_pr.yml => ci_cd.yml} | 120 ++++++++++++++++-- 1 file changed, 106 insertions(+), 14 deletions(-) rename .github/workflows/{ci_cd_pr.yml => ci_cd.yml} (75%) diff --git a/.github/workflows/ci_cd_pr.yml b/.github/workflows/ci_cd.yml similarity index 75% rename from .github/workflows/ci_cd_pr.yml rename to .github/workflows/ci_cd.yml index 4477a90..f763b6a 100644 --- a/.github/workflows/ci_cd_pr.yml +++ b/.github/workflows/ci_cd.yml @@ -135,20 +135,6 @@ jobs: 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 }} @@ -275,3 +261,109 @@ jobs: docker stop ${DOCKER_CONTAINER_LUMERICAL_UNIFIED_NAME} docker logs ${DOCKER_CONTAINER_LUMERICAL_UNIFIED_NAME} docker rm ${DOCKER_CONTAINER_LUMERICAL_UNIFIED_NAME} + + package: + name: Package library + needs: [tests, doc-build] + runs-on: ubuntu-latest + permissions: + attestations: write + contents: read + id-token: write + steps: + - name: Build library source and wheel artifacts + uses: ansys/actions/build-library@v10 + with: + library-name: ${{ env.LIBRARY_NAME }} + python-version: ${{ env.MAIN_PYTHON_VERSION }} + attest-provenance: true + + release: + name: Release project to GitHub + if: github.event_name == 'push' && contains(github.ref, 'refs/tags') + needs: [package, update-changelog] + runs-on: ubuntu-latest + # Specifying a GitHub environment is optional, but strongly encouraged + environment: release + permissions: + id-token: write + contents: write + steps: + - name: Release to GitHub + uses: ansys/actions/release-github@v10 + with: + token: ${{ secrets.GITHUB_TOKEN }} + library-name: ${{ env.LIBRARY_NAME }} + add-artifact-attestation-notes: true + changelog-release-notes: true + + release-pypi: + name: Release project to PyPI + if: github.event_name == 'push' && contains(github.ref, 'refs/tags') + needs: [package, update-changelog] + runs-on: ubuntu-latest + # Specifying a GitHub environment is optional, but strongly encouraged + environment: release + permissions: + id-token: write + contents: write + steps: + - name: "Download the library artifacts from build-library step" + uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0 + with: + name: ${{ env.LIBRARY_NAME }}-artifacts + path: ${{ env.LIBRARY_NAME }}-artifacts + + - name: "Upload artifacts to PyPI using trusted publisher" + uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e # v1.13.0 + with: + repository-url: "https://upload.pypi.org/legacy/" + print-hash: true + packages-dir: ${{ env.LIBRARY_NAME }}-artifacts + skip-existing: false + + 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 + + doc-deploy-dev: + name: Upload dev documentation + if: github.ref == 'refs/heads/main' + needs: doc-build + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - name: Deploy the latest documentation + uses: ansys/actions/doc-deploy-dev@v10 + 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 }} + + doc-deploy-stable: + name: Upload release documentation + if: github.event_name == 'push' && contains(github.ref, 'refs/tags') + needs: [release, release-pypi] + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - name: Deploy the stable documentation + uses: ansys/actions/doc-deploy-stable@v10 + 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 }} From 845117b53c0428bf6968acb6c056e0ef79afba58 Mon Sep 17 00:00:00 2001 From: Roberto Pastor Muela <37798125+RobPasMue@users.noreply.github.com> Date: Fri, 14 Nov 2025 08:06:17 +0100 Subject: [PATCH 02/10] ci: minor mods --- .github/workflows/ci_cd.yml | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci_cd.yml b/.github/workflows/ci_cd.yml index f763b6a..298dd48 100644 --- a/.github/workflows/ci_cd.yml +++ b/.github/workflows/ci_cd.yml @@ -1,12 +1,17 @@ -name: pull-request +name: GitHub CI/CD on: pull_request: types: [opened, reopened, synchronize, edited, labeled, closed] + workflow_dispatch: + push: + tags: + - "*" + branches: + - main env: MAIN_PYTHON_VERSION: '3.13' LIBRARY_NAME: 'ansys-lumerical-core' - 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: @@ -23,11 +28,12 @@ jobs: name: "Actions Security" runs-on: ubuntu-latest steps: - - uses: ansys/actions/check-actions-security@c2fa7c93f6883114e0e643599431b33d29f0b13f # v10.1.4 + - uses: ansys/actions/check-actions-security@v10 with: generate-summary: true token: ${{ secrets.GITHUB_TOKEN }} auditing-level: "high" + trust-ansys-actions: true # vulnerabilities: # name: Vulnerabilities @@ -35,7 +41,7 @@ jobs: # steps: # - name: PyAnsys Vulnerability check (on main) # if: github.ref == 'refs/heads/main' - # uses: ansys/actions/check-vulnerabilities@v10.1 + # uses: ansys/actions/check-vulnerabilities@v10 # with: # python-version: ${{ env.MAIN_PYTHON_VERSION }} # python-package-name: ${{ env.LIBRARY_NAME }} @@ -50,7 +56,7 @@ jobs: contents: write pull-requests: write steps: - - uses: ansys/actions/doc-deploy-changelog@v10.1 + - uses: ansys/actions/doc-deploy-changelog@v10 with: bot-user: ${{ secrets.PYANSYS_CI_BOT_USERNAME }} bot-email: ${{ secrets.PYANSYS_CI_BOT_EMAIL }} @@ -109,7 +115,7 @@ jobs: name: "Run commit style checks" runs-on: ubuntu-latest steps: - - uses: ansys/actions/check-pr-title@v10.1 + - uses: ansys/actions/check-pr-title@v10 with: token: ${{ secrets.GITHUB_TOKEN }} @@ -128,7 +134,7 @@ jobs: runs-on: ubuntu-latest needs: doc-style steps: - - uses: ansys/actions/doc-build@v10.1 + - uses: ansys/actions/doc-build@v10 with: skip-install: true python-version: ${{ env.MAIN_PYTHON_VERSION }} @@ -328,7 +334,7 @@ jobs: needs: doc-build if: always() && (needs.doc-build.result == 'success' || needs.doc-build.result == 'skipped') steps: - - uses: ansys/actions/doc-deploy-pr@v10.1 + - uses: ansys/actions/doc-deploy-pr@v10 with: cname: ${{ env.DOCUMENTATION_CNAME }} token: ${{ secrets.PYANSYS_CI_BOT_TOKEN }} From b6a9a1350444da9974b6fb3625726be29a8d1f9b Mon Sep 17 00:00:00 2001 From: Roberto Pastor Muela <37798125+RobPasMue@users.noreply.github.com> Date: Fri, 14 Nov 2025 08:06:24 +0100 Subject: [PATCH 03/10] feat: adding dependabot --- .github/dependabot.yml | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 .github/dependabot.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..7df858d --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,33 @@ +version: 2 +updates: + - package-ecosystem: "pip" + directory: "/" + schedule: + interval: "daily" + cooldown: + default-days: 5 # Fallback cooldown if no specific rule applies + semver-major-days: 30 # Cooldown for major version updates + semver-minor-days: 7 # Cooldown for minor version updates + semver-patch-days: 3 # Cooldown for patch updates + labels: + - "maintenance" + - "dependencies" + commit-message: + prefix: "build" + groups: + pip-deps: + patterns: + - "*" + + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "weekly" + labels: + - "maintenance" + commit-message: + prefix: "ci" + groups: + actions: + patterns: + - "*" From 88ea1c7a8345faacf78aa8c3ce13c87e27ae748b Mon Sep 17 00:00:00 2001 From: pyansys-ci-bot <92810346+pyansys-ci-bot@users.noreply.github.com> Date: Fri, 14 Nov 2025 07:07:55 +0000 Subject: [PATCH 04/10] chore: adding changelog file 20.maintenance.md [dependabot-skip] --- doc/source/changelog/20.maintenance.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 doc/source/changelog/20.maintenance.md diff --git a/doc/source/changelog/20.maintenance.md b/doc/source/changelog/20.maintenance.md new file mode 100644 index 0000000..f9339e4 --- /dev/null +++ b/doc/source/changelog/20.maintenance.md @@ -0,0 +1 @@ +Release prep From c94fc22b92bef66e3c0a7dc375f5c21ca55ac720 Mon Sep 17 00:00:00 2001 From: Roberto Pastor Muela <37798125+RobPasMue@users.noreply.github.com> Date: Fri, 14 Nov 2025 08:27:17 +0100 Subject: [PATCH 05/10] fix: failing test --- tests/unit/test_lumerical_open_close.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/unit/test_lumerical_open_close.py b/tests/unit/test_lumerical_open_close.py index 5f17d6d..6e973a7 100644 --- a/tests/unit/test_lumerical_open_close.py +++ b/tests/unit/test_lumerical_open_close.py @@ -128,7 +128,7 @@ def test_open_device_invalid_remote_args_error(self): with pytest.raises(lumapi.LumApiError) as ex_info: _ = lumapi.DEVICE(hide=True, remoteArgs=remote_args) - assert "appOpen error: Unable to connect to server" in str(ex_info.value) + assert "appOpen error: Interop-client: Unable to open the SSL key file" in str(ex_info.value) def test_open_close_mode(self): """Test 08: Test lumapi 'open' and 'close' MODE.""" From 2dbaa64a4b448f8d08564f04e7b44c5fae5f517f Mon Sep 17 00:00:00 2001 From: Roberto Pastor Muela <37798125+RobPasMue@users.noreply.github.com> Date: Fri, 14 Nov 2025 08:36:28 +0100 Subject: [PATCH 06/10] chore: update CODEOWNERS --- .github/CODEOWNERS | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 039641e..a803a18 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1,3 +1 @@ -* @dylanm-ansys -* @lukequeenan-ansys -* @gregbaethge +* @dylanm-ansys @lukequeenan-ansys @gregbaethge From 3a2f336a56e7f57588ac59fb510e7a7a53c5c8ed Mon Sep 17 00:00:00 2001 From: Roberto Pastor Muela <37798125+RobPasMue@users.noreply.github.com> Date: Fri, 14 Nov 2025 08:57:49 +0100 Subject: [PATCH 07/10] build: changing lower limit for numpy --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 8b2f46c..a8da1df 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -30,7 +30,7 @@ classifiers = [ dependencies = [ "ansys-api-lumerical", - "numpy>=2.2.2", + "numpy>=1.26", ] [project.optional-dependencies] From 3e6c2a16194d7f67c66a600a86919b5c6dd34a55 Mon Sep 17 00:00:00 2001 From: Roberto Pastor Muela <37798125+RobPasMue@users.noreply.github.com> Date: Fri, 14 Nov 2025 09:17:13 +0100 Subject: [PATCH 08/10] ci: breaking into multiple workflows --- .github/workflows/ci_cd_main.yml | 59 ++++ .github/workflows/{ci_cd.yml => ci_cd_pr.yml} | 5 +- .github/workflows/ci_cd_release.yml | 263 ++++++++++++++++++ 3 files changed, 324 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/ci_cd_main.yml rename .github/workflows/{ci_cd.yml => ci_cd_pr.yml} (98%) create mode 100644 .github/workflows/ci_cd_release.yml diff --git a/.github/workflows/ci_cd_main.yml b/.github/workflows/ci_cd_main.yml new file mode 100644 index 0000000..1671c06 --- /dev/null +++ b/.github/workflows/ci_cd_main.yml @@ -0,0 +1,59 @@ +name: main + +on: + push: + branches: + - main + +env: + MAIN_PYTHON_VERSION: '3.13' + LIBRARY_NAME: 'ansys-lumerical-core' + DOCUMENTATION_CNAME: 'lumerical.docs.pyansys.com' + +permissions: + contents: read + pull-requests: read + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + # vulnerabilities: + # name: Vulnerabilities + # runs-on: ubuntu-latest + # steps: + # - name: PyAnsys Vulnerability check (on main) + # uses: ansys/actions/check-vulnerabilities@v10 + # with: + # python-version: ${{ env.MAIN_PYTHON_VERSION }} + # python-package-name: ${{ env.LIBRARY_NAME }} + # token: ${{ secrets.PYANSYS_CI_BOT_TOKEN }} + # dev-mode: false + + doc-build: + name: "Doc build" + runs-on: ubuntu-latest + steps: + - uses: ansys/actions/doc-build@v10 + with: + skip-install: true + python-version: ${{ env.MAIN_PYTHON_VERSION }} + use-python-cache: false + needs-quarto: true + + doc-deploy-dev: + name: Upload dev documentation + if: github.ref == 'refs/heads/main' + needs: doc-build + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - name: Deploy the latest documentation + uses: ansys/actions/doc-deploy-dev@v10 + 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 }} diff --git a/.github/workflows/ci_cd.yml b/.github/workflows/ci_cd_pr.yml similarity index 98% rename from .github/workflows/ci_cd.yml rename to .github/workflows/ci_cd_pr.yml index 298dd48..07cd4b8 100644 --- a/.github/workflows/ci_cd.yml +++ b/.github/workflows/ci_cd_pr.yml @@ -39,14 +39,13 @@ jobs: # name: Vulnerabilities # runs-on: ubuntu-latest # steps: - # - name: PyAnsys Vulnerability check (on main) - # if: github.ref == 'refs/heads/main' + # - name: PyAnsys Vulnerability check (on PR) # uses: ansys/actions/check-vulnerabilities@v10 # 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' }} + # dev-mode: true update-changelog: name: "Update CHANGELOG (on release)" diff --git a/.github/workflows/ci_cd_release.yml b/.github/workflows/ci_cd_release.yml new file mode 100644 index 0000000..144f8fb --- /dev/null +++ b/.github/workflows/ci_cd_release.yml @@ -0,0 +1,263 @@ +name: release +on: + push: + tags: + - "v*.*.*" + +env: + MAIN_PYTHON_VERSION: '3.13' + LIBRARY_NAME: 'ansys-lumerical-core' + DOCUMENTATION_CNAME: 'lumerical.docs.pyansys.com' + +permissions: + contents: read + pull-requests: read + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + + update-changelog: + name: "Update CHANGELOG (on release)" + runs-on: ubuntu-latest + permissions: + contents: write + pull-requests: write + steps: + - uses: ansys/actions/doc-deploy-changelog@v10 + with: + bot-user: ${{ secrets.PYANSYS_CI_BOT_USERNAME }} + bot-email: ${{ secrets.PYANSYS_CI_BOT_EMAIL }} + token: ${{ secrets.PYANSYS_CI_BOT_TOKEN }} + + code-style: + name: "Code style" + runs-on: ubuntu-latest + steps: + - name: "Run code style checks" + uses: ansys/actions/code-style@v10 + with: + python-version: ${{ env.MAIN_PYTHON_VERSION }} + use-python-cache: false + + doc-style: + name: "Doc style" + runs-on: ubuntu-latest + steps: + - uses: ansys/actions/doc-style@v10 + with: + token: ${{ secrets.GITHUB_TOKEN }} + + doc-build: + name: "Doc build" + runs-on: ubuntu-latest + needs: doc-style + steps: + - uses: ansys/actions/doc-build@v10 + with: + skip-install: true + python-version: ${{ env.MAIN_PYTHON_VERSION }} + use-python-cache: false + needs-quarto: true + + wheelhouse: + name: "Wheelhouse / ${{ matrix.os }} / ${{ matrix.python }}" + runs-on: ${{ matrix.os }} + needs: code-style + permissions: + id-token: write + contents: write + strategy: + fail-fast: false + matrix: + os: ['ubuntu-latest', 'windows-latest'] + python: ['3.10', '3.11', '3.12', '3.13'] + steps: + - uses: ansys/actions/build-wheelhouse@v10 + with: + library-name: ${{ env.LIBRARY_NAME }} + operating-system: ${{ matrix.os }} + python-version: ${{ matrix.python }} + + tests: + name: "Test Python 3.13 with Lumerical Unified Linux Container" + runs-on: ubuntu-latest + needs: wheelhouse + permissions: + id-token: write + contents: write + env: + DOCKER_IMAGE_LUMERICAL_UNIFIED: 'ghcr.io/ansys-internal/lumerical-unified:v252_3' + DOCKER_CONTAINER_LUMERICAL_UNIFIED_NAME: 'lumerical-unified' + steps: + + - name: "Checkout PyLumerical" + uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4 + with: + persist-credentials: false + + - name: "Login to GitHub container registry" + uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.PYANSYS_CI_BOT_TOKEN }} + + - name: "Pull Lumerical Unified Container" + env: + DOCKER_IMAGE_LUMERICAL_UNIFIED: ${{ env.DOCKER_IMAGE_LUMERICAL_UNIFIED }} + run: | + docker pull ${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" + env: + DOCKER_CONTAINER_LUMERICAL_UNIFIED_NAME: ${{ env.DOCKER_CONTAINER_LUMERICAL_UNIFIED_NAME }} + DOCKER_IMAGE_LUMERICAL_UNIFIED: ${{ env.DOCKER_IMAGE_LUMERICAL_UNIFIED }} + LICENSE_SERVER: ${{ secrets.LICENSE_SERVER }} + run: | + docker run \ + --detach -it \ + --network="host" \ + --name ${DOCKER_CONTAINER_LUMERICAL_UNIFIED_NAME} \ + --env ANSYSLMD_LICENSE_FILE=1055@${LICENSE_SERVER} \ + --mount type=bind,source=${PWD},target=/home/lumerical/pylumerical \ + ${DOCKER_IMAGE_LUMERICAL_UNIFIED} + + - name: "Install Project Dependencies and Run Tests" + env: + DOCKER_CONTAINER_LUMERICAL_UNIFIED_NAME: ${{ env.DOCKER_CONTAINER_LUMERICAL_UNIFIED_NAME }} + run: | + docker exec \ + --workdir /home/lumerical/pylumerical \ + ${DOCKER_CONTAINER_LUMERICAL_UNIFIED_NAME} /bin/bash --login -c \ + "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() + env: + DOCKER_CONTAINER_LUMERICAL_UNIFIED_NAME: ${{ env.DOCKER_CONTAINER_LUMERICAL_UNIFIED_NAME }} + run: | + docker stop ${DOCKER_CONTAINER_LUMERICAL_UNIFIED_NAME} + docker logs ${DOCKER_CONTAINER_LUMERICAL_UNIFIED_NAME} + docker rm ${DOCKER_CONTAINER_LUMERICAL_UNIFIED_NAME} + + package: + name: Package library + needs: [tests, doc-build] + runs-on: ubuntu-latest + permissions: + attestations: write + contents: read + id-token: write + steps: + - name: Build library source and wheel artifacts + uses: ansys/actions/build-library@v10 + with: + library-name: ${{ env.LIBRARY_NAME }} + python-version: ${{ env.MAIN_PYTHON_VERSION }} + attest-provenance: true + + release: + name: Release project to GitHub + needs: [package, update-changelog] + runs-on: ubuntu-latest + # Specifying a GitHub environment is optional, but strongly encouraged + environment: release + permissions: + id-token: write + contents: write + steps: + - name: Release to GitHub + uses: ansys/actions/release-github@v10 + with: + token: ${{ secrets.GITHUB_TOKEN }} + library-name: ${{ env.LIBRARY_NAME }} + add-artifact-attestation-notes: true + changelog-release-notes: true + + release-pypi: + name: Release project to PyPI + needs: [package, update-changelog] + runs-on: ubuntu-latest + # Specifying a GitHub environment is optional, but strongly encouraged + environment: release + permissions: + id-token: write + contents: write + steps: + - name: "Download the library artifacts from build-library step" + uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0 + with: + name: ${{ env.LIBRARY_NAME }}-artifacts + path: ${{ env.LIBRARY_NAME }}-artifacts + + - name: "Upload artifacts to PyPI using trusted publisher" + uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e # v1.13.0 + with: + repository-url: "https://upload.pypi.org/legacy/" + print-hash: true + packages-dir: ${{ env.LIBRARY_NAME }}-artifacts + skip-existing: false + + doc-deploy-stable: + name: Upload release documentation + needs: [release, release-pypi] + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - name: Deploy the stable documentation + uses: ansys/actions/doc-deploy-stable@v10 + 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 }} From 13de345eae15486d85f14e31b0288288104a4d57 Mon Sep 17 00:00:00 2001 From: Roberto Pastor Muela <37798125+RobPasMue@users.noreply.github.com> Date: Fri, 14 Nov 2025 09:19:51 +0100 Subject: [PATCH 09/10] ci: revert ci_Cd_pr changes --- .github/workflows/ci_cd_pr.yml | 109 +++++---------------------------- 1 file changed, 14 insertions(+), 95 deletions(-) diff --git a/.github/workflows/ci_cd_pr.yml b/.github/workflows/ci_cd_pr.yml index 07cd4b8..4dc4706 100644 --- a/.github/workflows/ci_cd_pr.yml +++ b/.github/workflows/ci_cd_pr.yml @@ -2,12 +2,6 @@ name: GitHub CI/CD on: pull_request: types: [opened, reopened, synchronize, edited, labeled, closed] - workflow_dispatch: - push: - tags: - - "*" - branches: - - main env: MAIN_PYTHON_VERSION: '3.13' @@ -140,6 +134,20 @@ jobs: 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 + 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 }} @@ -283,92 +291,3 @@ jobs: python-version: ${{ env.MAIN_PYTHON_VERSION }} attest-provenance: true - release: - name: Release project to GitHub - if: github.event_name == 'push' && contains(github.ref, 'refs/tags') - needs: [package, update-changelog] - runs-on: ubuntu-latest - # Specifying a GitHub environment is optional, but strongly encouraged - environment: release - permissions: - id-token: write - contents: write - steps: - - name: Release to GitHub - uses: ansys/actions/release-github@v10 - with: - token: ${{ secrets.GITHUB_TOKEN }} - library-name: ${{ env.LIBRARY_NAME }} - add-artifact-attestation-notes: true - changelog-release-notes: true - - release-pypi: - name: Release project to PyPI - if: github.event_name == 'push' && contains(github.ref, 'refs/tags') - needs: [package, update-changelog] - runs-on: ubuntu-latest - # Specifying a GitHub environment is optional, but strongly encouraged - environment: release - permissions: - id-token: write - contents: write - steps: - - name: "Download the library artifacts from build-library step" - uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0 - with: - name: ${{ env.LIBRARY_NAME }}-artifacts - path: ${{ env.LIBRARY_NAME }}-artifacts - - - name: "Upload artifacts to PyPI using trusted publisher" - uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e # v1.13.0 - with: - repository-url: "https://upload.pypi.org/legacy/" - print-hash: true - packages-dir: ${{ env.LIBRARY_NAME }}-artifacts - skip-existing: false - - 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 - 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 - - doc-deploy-dev: - name: Upload dev documentation - if: github.ref == 'refs/heads/main' - needs: doc-build - runs-on: ubuntu-latest - permissions: - contents: write - steps: - - name: Deploy the latest documentation - uses: ansys/actions/doc-deploy-dev@v10 - 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 }} - - doc-deploy-stable: - name: Upload release documentation - if: github.event_name == 'push' && contains(github.ref, 'refs/tags') - needs: [release, release-pypi] - runs-on: ubuntu-latest - permissions: - contents: write - steps: - - name: Deploy the stable documentation - uses: ansys/actions/doc-deploy-stable@v10 - 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 }} From ab276924501bfc709233f63271f6ad2cd9c38413 Mon Sep 17 00:00:00 2001 From: Roberto Pastor Muela <37798125+RobPasMue@users.noreply.github.com> Date: Fri, 14 Nov 2025 09:20:27 +0100 Subject: [PATCH 10/10] ci: rename workflow --- .github/workflows/ci_cd_pr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci_cd_pr.yml b/.github/workflows/ci_cd_pr.yml index 4dc4706..647bbb8 100644 --- a/.github/workflows/ci_cd_pr.yml +++ b/.github/workflows/ci_cd_pr.yml @@ -1,4 +1,4 @@ -name: GitHub CI/CD +name: pull-request on: pull_request: types: [opened, reopened, synchronize, edited, labeled, closed]