|
| 1 | +name: Native Plugin |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [master] |
| 6 | + paths: |
| 7 | + - 'ruoyi-fastapi-backend/plugins/core/**' |
| 8 | + - 'ruoyi-fastapi-backend/plugins/examples/rust/**' |
| 9 | + - 'ruoyi-fastapi-backend/plugins/examples/python/task_demo/**' |
| 10 | + - 'ruoyi-fastapi-backend/scripts/plugin_task_integration.py' |
| 11 | + - 'ruoyi-fastapi-backend/scripts/build_native_plugin.py' |
| 12 | + - 'ruoyi-fastapi-backend/cli/runtime/plugin/scaffold/**' |
| 13 | + - 'ruoyi-fastapi-backend/cli/runtime/plugin/sdk.py' |
| 14 | + - 'ruoyi-fastapi-backend/cli/groups/plugin/commands/developer.py' |
| 15 | + - 'ruoyi-fastapi-backend/cli/groups/plugin/commands/sdk.py' |
| 16 | + - 'ruoyi-fastapi-backend/cli/groups/plugin/commands/artifact*.py' |
| 17 | + - 'ruoyi-fastapi-backend/cli/groups/plugin/artifact_controller.py' |
| 18 | + - 'ruoyi-fastapi-backend/cli/groups/plugin/command.py' |
| 19 | + - 'ruoyi-fastapi-frontend/src/utils/pluginBridge*' |
| 20 | + - 'ruoyi-fastapi-backend/pyproject.toml' |
| 21 | + - 'ruoyi-fastapi-backend/tests/cli/runtime/plugin/test_runtime_scaffold*.py' |
| 22 | + - 'ruoyi-fastapi-backend/tests/cli/runtime/plugin/test_runtime_sdk.py' |
| 23 | + - 'ruoyi-fastapi-backend/tests/cli/root/test_plugin_sdk_commands.py' |
| 24 | + - 'ruoyi-fastapi-backend/tests/cli/root/test_plugin_artifact_commands.py' |
| 25 | + - 'ruoyi-fastapi-backend/tests/cli/root/test_plugin_release_wait.py' |
| 26 | + - 'ruoyi-fastapi-backend/tests/plugins/**' |
| 27 | + - '.github/workflows/native-plugin.yml' |
| 28 | + pull_request: |
| 29 | + branches: [master] |
| 30 | + paths: |
| 31 | + - 'ruoyi-fastapi-backend/plugins/core/**' |
| 32 | + - 'ruoyi-fastapi-backend/plugins/examples/rust/**' |
| 33 | + - 'ruoyi-fastapi-backend/plugins/examples/python/task_demo/**' |
| 34 | + - 'ruoyi-fastapi-backend/scripts/plugin_task_integration.py' |
| 35 | + - 'ruoyi-fastapi-backend/scripts/build_native_plugin.py' |
| 36 | + - 'ruoyi-fastapi-backend/cli/runtime/plugin/scaffold/**' |
| 37 | + - 'ruoyi-fastapi-backend/cli/runtime/plugin/sdk.py' |
| 38 | + - 'ruoyi-fastapi-backend/cli/groups/plugin/commands/developer.py' |
| 39 | + - 'ruoyi-fastapi-backend/cli/groups/plugin/commands/sdk.py' |
| 40 | + - 'ruoyi-fastapi-backend/cli/groups/plugin/commands/artifact*.py' |
| 41 | + - 'ruoyi-fastapi-backend/cli/groups/plugin/artifact_controller.py' |
| 42 | + - 'ruoyi-fastapi-backend/cli/groups/plugin/command.py' |
| 43 | + - 'ruoyi-fastapi-frontend/src/utils/pluginBridge*' |
| 44 | + - 'ruoyi-fastapi-backend/pyproject.toml' |
| 45 | + - 'ruoyi-fastapi-backend/tests/cli/runtime/plugin/test_runtime_scaffold*.py' |
| 46 | + - 'ruoyi-fastapi-backend/tests/cli/runtime/plugin/test_runtime_sdk.py' |
| 47 | + - 'ruoyi-fastapi-backend/tests/cli/root/test_plugin_sdk_commands.py' |
| 48 | + - 'ruoyi-fastapi-backend/tests/cli/root/test_plugin_artifact_commands.py' |
| 49 | + - 'ruoyi-fastapi-backend/tests/cli/root/test_plugin_release_wait.py' |
| 50 | + - 'ruoyi-fastapi-backend/tests/plugins/**' |
| 51 | + - '.github/workflows/native-plugin.yml' |
| 52 | + workflow_dispatch: |
| 53 | + |
| 54 | +jobs: |
| 55 | + native: |
| 56 | + strategy: |
| 57 | + fail-fast: false |
| 58 | + matrix: |
| 59 | + os: [ubuntu-latest, windows-latest] |
| 60 | + python: ['3.10', '3.11', '3.12', '3.13'] |
| 61 | + runs-on: ${{ matrix.os }} |
| 62 | + defaults: |
| 63 | + run: |
| 64 | + working-directory: ruoyi-fastapi-backend |
| 65 | + steps: |
| 66 | + - uses: actions/checkout@v5 |
| 67 | + - uses: actions/setup-python@v6 |
| 68 | + with: |
| 69 | + python-version: ${{ matrix.python }} |
| 70 | + cache: pip |
| 71 | + cache-dependency-path: ruoyi-fastapi-backend/requirements.txt |
| 72 | + - name: Install host and build dependencies |
| 73 | + run: python -m pip install -r requirements.txt 'maturin>=1.15,<2' pytest pytest-asyncio aiosqlite |
| 74 | + - name: Install Rust |
| 75 | + run: rustup toolchain install 1.99.0 --profile minimal --component rustfmt --component clippy |
| 76 | + - name: Select Rust |
| 77 | + run: rustup default 1.99.0 |
| 78 | + - name: Check Rust formatting |
| 79 | + run: cargo fmt --manifest-path plugins/examples/rust/rust_demo/Cargo.toml --check |
| 80 | + - name: Verify v1 and v2 plugin scaffolds |
| 81 | + run: python -m pytest tests/cli/runtime/plugin/test_runtime_scaffold.py tests/cli/runtime/plugin/test_runtime_scaffold_v2.py -q |
| 82 | + - name: Verify SDK provenance and offline update commands |
| 83 | + run: python -m pytest tests/cli/runtime/plugin/test_runtime_sdk.py tests/cli/root/test_plugin_sdk_commands.py -q |
| 84 | + - name: Verify persistent task plugin |
| 85 | + run: python -m pytest tests/plugins/examples/test_task_demo.py -q |
| 86 | + - name: Build and assemble source-free plugin |
| 87 | + run: python scripts/build_native_plugin.py --output target/native-package |
| 88 | + - name: Check Rust code |
| 89 | + run: cargo clippy --manifest-path plugins/examples/rust/rust_demo/Cargo.toml --locked -- -D warnings |
| 90 | + - name: Exercise native library through the host runtime |
| 91 | + env: |
| 92 | + RUOYI_NATIVE_PLUGIN_DIR: ${{ github.workspace }}/ruoyi-fastapi-backend/target/native-package/rust_demo |
| 93 | + 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 |
| 94 | + - name: Verify signed artifacts and maintenance releases |
| 95 | + env: |
| 96 | + RUOYI_NATIVE_PLUGIN_DIR: ${{ github.workspace }}/ruoyi-fastapi-backend/target/native-package/rust_demo |
| 97 | + 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 |
0 commit comments