mirror of
https://github.com/insistence/RuoYi-Vue3-FastAPI.git
synced 2026-10-13 20:51:06 +00:00
* refactor: 重构项目架构 * refactor: 重构ci和测试 * fix: 修复测试 * feat: 新增更多E2E测试 * fix: 修复E2E测试
81 lines
2.9 KiB
YAML
81 lines
2.9 KiB
YAML
name: CI / Native
|
|
|
|
on:
|
|
workflow_call:
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
env:
|
|
PYTHONUTF8: '1'
|
|
_TYPER_FORCE_DISABLE_TERMINAL: '1'
|
|
|
|
jobs:
|
|
rust-quality:
|
|
name: Rust format and clippy
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 20
|
|
defaults:
|
|
run:
|
|
working-directory: ruoyi-fastapi-backend
|
|
steps:
|
|
- uses: actions/checkout@v5
|
|
- uses: actions/setup-python@v6
|
|
with:
|
|
python-version: '3.12'
|
|
- run: rustup toolchain install 1.99.0 --profile minimal --component rustfmt --component clippy
|
|
- run: rustup default 1.99.0
|
|
- uses: actions/cache@v5
|
|
with:
|
|
path: |
|
|
~/.cargo/registry
|
|
~/.cargo/git
|
|
ruoyi-fastapi-backend/plugins/examples/rust/rust_demo/target
|
|
key: rust-quality-${{ runner.os }}-1.99.0-${{ hashFiles('**/Cargo.lock') }}
|
|
- run: cargo fmt --manifest-path plugins/examples/rust/rust_demo/Cargo.toml --check
|
|
- run: cargo clippy --manifest-path plugins/examples/rust/rust_demo/Cargo.toml --locked -- -D warnings
|
|
|
|
runtime:
|
|
name: ${{ matrix.os }} / Python ${{ matrix.python }}
|
|
runs-on: ${{ matrix.os }}
|
|
timeout-minutes: 30
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
os: [ubuntu-latest, windows-latest]
|
|
python: ['3.10', '3.11', '3.12', '3.13']
|
|
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
|
|
- run: python -m pip install -r requirements.txt -r requirements-test.txt 'maturin>=1.15,<2'
|
|
- run: rustup toolchain install 1.99.0 --profile minimal
|
|
- run: rustup default 1.99.0
|
|
- uses: actions/cache@v5
|
|
with:
|
|
path: |
|
|
~/.cargo/registry
|
|
~/.cargo/git
|
|
ruoyi-fastapi-backend/plugins/examples/rust/rust_demo/target
|
|
key: rust-native-${{ runner.os }}-${{ matrix.python }}-1.99.0-${{ hashFiles('**/Cargo.lock') }}
|
|
- name: Build and assemble source-free plugin
|
|
run: python scripts/build_native_plugin.py --output target/native-package
|
|
- name: Exercise real native runtime and signed artifact loading
|
|
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/deployment -m native --strict-markers -q --durations=15 --junitxml=target/ci/native.xml
|
|
- name: Require native tests to run without missing-artifact skips
|
|
run: python ../.github/scripts/check_test_report.py target/ci/native.xml
|
|
- uses: actions/upload-artifact@v6
|
|
if: always()
|
|
with:
|
|
name: native-${{ runner.os }}-${{ matrix.python }}
|
|
path: ruoyi-fastapi-backend/target/ci/
|
|
retention-days: 7
|