Skip to content

Refactor wasm CI#1835

Merged
shimat merged 3 commits intomainfrom
refactor_wasm
Mar 2, 2026
Merged

Refactor wasm CI#1835
shimat merged 3 commits intomainfrom
refactor_wasm

Conversation

@shimat
Copy link
Owner

@shimat shimat commented Mar 2, 2026

Summary by CodeRabbit

  • Chores
    • Improved WebAssembly build pipeline with expanded cache restoration and saving for OpenCV artifacts.
    • Switched to a consistent CMake-based compilation and install workflow to reduce build fragility and directory-related issues.
    • Updated native packaging steps for the OpenCvSharp runtime to use the new build layout for more reliable artifact creation.

@shimat shimat self-assigned this Mar 2, 2026
@coderabbitai
Copy link

coderabbitai bot commented Mar 2, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 772584f and 911a224.

📒 Files selected for processing (1)
  • .github/workflows/wasm.yml

📝 Walkthrough

Walkthrough

The GitHub Actions workflow for WebAssembly builds was refactored to use cmake with explicit source/build dirs (-S/-B) for both OpenCV and OpenCvSharpExtern, and cache restore/save entries were expanded to target specific OpenCV artifacts (include, lib, libopencv.o).

Changes

Cohort / File(s) Summary
CI workflow
.github/workflows/wasm.yml
Replaced in-tree/make build steps with cmake-based flow using -S/-B, switched build/install to cmake --build/cmake --install, updated OPENCV_EXTRA_MODULES_PATH to absolute ${GITHUB_WORKSPACE} path, and expanded cache restore/save to include, lib, and libopencv.o. Removed multiple cd usages and adjusted OpenCvSharpExtern build/copy paths to new build directories.

Sequence Diagram(s)

sequenceDiagram
    participant GH as GitHub Actions
    participant Cache as Cache
    participant CMake as CMake
    participant OpenCV as OpenCV Source
    participant Contrib as opencv_contrib
    participant Extern as OpenCvSharpExtern
    participant NuGet as NuGet artifacts

    GH->>Cache: restore caches (include, lib, libopencv.o)
    GH->>CMake: configure OpenCV (-S OpenCV -B OpenCV/build, set OPENCV_EXTRA_MODULES_PATH)
    CMake->>OpenCV: read source & contrib modules
    CMake->>OpenCV: build (cmake --build)
    CMake->>GH: install (cmake --install to output dirs)
    GH->>CMake: configure Extern (-S src -B src/build)
    CMake->>Extern: build Extern (cmake --build)
    GH->>NuGet: copy built artifacts from src/build to nuget folder
    GH->>Cache: save caches (include, lib, libopencv.o)
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: refactoring the WebAssembly CI workflow from a manual build process to a cmake-based approach across multiple build steps.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch refactor_wasm

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.github/workflows/wasm.yml:
- Around line 82-84: The OPENCV_EXTRA_MODULES_PATH currently uses a relative
path that assumes CMake is run from the build dir; update the emcmake cmake
invocation (the line with emcmake cmake -S opencv-${OPENCV_VERSION} -B
opencv-${OPENCV_VERSION}/build and the -DOPENCV_EXTRA_MODULES_PATH setting) to
point to the correct location by using an absolute path (e.g., resolve to
${GITHUB_WORKSPACE}/opencv_contrib-${OPENCV_VERSION}/modules or construct a path
relative to the repository root) so the modules path is correct when using -S/-B
from the workspace root.

ℹ️ Review info

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4b35e9d and 772584f.

📒 Files selected for processing (1)
  • .github/workflows/wasm.yml

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.

1 participant