From 71c2569ec65483379946ee2fc3189ca7100ed2cc Mon Sep 17 00:00:00 2001 From: viseshrp Date: Mon, 9 Dec 2024 10:02:52 -0500 Subject: [PATCH 1/5] add serverless to smoketest --- .github/workflows/nightly.yml | 1 - Makefile | 3 +-- tests/smoketest.py | 50 +++++++++++++++++++++++++++++++++++ 3 files changed, 51 insertions(+), 3 deletions(-) create mode 100644 tests/smoketest.py diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index c8583168a..ebfeb48aa 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -10,7 +10,6 @@ env: PACKAGE_NAME: 'ansys-dynamicreporting-core' PACKAGE_NAMESPACE: 'ansys.dynamicreporting.core' - jobs: nightly_test: diff --git a/Makefile b/Makefile index d5dc7fa0e..eb197bcdb 100644 --- a/Makefile +++ b/Makefile @@ -31,8 +31,7 @@ test: pytest -rvx --setup-show --cov=ansys.dynamicreporting.core --cov-report html:coverage-html --cov-report term --cov-report xml:coverage.xml smoketest: - python -c "from ansys.dynamicreporting.core import __version__; print(__version__)" - python -c "from ansys.dynamicreporting.core import Service" + python tests/smoketest.py clean: rm -rf dist build diff --git a/tests/smoketest.py b/tests/smoketest.py new file mode 100644 index 000000000..b7002de19 --- /dev/null +++ b/tests/smoketest.py @@ -0,0 +1,50 @@ +# version +# ADR service core +from ansys.dynamicreporting.core import Item, Report, Service, __version__ + +# ADR serverless core +from ansys.dynamicreporting.core.serverless import ( + ADR, + HTML, + Animation, + BasicLayout, + BoxLayout, + CarouselLayout, + DataFilterLayout, + Dataset, + File, + FooterLayout, + HeaderLayout, + Image, +) +from ansys.dynamicreporting.core.serverless import ( + ItemsComparisonGenerator, + IteratorGenerator, + IteratorLayout, + PanelLayout, + PPTXLayout, + PPTXSlideLayout, + ReportLinkLayout, + Scene, + Session, + SliderLayout, + SQLQueryGenerator, + StatisticalGenerator, + String, + TabLayout, + Table, + TableMergeGenerator, + TableMergeRCFilterGenerator, + TableMergeValueFilterGenerator, + TableReduceGenerator, + TableSortFilterGenerator, + TagPropertyLayout, + Template, + TOCLayout, + Tree, + TreeMergeGenerator, + UserDefinedLayout, +) +from ansys.dynamicreporting.core.serverless import Item as ServerlessItem + +print(__version__) From 818f670dfbb069664aad0db6a3a51d09df1d574d Mon Sep 17 00:00:00 2001 From: viseshrp Date: Mon, 9 Dec 2024 17:26:54 -0500 Subject: [PATCH 2/5] rename smoketest --- .github/workflows/ci_cd.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci_cd.yml b/.github/workflows/ci_cd.yml index 36d546b89..6a3838d58 100644 --- a/.github/workflows/ci_cd.yml +++ b/.github/workflows/ci_cd.yml @@ -44,7 +44,7 @@ jobs: # with: # token: ${{ secrets.GITHUB_TOKEN }} - smoke-tests: + smoketest: name: Build and smoke tests runs-on: ${{ matrix.os }} needs: [ style ] @@ -54,16 +54,19 @@ jobs: os: [ ubuntu-latest, windows-latest ] python-version: [ '3.10', '3.11', '3.12', '3.13' ] steps: - - name: Build wheelhouse and perform smoke test + - name: Build wheelhouse uses: ansys/actions/build-wheelhouse@v8 with: library-name: ${{ env.PACKAGE_NAME }} operating-system: ${{ matrix.os }} python-version: ${{ matrix.python-version }} + # 1. build the wheel + # 2. install the wheel + # 3. run the smoke tests test: name: Testing - needs: [ smoke-tests ] + needs: [ smoketest ] runs-on: ${{ matrix.os }} strategy: matrix: From f73c1d9810b44e5d4f9f3f98d7f2f64c9caf7c41 Mon Sep 17 00:00:00 2001 From: viseshrp Date: Tue, 10 Dec 2024 16:48:12 -0500 Subject: [PATCH 3/5] fix teams notifications --- .github/workflows/ci_cd.yml | 4 ++-- .github/workflows/nightly.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci_cd.yml b/.github/workflows/ci_cd.yml index 17b627d7d..ec55fa40c 100644 --- a/.github/workflows/ci_cd.yml +++ b/.github/workflows/ci_cd.yml @@ -192,7 +192,7 @@ jobs: uses: jdcargile/ms-teams-notification@v1.4 with: github-token: ${{ github.token }} # this will use the runner's token. - ms-teams-webhook-uri: ${{ secrets.MS_TEAMS_WEBHOOK_URI }} - notification-summary: GitHub CI failure - ${{ github.event.pull_request.title }} + ms-teams-webhook-uri: ${{ secrets.MS_TEAMS_WEBHOOK_URI_CI }} + notification-summary: CI build failure - ${{ github.event.pull_request.title }} notification-color: dc3545 timezone: America/New_York diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index ebfeb48aa..67be3f0ba 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -80,7 +80,7 @@ jobs: uses: jdcargile/ms-teams-notification@v1.4 with: github-token: ${{ github.token }} - ms-teams-webhook-uri: ${{ secrets.MS_TEAMS_WEBHOOK_URI }} - notification-summary: Nightly failure + ms-teams-webhook-uri: ${{ secrets.MS_TEAMS_WEBHOOK_URI_NIGHTLY }} + notification-summary: Nightly build failure notification-color: dc3545 timezone: America/New_York From 1877e7040b5469551a35f966bf34512033a9cc5c Mon Sep 17 00:00:00 2001 From: viseshrp Date: Tue, 10 Dec 2024 17:14:24 -0500 Subject: [PATCH 4/5] update CI deps Revert "update imports" This reverts commit 360718b4915fcb117ed74ae9b58a505d4c6214e8. Update ci_cd.yml update imports --- .github/workflows/ci_cd.yml | 12 ++++++------ .github/workflows/nightly.yml | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci_cd.yml b/.github/workflows/ci_cd.yml index ec55fa40c..d1792b7d6 100644 --- a/.github/workflows/ci_cd.yml +++ b/.github/workflows/ci_cd.yml @@ -112,7 +112,7 @@ jobs: docs: name: Build docs runs-on: ubuntu-latest - # needs: [docs-style] +# needs: [docs-style] steps: - name: Run Ansys documentation building action uses: ansys/actions/doc-build@v8 @@ -123,7 +123,7 @@ jobs: package: name: Package library - needs: [ test, docs ] + needs: [ test ] runs-on: ubuntu-latest steps: - name: Build library source and wheel artifacts @@ -155,7 +155,7 @@ jobs: name: Upload dev documentation if: github.ref == 'refs/heads/main' runs-on: ubuntu-latest - needs: [ package ] + needs: [ docs, package ] steps: - name: Deploy the latest documentation uses: ansys/actions/doc-deploy-dev@v8 @@ -170,7 +170,7 @@ jobs: name: Upload release documentation if: github.event_name == 'push' && contains(github.ref, 'refs/tags') runs-on: ubuntu-latest - needs: [ release ] + needs: [ docs, release ] steps: - name: Deploy the stable documentation uses: ansys/actions/doc-deploy-stable@v8 @@ -184,7 +184,7 @@ jobs: build-failure: name: Teams notify on failure if: failure() && (github.event_name == 'pull_request' || github.ref == 'refs/heads/main' || github.ref_type == 'tag') - needs: [ style, test ] + needs: [ package ] runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -193,6 +193,6 @@ jobs: with: github-token: ${{ github.token }} # this will use the runner's token. ms-teams-webhook-uri: ${{ secrets.MS_TEAMS_WEBHOOK_URI_CI }} - notification-summary: CI build failure - ${{ github.event.pull_request.title }} + notification-summary: CI build failure notification-color: dc3545 timezone: America/New_York diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 67be3f0ba..51d987067 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -72,7 +72,7 @@ jobs: build-failure: name: Teams notify on failure if: failure() - needs: [ nightly_test, nightly_and_upload ] + needs: [ nightly_and_upload ] runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 From af56be5bdd16e99e0d150d6fc570865623645b49 Mon Sep 17 00:00:00 2001 From: viseshrp Date: Thu, 12 Dec 2024 13:18:59 -0500 Subject: [PATCH 5/5] improve smoketest --- .github/workflows/ci_cd.yml | 9 ++++++--- codegen/rename_whl.py | 2 ++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci_cd.yml b/.github/workflows/ci_cd.yml index d1792b7d6..737a575ab 100644 --- a/.github/workflows/ci_cd.yml +++ b/.github/workflows/ci_cd.yml @@ -60,9 +60,12 @@ jobs: library-name: ${{ env.PACKAGE_NAME }} operating-system: ${{ matrix.os }} python-version: ${{ matrix.python-version }} - # 1. build the wheel - # 2. install the wheel - # 3. run the smoke tests + + - name: Install library + run: python --version && python -m pip install ${{ env.install_target }} + + - name: Run smoketest + run: make smoketest test: name: Testing diff --git a/codegen/rename_whl.py b/codegen/rename_whl.py index e007cc877..9cfdee561 100644 --- a/codegen/rename_whl.py +++ b/codegen/rename_whl.py @@ -8,6 +8,7 @@ if len(chunks) == 5: chunks.insert(2, date_tag) new_name = "-".join(chunks) + print(f"Renaming {name} to {new_name}...") os.rename(name, new_name) for name in glob.glob("dist/*.tar.gz"): @@ -15,4 +16,5 @@ if len(chunks) == 5: chunks[2] = f"{chunks[2]}-{date_tag}" new_name = ".".join(chunks) + print(f"Renaming {name} to {new_name}...") os.rename(name, new_name)