name: Native Plugin on: push: branches: [master] paths: - 'ruoyi-fastapi-backend/plugins/core/**' - 'ruoyi-fastapi-backend/plugins/examples/rust/**' - 'ruoyi-fastapi-backend/plugins/examples/python/task_demo/**' - 'ruoyi-fastapi-backend/scripts/plugin_task_integration.py' - 'ruoyi-fastapi-backend/scripts/build_native_plugin.py' - 'ruoyi-fastapi-backend/cli/runtime/plugin/scaffold/**' - 'ruoyi-fastapi-backend/cli/runtime/plugin/sdk.py' - 'ruoyi-fastapi-backend/cli/groups/plugin/commands/developer.py' - 'ruoyi-fastapi-backend/cli/groups/plugin/commands/sdk.py' - 'ruoyi-fastapi-backend/cli/groups/plugin/commands/artifact*.py' - 'ruoyi-fastapi-backend/cli/groups/plugin/artifact_controller.py' - 'ruoyi-fastapi-backend/cli/groups/plugin/command.py' - 'ruoyi-fastapi-frontend/src/utils/pluginBridge*' - 'ruoyi-fastapi-backend/pyproject.toml' - 'ruoyi-fastapi-backend/tests/cli/runtime/plugin/test_runtime_scaffold*.py' - 'ruoyi-fastapi-backend/tests/cli/runtime/plugin/test_runtime_sdk.py' - 'ruoyi-fastapi-backend/tests/cli/root/test_plugin_sdk_commands.py' - 'ruoyi-fastapi-backend/tests/cli/root/test_plugin_artifact_commands.py' - 'ruoyi-fastapi-backend/tests/cli/root/test_plugin_release_wait.py' - 'ruoyi-fastapi-backend/tests/plugins/**' - '.github/workflows/native-plugin.yml' pull_request: branches: [master] paths: - 'ruoyi-fastapi-backend/plugins/core/**' - 'ruoyi-fastapi-backend/plugins/examples/rust/**' - 'ruoyi-fastapi-backend/plugins/examples/python/task_demo/**' - 'ruoyi-fastapi-backend/scripts/plugin_task_integration.py' - 'ruoyi-fastapi-backend/scripts/build_native_plugin.py' - 'ruoyi-fastapi-backend/cli/runtime/plugin/scaffold/**' - 'ruoyi-fastapi-backend/cli/runtime/plugin/sdk.py' - 'ruoyi-fastapi-backend/cli/groups/plugin/commands/developer.py' - 'ruoyi-fastapi-backend/cli/groups/plugin/commands/sdk.py' - 'ruoyi-fastapi-backend/cli/groups/plugin/commands/artifact*.py' - 'ruoyi-fastapi-backend/cli/groups/plugin/artifact_controller.py' - 'ruoyi-fastapi-backend/cli/groups/plugin/command.py' - 'ruoyi-fastapi-frontend/src/utils/pluginBridge*' - 'ruoyi-fastapi-backend/pyproject.toml' - 'ruoyi-fastapi-backend/tests/cli/runtime/plugin/test_runtime_scaffold*.py' - 'ruoyi-fastapi-backend/tests/cli/runtime/plugin/test_runtime_sdk.py' - 'ruoyi-fastapi-backend/tests/cli/root/test_plugin_sdk_commands.py' - 'ruoyi-fastapi-backend/tests/cli/root/test_plugin_artifact_commands.py' - 'ruoyi-fastapi-backend/tests/cli/root/test_plugin_release_wait.py' - 'ruoyi-fastapi-backend/tests/plugins/**' - '.github/workflows/native-plugin.yml' workflow_dispatch: jobs: native: strategy: fail-fast: false matrix: os: [ubuntu-latest, windows-latest] python: ['3.10', '3.11', '3.12', '3.13'] runs-on: ${{ matrix.os }} defaults: run: working-directory: ruoyi-fastapi-backend steps: - uses: actions/checkout@v5 - uses: actions/setup-python@v6 with: python-version: ${{ matrix.python }} cache: pip cache-dependency-path: ruoyi-fastapi-backend/requirements.txt - name: Install host and build dependencies run: python -m pip install -r requirements.txt 'maturin>=1.15,<2' pytest pytest-asyncio aiosqlite - name: Install Rust run: rustup toolchain install 1.99.0 --profile minimal --component rustfmt --component clippy - name: Select Rust run: rustup default 1.99.0 - name: Check Rust formatting run: cargo fmt --manifest-path plugins/examples/rust/rust_demo/Cargo.toml --check - name: Verify v1 and v2 plugin scaffolds run: python -m pytest tests/cli/runtime/plugin/test_runtime_scaffold.py tests/cli/runtime/plugin/test_runtime_scaffold_v2.py -q - name: Verify SDK provenance and offline update commands run: python -m pytest tests/cli/runtime/plugin/test_runtime_sdk.py tests/cli/root/test_plugin_sdk_commands.py -q - name: Verify persistent task plugin run: python -m pytest tests/plugins/examples/test_task_demo.py -q - name: Build and assemble source-free plugin run: python scripts/build_native_plugin.py --output target/native-package - name: Check Rust code run: cargo clippy --manifest-path plugins/examples/rust/rust_demo/Cargo.toml --locked -- -D warnings - name: Exercise native library through the host runtime env: RUOYI_NATIVE_PLUGIN_DIR: ${{ github.workspace }}/ruoyi-fastapi-backend/target/native-package/rust_demo run: python -m pytest tests/plugins/native tests/plugins/core/native tests/plugins/core/runtime/test_host_services.py tests/plugins/core/runtime/test_job_dispatcher.py -q - name: Verify signed artifacts and maintenance releases env: RUOYI_NATIVE_PLUGIN_DIR: ${{ github.workspace }}/ruoyi-fastapi-backend/target/native-package/rust_demo run: python -m pytest tests/plugins/core/artifacts tests/plugins/core/deployment tests/plugins/core/management/test_release_dao.py tests/plugins/core/management/test_artifact_views.py tests/module_plugin/controller/test_plugin_release_controller.py tests/cli/root/test_plugin_artifact_commands.py tests/cli/root/test_plugin_release_wait.py tests/sql/test_plugin_release_schema.py -q