From e1db1085c97476739831adfa08df06a3aeba6690 Mon Sep 17 00:00:00 2001 From: Jan-Willem Date: Fri, 9 Jan 2026 09:12:11 -0500 Subject: [PATCH 1/3] Move to using gh-actions-templates-public. --- .github/workflows/black.yml | 2 +- .github/workflows/python-publish.yml | 2 +- .github/workflows/python-testing-integration.yml | 2 +- .github/workflows/python-testing-linux.yml | 2 +- .github/workflows/python-testing-macos.yml | 4 ++-- .github/workflows/run-ipynb.yml | 6 +++--- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/black.yml b/.github/workflows/black.yml index 4f45595..6719db3 100644 --- a/.github/workflows/black.yml +++ b/.github/workflows/black.yml @@ -3,4 +3,4 @@ on: [push, pull_request] jobs: call-testing-linux: - uses: casangi/toolviper/.github/workflows/black-template.yml@main \ No newline at end of file + uses: nrao/gh-actions-templates-public/.github/workflows/black-template.yml@main \ No newline at end of file diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index 4932049..342782d 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -13,7 +13,7 @@ jobs: # run: echo "2 PYPI_TOKEN=${{ secrets.PYPI_TOKEN }}" call-publish: - uses: casangi/toolviper/.github/workflows/python-publish-template.yml@main + uses: nrao/gh-actions-templates-public/.github/workflows/python-publish-template.yml@main with: pypi-url: "https://pypi.org/project/toolviper" secrets: inherit \ No newline at end of file diff --git a/.github/workflows/python-testing-integration.yml b/.github/workflows/python-testing-integration.yml index 5899145..a59da8c 100644 --- a/.github/workflows/python-testing-integration.yml +++ b/.github/workflows/python-testing-integration.yml @@ -21,6 +21,6 @@ on: jobs: test: - uses: casangi/toolviper/.github/workflows/python-testing-integration-template.yml@main + uses: nrao/gh-actions-templates-public/.github/workflows/python-testing-integration-template.yml@main secrets: DISPATCH_TOKEN: ${{ secrets.DISPATCH_TOKEN }} diff --git a/.github/workflows/python-testing-linux.yml b/.github/workflows/python-testing-linux.yml index 2d9f58e..66c3eb4 100644 --- a/.github/workflows/python-testing-linux.yml +++ b/.github/workflows/python-testing-linux.yml @@ -19,7 +19,7 @@ jobs: # run: echo "CODECOV_TOKEN=${{ secrets.CODECOV_TOKEN }}" call-testing-linux: - uses: casangi/toolviper/.github/workflows/python-testing-linux-template.yml@main + uses: nrao/gh-actions-templates-public/.github/workflows/python-testing-linux-template.yml@main with: cov_project: "toolviper" test-path: "tests/" diff --git a/.github/workflows/python-testing-macos.yml b/.github/workflows/python-testing-macos.yml index fe1bf1d..1679e2b 100644 --- a/.github/workflows/python-testing-macos.yml +++ b/.github/workflows/python-testing-macos.yml @@ -12,5 +12,5 @@ on: - '**.rst' jobs: - call-testing-linux: - uses: casangi/toolviper/.github/workflows/python-testing-macos-template.yml@main \ No newline at end of file + call-testing-macos: + uses: nrao/gh-actions-templates-public/.github/workflows/python-testing-macos-template.yml@main \ No newline at end of file diff --git a/.github/workflows/run-ipynb.yml b/.github/workflows/run-ipynb.yml index 956460a..237c80a 100644 --- a/.github/workflows/run-ipynb.yml +++ b/.github/workflows/run-ipynb.yml @@ -1,4 +1,4 @@ -# .github/workflows/python-testing-linux.yml +# .github/workflows/run-ipynb.yml name: ipynb Tests on: @@ -12,6 +12,6 @@ on: - '**.rst' jobs: - call-testing-linux: - uses: casangi/toolviper/.github/workflows/run-ipynb-template.yml@main + call-testing-ipynb: + uses: nrao/gh-actions-templates-public/.github/workflows/run-ipynb-template.yml@main secrets: inherit \ No newline at end of file From 2e68d7eabffc75b9050caca04553cf6bb22c19ab Mon Sep 17 00:00:00 2001 From: Jan-Willem Date: Fri, 9 Jan 2026 09:59:09 -0500 Subject: [PATCH 2/3] Test workflow changes in 2-ipynb-workflow-is-getting-stuck. --- .github/workflows/black-template.yml | 12 - .github/workflows/black.yml | 2 +- .../workflows/python-publish-cpp-template.yml | 103 ------ .github/workflows/python-publish-template.yml | 61 ---- .github/workflows/python-publish.yml | 2 +- .../python-testing-casatools-template.yml | 92 ----- .../python-testing-integration-template.yml | 342 ------------------ .../workflows/python-testing-integration.yml | 2 +- .../python-testing-linux-template.yml | 75 ---- .github/workflows/python-testing-linux.yml | 2 +- .../python-testing-macos-template.yml | 55 --- .github/workflows/python-testing-macos.yml | 2 +- .github/workflows/run-ipynb-template.yml | 92 ----- .github/workflows/run-ipynb.yml | 2 +- 14 files changed, 6 insertions(+), 838 deletions(-) delete mode 100644 .github/workflows/black-template.yml delete mode 100644 .github/workflows/python-publish-cpp-template.yml delete mode 100644 .github/workflows/python-publish-template.yml delete mode 100644 .github/workflows/python-testing-casatools-template.yml delete mode 100644 .github/workflows/python-testing-integration-template.yml delete mode 100644 .github/workflows/python-testing-linux-template.yml delete mode 100644 .github/workflows/python-testing-macos-template.yml delete mode 100644 .github/workflows/run-ipynb-template.yml diff --git a/.github/workflows/black-template.yml b/.github/workflows/black-template.yml deleted file mode 100644 index 8ffee1c..0000000 --- a/.github/workflows/black-template.yml +++ /dev/null @@ -1,12 +0,0 @@ -name: Lint - - -on: - workflow_call: - -jobs: - lint: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: psf/black@stable \ No newline at end of file diff --git a/.github/workflows/black.yml b/.github/workflows/black.yml index 6719db3..bc950d2 100644 --- a/.github/workflows/black.yml +++ b/.github/workflows/black.yml @@ -3,4 +3,4 @@ on: [push, pull_request] jobs: call-testing-linux: - uses: nrao/gh-actions-templates-public/.github/workflows/black-template.yml@main \ No newline at end of file + uses: nrao/gh-actions-templates-public/.github/workflows/black-template.yml@2-ipynb-workflow-is-getting-stuck \ No newline at end of file diff --git a/.github/workflows/python-publish-cpp-template.yml b/.github/workflows/python-publish-cpp-template.yml deleted file mode 100644 index 647a1ea..0000000 --- a/.github/workflows/python-publish-cpp-template.yml +++ /dev/null @@ -1,103 +0,0 @@ -name: Build & Publish to PyPI - -on: - workflow_call: - inputs: - pypi-url: - required: true - type: string - -jobs: - build-wheels: - name: Build wheels - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - # macos-13 = Intel (x86_64), macos-14/15 = Apple Silicon (arm64) - # don't need macOS-15 as macos-14 is compatible - os: [ubuntu-latest, macos-13, macos-14] - - steps: - - uses: actions/checkout@v4 - - - name: Set up Python (driver, cibuildwheel installs its own Pythons) - uses: actions/setup-python@v5 - with: - python-version: "3.11" - - - name: Install cibuildwheel - run: python -m pip install --upgrade pip cibuildwheel==2.21.3 - - - name: Show build matrix cibuildwheel sees - run: python -m cibuildwheel --print-build-identifiers - - - name: Build wheels - env: - CIBW_ENVIRONMENT: > - PIP_EXTRA_INDEX_URL="https://pypi.org/simple" - PIP_INDEX_URL="https://test.pypi.org/simple/" - - # Build CPython 3.11, 3.12, 3.13 - CIBW_BUILD: "cp311-* cp312-* cp313-*" - - # Only 64-bit Linux (avoid i686) - CIBW_ARCHS_LINUX: "x86_64" - CIBW_SKIP: "*-musllinux_* *-manylinux_i686" - - # macOS: build only the runner's native arch (prevents duplicates) - CIBW_ARCHS_MACOS: "native" - - # Manylinux baseline for Linux wheels - CIBW_MANYLINUX_X86_64_IMAGE: "manylinux_2_28" - - # Optional quick import test - CIBW_TEST_COMMAND: "python -c \"import astroviper; print(dir(astroviper))\"" - run: | - python -m cibuildwheel --output-dir wheelhouse - - - name: Upload wheel artifacts - uses: actions/upload-artifact@v4 - with: - name: wheels-${{ matrix.os }} - path: wheelhouse/*.whl - - build-sdist: - name: Build sdist - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-python@v5 - with: - python-version: "3.11" - - run: python -m pip install --upgrade pip build - - run: python -m build --sdist - - uses: actions/upload-artifact@v4 - with: - name: sdist - path: dist/*.tar.gz - - publish: - name: Publish to PyPI - needs: [build-wheels, build-sdist] - runs-on: ubuntu-latest - if: startsWith(github.ref, 'refs/tags/') - environment: - name: release - url: ${{ inputs.pypi-url }} - steps: - - uses: actions/download-artifact@v4 - with: - pattern: wheels-* - path: dist - merge-multiple: true - - uses: actions/download-artifact@v4 - with: - name: sdist - path: dist - - name: Publish distribution 📦 to PyPI - uses: pypa/gh-action-pypi-publish@release/v1 - with: - user: "__token__" - password: ${{ secrets.PYPI_TOKEN }} - # skip-existing: true diff --git a/.github/workflows/python-publish-template.yml b/.github/workflows/python-publish-template.yml deleted file mode 100644 index c98a5ef..0000000 --- a/.github/workflows/python-publish-template.yml +++ /dev/null @@ -1,61 +0,0 @@ -# This workflows will upload a Python Package for tagged commits -# For more information see: https://packaging.python.org/en/latest/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/ - -name: Publish Python 🐍 distribution 📦 to PyPI and TestPyPI - -on: - workflow_call: - inputs: - pypi-url: - required: true - type: string - -jobs: - build: - name: Build distribution 📦 - 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 pypa/build - run: | - python3 -m pip install \ - --upgrade pip build \ - --extra-index-url https://test.pypi.org/simple/ \ - --user - - name: Build a source distribution - run: python3 -m build - - name: Store the distribution packages - uses: actions/upload-artifact@v4 - with: - name: python-package-distributions - path: dist/ - - publish-to-pypi: - name: >- - Publish Python 🐍 distribution 📦 to PyPI - if: startsWith(github.ref, 'refs/tags/') # only publish to PyPI on tag pushes - needs: - - build - runs-on: ubuntu-latest - environment: - name: release - url: ${{ inputs.pypi-url }} - - steps: - # - name: Check PYPI_TOKEN - # run: echo "In template PYPI_TOKEN =${{ secrets.PYPI_TOKEN }}" - - name: Download all the dists - uses: actions/download-artifact@v4 - with: - name: python-package-distributions - path: dist/ - - name: Publish distribution 📦 to PyPI - uses: pypa/gh-action-pypi-publish@release/v1 - with: - user: "__token__" - password: ${{ secrets.PYPI_TOKEN }} # Using your pre-generated PyPI token from GitHub secrets diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index 342782d..3d5230d 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -13,7 +13,7 @@ jobs: # run: echo "2 PYPI_TOKEN=${{ secrets.PYPI_TOKEN }}" call-publish: - uses: nrao/gh-actions-templates-public/.github/workflows/python-publish-template.yml@main + uses: nrao/gh-actions-templates-public/.github/workflows/python-publish-template.yml@2-ipynb-workflow-is-getting-stuck with: pypi-url: "https://pypi.org/project/toolviper" secrets: inherit \ No newline at end of file diff --git a/.github/workflows/python-testing-casatools-template.yml b/.github/workflows/python-testing-casatools-template.yml deleted file mode 100644 index f6d4ecf..0000000 --- a/.github/workflows/python-testing-casatools-template.yml +++ /dev/null @@ -1,92 +0,0 @@ -# This workflow will install Python dependencies, run tests and lint with a single version of Python -# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions. - -name: "Python testing with casatools on Linux/macOS (template)" - -on: - workflow_call: - inputs: - python-versions: - required: false - type: string - default: '["3.11", "3.12"]' - test-path: - required: false - type: string - default: "tests/" - cov_project: - required: true - type: string - pytest_ignore: - required: false - type: string - default: "" - -jobs: - build: - strategy: - matrix: - os: ["ubuntu-latest", "macos-latest"] - python-version: ${{ fromJson(inputs.python-versions) }} - runs-on: ${{ matrix.os }} - defaults: - run: - shell: bash -el {0} - steps: - - uses: actions/checkout@v4 - - - name: Setup Conda - uses: conda-incubator/setup-miniconda@v3 - with: - auto-activate-base: false - activate-environment: test - - python-version: ${{ matrix.python-version }} - channels: conda-forge - use-only-tar-bz2: true - show-channel-urls: true - miniforge-version: latest - - - name: Install dependencies with pip - run: | - python -m pip install --upgrade pip - # install the current package - pip install --extra-index-url https://test.pypi.org/simple/ ".[all]" - pip uninstall python-casacore -y - pip install casatools - # trigger `casa-data` fetch - mkdir -p ~/.casa/data && python -c 'import casatools' - - - name: Test with pytest - env: - SKIP_TESTS_CASATOOLS: "1" # Skip tests that require casatasks - run: | - pytest -v ${{ inputs.test-path }} \ - --ignore=${{ inputs.pytest_ignore }} \ - --html=test-results.html --self-contained-html \ - --cov=${{ inputs.cov_project }} --no-cov-on-fail \ - --cov-report=html --cov-report=xml --doctest-modules \ - --junitxml=junit.xml -o junit_family=legacy - - - name: Upload pytest test results and coverage reports - uses: actions/upload-artifact@v4 - with: - name: pytest-results-${{ matrix.os }}-${{ matrix.python-version }}-with-casatools - path: | - ./test-results.html - ./htmlcov - # Use always() to always run this step to publish test results when there are test failures - if: ${{ always() }} - - - name: Upload code coverage results to Codecov - uses: codecov/codecov-action@v5 - with: - token: ${{ secrets.CODECOV_TOKEN }} - slug: ${{ github.repository }} - - - name: Upload test stats to Codecov - if: ${{ !cancelled() }} - uses: codecov/test-results-action@v1 - with: - token: ${{ secrets.CODECOV_TOKEN }} - slug: ${{ github.repository }} diff --git a/.github/workflows/python-testing-integration-template.yml b/.github/workflows/python-testing-integration-template.yml deleted file mode 100644 index cc1773c..0000000 --- a/.github/workflows/python-testing-integration-template.yml +++ /dev/null @@ -1,342 +0,0 @@ -name: Python Testing Integration Template - -#Example how to use: -# jobs: -# test-with-specific-branches: -# uses: casangi/toolviper/.github/workflows/test-integration-template.yml@main -# with: -# toolviper_ref: 'v1.0.0' #optional, default main -# xradio_ref: 'dev' #optional, default main -# graphviper_ref: 'release-candidate' #optional, default main -# astroviper_ref: 'main' #optional, default main - -on: - workflow_call: - inputs: - toolviper_ref: - description: "Branch or tag for ToolVIPER" - required: false - default: "main" - type: string - xradio_ref: - description: "Branch or tag for XRADIO" - required: false - default: "main" - type: string - graphviper_ref: - description: "Branch or tag for GraphVIPER" - required: false - default: "main" - type: string - astroviper_ref: - description: "Branch or tag for AstroVIPER" - required: false - default: "main" - type: string - secrets: - DISPATCH_TOKEN: - required: true - -jobs: - test-all: - runs-on: ubuntu-latest - - strategy: - matrix: - python-version: [3.12] - - steps: - - name: Checkout calling repository (PR version) - uses: actions/checkout@v4 - - - name: Set up Python - uses: actions/setup-python@v5 - with: - python-version: ${{ matrix.python-version }} - - - name: Install core test dependencies - run: | - python -m pip install --upgrade pip - pip install pytest - - - name: Clone and install ToolVIPER - run: | - if [ ! -d "../toolviper" ]; then - ORIGINAL_DIR=$(pwd) - cd .. - git clone --branch "${{ inputs.toolviper_ref }}" https://github.com/casangi/toolviper.git - pip install -e toolviper - cd "$ORIGINAL_DIR" - fi - - - name: Clone and install XRADIO - run: | - if [ ! -d "../xradio" ]; then - ORIGINAL_DIR=$(pwd) - cd .. - git clone --branch "${{ inputs.xradio_ref }}" https://github.com/casangi/xradio.git - pip install -e "xradio[all]" - cd "$ORIGINAL_DIR" - fi - - - name: Clone and install GraphVIPER - run: | - if [ ! -d "../graphviper" ]; then - ORIGINAL_DIR=$(pwd) - cd .. - git clone --branch "${{ inputs.graphviper_ref }}" https://github.com/casangi/graphviper.git - pip install -e "graphviper[all]" - cd "$ORIGINAL_DIR" - fi - - - name: Clone and install AstroVIPER - run: | - if [ ! -d "../astroviper" ]; then - ORIGINAL_DIR=$(pwd) - cd .. - git clone --branch "${{ inputs.astroviper_ref }}" https://github.com/casangi/astroviper.git - pip install -e "astroviper[all]" - cd "$ORIGINAL_DIR" - fi - - - name: Install PR Package - run: | - pip install -e ".[all]" - - - name: Run ToolVIPER tests - run: | - if [ "${{ github.repository }}" = "casangi/toolviper" ]; then - pytest tests - pytest tests_integration - else - pytest ../toolviper/tests - pytest ../toolviper/tests_integration - fi - - - name: Run XRADIO tests - run: | - if [ "${{ github.repository }}" = "casangi/xradio" ]; then - pytest tests - else - pytest ../xradio/tests - fi - - - name: Run GraphVIPER tests - run: | - if [ "${{ github.repository }}" = "casangi/graphviper" ]; then - pytest tests - else - pytest ../graphviper/tests - fi - - - name: Run AstroVIPER tests - run: | - if [ "${{ github.repository }}" = "casangi/astroviper" ]; then - pytest tests - else - pytest ../astroviper/tests - fi - - dispatch-integration-tests: - runs-on: ubuntu-latest - needs: test-all - if: github.event_name == 'push' && github.ref == 'refs/heads/main' - - steps: - - name: Log dispatch attempt - run: | - echo "🚀 Preparing to send repository dispatch to testviper..." - echo "📦 Repository: ${{ github.repository }}" - echo "🌿 Branch: ${{ github.ref }}" - echo "🔑 Commit: ${{ github.sha }}" - echo "👤 Actor: ${{ github.actor }}" - echo "⚙️ Workflow: ${{ github.workflow }}" - echo "🆔 Run ID: ${{ github.run_id }}" - echo "🔢 Run Number: ${{ github.run_number }}" - - - name: Repository Dispatch to testviper - uses: actions/github-script@v6 - with: - github-token: ${{ secrets.DISPATCH_TOKEN }} - script: | - const payload = { - event_type: 'integration-test-trigger', - client_payload: { - repository: '${{ github.repository }}', - ref: '${{ github.ref }}', - sha: '${{ github.sha }}', - actor: '${{ github.actor }}', - workflow: '${{ github.workflow }}', - run_id: '${{ github.run_id }}', - run_number: '${{ github.run_number }}' - } - }; - - // Send repository dispatch to target repository - await github.rest.repos.createDispatchEvent({ - owner: 'casangi', - repo: 'testviper', - event_type: payload.event_type, - client_payload: payload.client_payload - }); - - // Note: repository_dispatch is repository-wide and not branch-specific. - - console.log('Repository dispatch sent successfully to testviper'); - - - name: Log dispatch success - run: | - echo "✅ Repository dispatch sent successfully to testviper!" - echo "📋 Event type: integration-test-trigger" - echo "🎯 Target: casangi/testviper (branch: main)" - echo "📝 Check testviper Actions tab for integration test execution" - - -# jobs: -# test-all: -# runs-on: ubuntu-latest - -# strategy: -# matrix: -# python-version: [3.12] - -# steps: -# - name: 1. Show working directory -# run: | -# echo "Current working directory:" -# pwd -# ls -al - -# - name: Checkout calling repository (PR version) -# uses: actions/checkout@v4 - -# - name: 2. Show working directory -# run: | -# echo "Current working directory:" -# pwd - -# - name: Set up Python -# uses: actions/setup-python@v5 -# with: -# python-version: ${{ matrix.python-version }} - -# - name: Install core test dependencies -# run: | -# python -m pip install --upgrade pip -# pip install pytest - -# - name: 3. Show working directory -# run: | -# echo "Current working directory:" -# pwd - -# # For debugging -# # - name: Print Statements -# # run: | -# # echo "1 github.repository_owner=casangi" -# # echo "2 github.repository=${{ github.repository }}" -# # echo "3 casangi/toolviper" - -# # 1. If no ToolVIPER install from main -# - name: Clone and install ToolVIPER (main) -# if: github.repository != 'casangi/toolviper' -# run: | -# ORIGINAL_DIR=$(pwd) -# cd .. -# git clone https://github.com/casangi/toolviper.git -# pip install -e toolviper -# cd "$ORIGINAL_DIR" - -# - name: 4. Show working directory -# run: | -# echo "Current working directory:" -# pwd -# ls -al - -# # 2. If no XRADIO install from main -# - name: Clone and install XRADIO (main) -# if: github.repository != 'casangi/xradio' -# run: | -# ORIGINAL_DIR=$(pwd) -# cd .. -# git clone https://github.com/casangi/xradio.git -# pip install -e xradio -# cd "$ORIGINAL_DIR" - -# # 3. If no GraphVIPER install from main -# - name: Clone and install GraphVIPER (main) -# if: github.repository != 'casangi/graphviper' -# run: | -# ORIGINAL_DIR=$(pwd) -# cd .. -# git clone https://github.com/casangi/graphviper.git -# pip install -e graphviper -# cd "$ORIGINAL_DIR" - -# # 4. If no AstroVIPER install from main -# - name: Clone and install AstroVIPER (main) -# if: github.repository != 'casangi/astroviper' -# run: | -# ORIGINAL_DIR=$(pwd) -# cd .. -# git clone https://github.com/casangi/astroviper.git -# pip install -e astroviper -# cd "$ORIGINAL_DIR" - -# - name: 5. Show working directory -# run: | -# echo "Current working directory:" -# pwd -# ls -al - -# - name: Install PR Package -# run: | -# pip install -e . - -# - name: 6. Show working directory -# run: | -# echo "Current working directory:" -# pwd -# ls -al - -# # - name: Debug ToolVIPER install -# # run: | -# # python -c "import toolviper; print(dir(toolviper))" -# # pip list | grep toolviper -# # find $(python -c 'import toolviper; import os; print(os.path.dirname(toolviper.__file__))') - -# # 5. Run tests -# - name: Run ToolVIPER tests -# run: | -# if [ "${{ github.repository }}" = "casangi/toolviper" ]; then -# pytest tests -# pytest tests_integration -# else -# pytest ../toolviper/tests -# pytest ../toolviper/tests_integration -# fi - -# - name: Run XRADIO tests -# run: | -# if [ "${{ github.repository }}" = "casangi/xradio" ]; then -# pytest tests -# else -# pytest ../xradio/tests -# fi - -# - name: Run GraphVIPER tests -# run: | -# if [ "${{ github.repository }}" = "casangi/graphviper" ]; then -# pytest tests -# else -# pytest ../graphviper/tests -# fi - -# - name: Run AstroVIPER tests -# run: | -# if [ "${{ github.repository }}" = "casangi/astroviper" ]; then -# pytest tests -# else -# pytest ../astroviper/tests -# fi - diff --git a/.github/workflows/python-testing-integration.yml b/.github/workflows/python-testing-integration.yml index a59da8c..92e9ef5 100644 --- a/.github/workflows/python-testing-integration.yml +++ b/.github/workflows/python-testing-integration.yml @@ -21,6 +21,6 @@ on: jobs: test: - uses: nrao/gh-actions-templates-public/.github/workflows/python-testing-integration-template.yml@main + uses: nrao/gh-actions-templates-public/.github/workflows/python-testing-integration-template.yml@2-ipynb-workflow-is-getting-stuck secrets: DISPATCH_TOKEN: ${{ secrets.DISPATCH_TOKEN }} diff --git a/.github/workflows/python-testing-linux-template.yml b/.github/workflows/python-testing-linux-template.yml deleted file mode 100644 index 034cf20..0000000 --- a/.github/workflows/python-testing-linux-template.yml +++ /dev/null @@ -1,75 +0,0 @@ -# This workflow will install Python dependencies, run tests and lint with a single version of Python -# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions. - -name: "Python testing on Linux (template)" - -on: - workflow_call: - inputs: - python-versions: - required: false - type: string - default: '["3.11", "3.12", "3.13"]' - test-path: - required: false - type: string - default: "tests/" - cov_project: - required: true - type: string - -jobs: - build: - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [ubuntu-latest] - python-version: ${{ fromJson(inputs.python-versions) }} - steps: - - uses: actions/checkout@v4 - - - name: Set up Python 3 - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python-version }} - - - name: Install dependencies with pip - run: | - python -m pip install --upgrade pip - pip install \ - --index-url https://pypi.org/simple \ - --extra-index-url https://test.pypi.org/simple/ \ - ".[all]" - - name: Test with pytest - run: | - pytest -v ${{ inputs.test-path }} \ - --html=test-results.html --self-contained-html \ - --cov=${{ inputs.cov_project }} --no-cov-on-fail \ - --cov-report=html --cov-report=xml --doctest-modules \ - --junitxml=junit.xml -o junit_family=legacy - - - name: Upload pytest test results and coverage reports - uses: actions/upload-artifact@v4 - with: - name: pytest-results-${{ matrix.python-version }} - path: | - ./test-results.html - ./htmlcov - # Use always() to always run this step to publish test results when there are test failures - if: ${{ always() }} - - # - name: Check CODECOV_TOKEN - # run: echo "CODECOV_TOKEN=${{ secrets.CODECOV_TOKEN }}" - - - name: Upload code coverage results to Codecov - uses: codecov/codecov-action@v5 - with: - token: ${{ secrets.CODECOV_TOKEN }} # Use the passed token from workflow_call - slug: ${{ github.repository }} - - - name: Upload test stats to Codecov - if: ${{ !cancelled() }} - uses: codecov/test-results-action@v1 - with: - token: ${{ secrets.CODECOV_TOKEN }} - slug: ${{ github.repository }} diff --git a/.github/workflows/python-testing-linux.yml b/.github/workflows/python-testing-linux.yml index 66c3eb4..bfcb2ac 100644 --- a/.github/workflows/python-testing-linux.yml +++ b/.github/workflows/python-testing-linux.yml @@ -19,7 +19,7 @@ jobs: # run: echo "CODECOV_TOKEN=${{ secrets.CODECOV_TOKEN }}" call-testing-linux: - uses: nrao/gh-actions-templates-public/.github/workflows/python-testing-linux-template.yml@main + uses: nrao/gh-actions-templates-public/.github/workflows/python-testing-linux-template.yml@2-ipynb-workflow-is-getting-stuck with: cov_project: "toolviper" test-path: "tests/" diff --git a/.github/workflows/python-testing-macos-template.yml b/.github/workflows/python-testing-macos-template.yml deleted file mode 100644 index 52a8ab0..0000000 --- a/.github/workflows/python-testing-macos-template.yml +++ /dev/null @@ -1,55 +0,0 @@ -name: "Python testing on MacOS (template)" - -on: - workflow_call: - inputs: - python-versions: - required: false - type: string - default: '["3.11", "3.12", "3.13"]' - test-path: - required: false - type: string - default: "tests/" - -jobs: - build: - name: macos (${{ matrix.python-version }}, ${{ matrix.os }}) - runs-on: ${{ matrix.os }} - defaults: - run: - shell: bash -l {0} - strategy: - fail-fast: false - matrix: - os: ["macos-latest"] - python-version: ${{ fromJson(inputs.python-versions) }} - steps: - - name: Keep alive - run: | - while true; do echo "Still running..."; sleep 300; done & - - name: Setup Conda - uses: conda-incubator/setup-miniconda@v3 - with: - auto-activate-base: false - activate-environment: test - auto-update-conda: true - python-version: ${{ matrix.python-version }} - channels: conda-forge - channel-priority: strict - - # 📌 Pin libboost-python, to avoid not finding libboost_graph.dylib error - - name: Pin boost version - run: conda install libboost-python=1.86.0 - - - run: conda install python-casacore - - - uses: actions/checkout@v4 - - - name: Install dependencies with pip - run: | - python -m pip install --upgrade pip - python -m pip install --extra-index-url https://test.pypi.org/simple/ ".[all]" - - - name: Test with pytest - run: pytest ${{ inputs.test-path }} diff --git a/.github/workflows/python-testing-macos.yml b/.github/workflows/python-testing-macos.yml index 1679e2b..cfd1f49 100644 --- a/.github/workflows/python-testing-macos.yml +++ b/.github/workflows/python-testing-macos.yml @@ -13,4 +13,4 @@ on: jobs: call-testing-macos: - uses: nrao/gh-actions-templates-public/.github/workflows/python-testing-macos-template.yml@main \ No newline at end of file + uses: nrao/gh-actions-templates-public/.github/workflows/python-testing-macos-template.yml@2-ipynb-workflow-is-getting-stuck \ No newline at end of file diff --git a/.github/workflows/run-ipynb-template.yml b/.github/workflows/run-ipynb-template.yml deleted file mode 100644 index f23fb5e..0000000 --- a/.github/workflows/run-ipynb-template.yml +++ /dev/null @@ -1,92 +0,0 @@ -name: ipynb Tests - -on: - workflow_call: - -jobs: - build: - name: ipynb (${{ matrix.python-version }}, ${{ matrix.os }}) - runs-on: ${{ matrix.os }} - defaults: - run: - shell: bash -l {0} - env: - MPLBACKEND: Agg - OMP_NUM_THREADS: "1" - OPENBLAS_NUM_THREADS: "1" - MKL_NUM_THREADS: "1" - NUMEXPR_NUM_THREADS: "1" - JUPYTER_CLIENT_DEBUG: "1" - - strategy: - fail-fast: false - matrix: - os: [ubuntu-latest] - python-version: ["3.12"] - steps: - - name: Setup Conda - uses: conda-incubator/setup-miniconda@v3 - with: - auto-activate-base: false - activate-environment: test - auto-update-conda: true - python-version: ${{ matrix.python-version }} - #channels: conda-forge - - - run: | - conda config --add channels conda-forge - conda install -c conda-forge graphviz - - - uses: actions/checkout@v4 - - - name: Install dependencies with pip - run: | - python -m pip install --upgrade pip - pip install --extra-index-url https://test.pypi.org/simple/ ".[all]" #The magic if not present download fails in ipynb - pip install graphviz - pip install holoviews - - - name: Run Jupyter notebooks with localized cleanup - run: | - ORIGINAL_DIR=$(pwd) - - # Initial check (optional but good practice) - echo "Starting notebook execution loop..." - - for notebook in $(find docs -name '*.ipynb'); do - echo "--- Running notebook: $notebook ---" - - NOTEBOOK_DIR=$(dirname "$notebook") - NOTEBOOK_FILE=$(basename "$notebook") - - # Change directory to the notebook's location - cd "$NOTEBOOK_DIR" - - # 1. Execute the notebook - # The execution creates the large files (.zarr, .ms, etc.) in the current directory. - jupyter nbconvert --to notebook --execute "$NOTEBOOK_FILE" --output "$NOTEBOOK_FILE" \ - --ExecutePreprocessor.timeout=1800 \ - --ExecutePreprocessor.iopub_timeout=1800 \ - --Application.log_level=INFO - - # 2. Localized Cleanup: Delete all .zarr and .ms files/directories - # ONLY within the current NOTEBOOK_DIR. - echo "Performing localized cleanup in $(pwd)..." - - # Delete all .zarr directories (recursive) - find . -maxdepth 1 -name '*.zarr' -type d -exec rm -rf {} + - - # Delete all .ms files - find . -maxdepth 1 -name '*.ms' -type f -exec rm -f {} + - - # 3. Return to the original directory - cd "$ORIGINAL_DIR" - - # 4. Introduce a pause - # This pause is still crucial for allowing the OS to fully release memory and - # file handles before the next Jupyter kernel is launched. - echo "Pausing for 5 seconds to release resources..." - sleep 5 - - echo "--- Notebook execution complete. ---" - done diff --git a/.github/workflows/run-ipynb.yml b/.github/workflows/run-ipynb.yml index 237c80a..e9fed90 100644 --- a/.github/workflows/run-ipynb.yml +++ b/.github/workflows/run-ipynb.yml @@ -13,5 +13,5 @@ on: jobs: call-testing-ipynb: - uses: nrao/gh-actions-templates-public/.github/workflows/run-ipynb-template.yml@main + uses: nrao/gh-actions-templates-public/.github/workflows/run-ipynb-template.yml@2-ipynb-workflow-is-getting-stuck secrets: inherit \ No newline at end of file From 4a6d9546b8f9ddfd45ee7eb751e0fd3a788a3a58 Mon Sep 17 00:00:00 2001 From: Jan-Willem Date: Fri, 9 Jan 2026 15:42:53 -0500 Subject: [PATCH 3/3] Point back to gh-actions-templates-public main. --- .github/workflows/black.yml | 2 +- .github/workflows/python-publish.yml | 2 +- .github/workflows/python-testing-integration.yml | 2 +- .github/workflows/python-testing-linux.yml | 2 +- .github/workflows/python-testing-macos.yml | 2 +- .github/workflows/run-ipynb.yml | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/black.yml b/.github/workflows/black.yml index bc950d2..6719db3 100644 --- a/.github/workflows/black.yml +++ b/.github/workflows/black.yml @@ -3,4 +3,4 @@ on: [push, pull_request] jobs: call-testing-linux: - uses: nrao/gh-actions-templates-public/.github/workflows/black-template.yml@2-ipynb-workflow-is-getting-stuck \ No newline at end of file + uses: nrao/gh-actions-templates-public/.github/workflows/black-template.yml@main \ No newline at end of file diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index 3d5230d..342782d 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -13,7 +13,7 @@ jobs: # run: echo "2 PYPI_TOKEN=${{ secrets.PYPI_TOKEN }}" call-publish: - uses: nrao/gh-actions-templates-public/.github/workflows/python-publish-template.yml@2-ipynb-workflow-is-getting-stuck + uses: nrao/gh-actions-templates-public/.github/workflows/python-publish-template.yml@main with: pypi-url: "https://pypi.org/project/toolviper" secrets: inherit \ No newline at end of file diff --git a/.github/workflows/python-testing-integration.yml b/.github/workflows/python-testing-integration.yml index 92e9ef5..a59da8c 100644 --- a/.github/workflows/python-testing-integration.yml +++ b/.github/workflows/python-testing-integration.yml @@ -21,6 +21,6 @@ on: jobs: test: - uses: nrao/gh-actions-templates-public/.github/workflows/python-testing-integration-template.yml@2-ipynb-workflow-is-getting-stuck + uses: nrao/gh-actions-templates-public/.github/workflows/python-testing-integration-template.yml@main secrets: DISPATCH_TOKEN: ${{ secrets.DISPATCH_TOKEN }} diff --git a/.github/workflows/python-testing-linux.yml b/.github/workflows/python-testing-linux.yml index bfcb2ac..66c3eb4 100644 --- a/.github/workflows/python-testing-linux.yml +++ b/.github/workflows/python-testing-linux.yml @@ -19,7 +19,7 @@ jobs: # run: echo "CODECOV_TOKEN=${{ secrets.CODECOV_TOKEN }}" call-testing-linux: - uses: nrao/gh-actions-templates-public/.github/workflows/python-testing-linux-template.yml@2-ipynb-workflow-is-getting-stuck + uses: nrao/gh-actions-templates-public/.github/workflows/python-testing-linux-template.yml@main with: cov_project: "toolviper" test-path: "tests/" diff --git a/.github/workflows/python-testing-macos.yml b/.github/workflows/python-testing-macos.yml index cfd1f49..1679e2b 100644 --- a/.github/workflows/python-testing-macos.yml +++ b/.github/workflows/python-testing-macos.yml @@ -13,4 +13,4 @@ on: jobs: call-testing-macos: - uses: nrao/gh-actions-templates-public/.github/workflows/python-testing-macos-template.yml@2-ipynb-workflow-is-getting-stuck \ No newline at end of file + uses: nrao/gh-actions-templates-public/.github/workflows/python-testing-macos-template.yml@main \ No newline at end of file diff --git a/.github/workflows/run-ipynb.yml b/.github/workflows/run-ipynb.yml index e9fed90..237c80a 100644 --- a/.github/workflows/run-ipynb.yml +++ b/.github/workflows/run-ipynb.yml @@ -13,5 +13,5 @@ on: jobs: call-testing-ipynb: - uses: nrao/gh-actions-templates-public/.github/workflows/run-ipynb-template.yml@2-ipynb-workflow-is-getting-stuck + uses: nrao/gh-actions-templates-public/.github/workflows/run-ipynb-template.yml@main secrets: inherit \ No newline at end of file