Skip to content

ci: fix failing deployment by updating the github workflow from cookiecutter's#119

Merged
jourdain merged 3 commits into
Kitware:masterfrom
UlysseDurand:update-github-workflow
Jun 9, 2026
Merged

ci: fix failing deployment by updating the github workflow from cookiecutter's#119
jourdain merged 3 commits into
Kitware:masterfrom
UlysseDurand:update-github-workflow

Conversation

@UlysseDurand

@UlysseDurand UlysseDurand commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

Automatic deployment failed on last merge: https://github.com/Kitware/trame-vtk/actions/runs/26819578811/job/79070621138 because the PR #108 uses uv and the github workflow wasn't updated to install it.

  • The volume rendering test failed because the imagedata_serializer function must have requested_fields as an optional argument with a default value (I broke that in my last PR Maintenance pre-commit and picture #108)
  • The pyproject which was updated using the cookiecutter's now uses uv, the github workflow wasn't updated with the cookiecutter's one so uv was not installed.

Here is the diff between the proposed .github/workflows/test_and_release.yml here and the cookiecutter's one (modulo some spaces/line breaks).

--- .github/workflows/cookiecutters_test_and_release.yml        2026-06-03 11:39:24.601017588 +0200
+++ .github/workflows/test_and_release.yml      2026-06-03 15:33:33.933531850 +0200
@@ -1,101 +1,140 @@
 name: Test and Release
 
 on:
   push:
-    branches: [ main ]
+    branches: [master]
   pull_request:
-    branches: [ main ]
+    branches: [master]
 
 jobs:
   pre-commit:
     runs-on: ubuntu-latest
     env:
       UV_PYTHON: "3.12"
     steps:
       - uses: actions/checkout@v6
       - name: Install uv
         uses: astral-sh/setup-uv@v6
         with:
           version: "0.8.12"
           enable-cache: true
 
       - name: Install the project
         run: uv sync --all-extras --dev
 
       # Install and run pre-commit
       - run: |
           uv run pre-commit install
           uv run pre-commit install --hook-type commit-msg
           uv run pre-commit run --all-files
 
   pytest:
     name: Pytest ${{ matrix.config.name }}
     runs-on: ${{ matrix.config.os }}
     strategy:
       fail-fast: false
       matrix:
         python-version: ["3.12"]
         config:
           - { name: "Linux", os: ubuntu-latest }
-          - {
-              name: "MacOSX",
-              os: macos-latest
-            }
-          - {
-              name: "Windows",
-              os: windows-latest
-            }
+        # - {
+        #     name: "MacOSX",
+        #     os: macos-latest
+        #   }
+        # - {
+        #     name: "Windows",
+        #     os: windows-latest
+        #   }
 
     defaults:
       run:
         shell: bash
 
     steps:
       - name: Checkout
         uses: actions/checkout@v6
 
       - name: Set up Python ${{ matrix.python-version }}
         uses: actions/setup-python@v6
         with:
           python-version: ${{ matrix.python-version }}
+
+      # -----------------------------------------------------------------------
+      # Make that step a manual one and pushing files to the repo
+      # -----------------------------------------------------------------------
+      # - name: Install trame-vtk.js
+      #   run: |
+      #     bash .fetch_externals.sh
+      # -----------------------------------------------------------------------
+
       - name: Install uv
         uses: astral-sh/setup-uv@v6
         with:
           version: "0.8.12"
           enable-cache: true
 
+      - name: Install OSMesa for Linux
+        if: matrix.config.os == 'ubuntu-latest'
+        run: |
+          sudo apt-get update
+          sudo apt-get install -y libosmesa6-dev
+
       - name: Install and Run Tests
         run: |
           uv sync --dev
           uv pip install -r tests/requirements.txt
-          uv run pytest -s ./tests
+          uv run playwright install
+          uv run pytest -s ./tests --cov=src --cov-report=xml
+
+      - name: Upload Coverage to Codecov
+        uses: codecov/codecov-action@v3
+
+      - name: Upload pytest test results
+        uses: actions/upload-artifact@v4
+        if: always()
+        with:
+          name: pytest-results-${{  matrix.config.name }}
+          path: |
+            tests/refs/*.yml
+            tests/refs/**/*.png
+            assets/**
+          retention-days: 1
 
   release:
     needs: [pre-commit, pytest]
     runs-on: ubuntu-latest
-    environment: release
+    if: github.event_name == 'push'
+    environment:
+      name: pypi
+      url: https://pypi.org/p/trame
     permissions:
       id-token: write # IMPORTANT: mandatory for trusted publishing
       contents: write # IMPORTANT: mandatory for making GitHub Releases
+      attestations: write # IMPORTANT: mandatory for attest build provenance
 
     steps:
       - name: Checkout
         uses: actions/checkout@v6
         with:
           fetch-depth: 0
 
+      - name: Install trame-vtk.js
+        run: |
+          bash .fetch_externals.sh
+
       - name: Python Semantic Release
         id: release
         uses: python-semantic-release/python-semantic-release@v10.5.3
         with:
           github_token: ${{ secrets.GITHUB_TOKEN }}
 
       - name: Generate artifact attestation for sdist and wheel
         if: steps.release.outputs.released == 'true'
         uses: actions/attest-build-provenance@v4.1.0
         with:
           subject-path: "dist/*"
 
       # https://docs.pypi.org/trusted-publishers/using-a-publisher/
-      - uses: pypa/gh-action-pypi-publish@release/v1
+      - name: Publish package distributions to PyPI
         if: steps.release.outputs.released == 'true'
+        uses: pypa/gh-action-pypi-publish@release/v1

@jourdain jourdain merged commit 691f183 into Kitware:master Jun 9, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants