From 74145745090ea50a09ba6aeaf6455b9a4a86b16e Mon Sep 17 00:00:00 2001 From: 7000pctAUTO Date: Wed, 4 Feb 2026 10:03:38 +0000 Subject: [PATCH] fix: Update CI workflow for Rust project (replace Python with Rust tooling) --- .gitea/workflows/ci.yml | 57 ++++++++++++++--------------------------- 1 file changed, 19 insertions(+), 38 deletions(-) diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index c35b6dc..d44e12d 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -8,7 +8,6 @@ on: permissions: contents: read - checks: write jobs: lint: @@ -17,25 +16,16 @@ jobs: - name: Checkout code uses: actions/checkout@v4 - - name: Set up Python - uses: actions/setup-python@v5 + - name: Set up Rust + uses: dtolnay/rust-toolchain@stable with: - python-version: '3.11' - cache: 'pip' + components: rustfmt, clippy - - name: Install linting tools - run: | - python -m pip install --upgrade pip - pip install ruff mypy + - name: Check formatting + run: cargo fmt --check - - name: Run ruff check - run: python -m ruff check config_convert tests - - - name: Run ruff format check - run: python -m ruff format --check config_convert tests - - - name: Run mypy type checking - run: python -m mypy config_convert tests + - name: Run clippy + run: cargo clippy --all-features -- -D warnings test: runs-on: ubuntu-latest @@ -43,43 +33,34 @@ jobs: - name: Checkout code uses: actions/checkout@v4 - - name: Set up Python - uses: actions/setup-python@v5 - with: - python-version: '3.11' - cache: 'pip' + - name: Set up Rust + uses: dtolnay/rust-toolchain@stable - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install -e ".[dev]" - - - name: Run pytest - run: python -m pytest tests/ -v --tb=short --ignore=tests/integration/ + - name: Build and test + run: cargo test --all-features release: runs-on: ubuntu-latest needs: [lint, test] if: startsWith(gitea.ref, 'refs/tags/') + permissions: + contents: write steps: - name: Checkout code uses: actions/checkout@v4 with: fetch-depth: 0 - - name: Set up Python - uses: actions/setup-python@v5 + - name: Set up Rust + uses: dtolnay/rust-toolchain@stable with: - python-version: '3.11' + components: rust-src - - name: Install build tools - run: pip install build - - - name: Build package - run: python -m build + - name: Build release + run: cargo build --release --all-features - name: Create Release uses: https://gitea.com/actions/release-action@main with: files: | - dist/** + target/release/dotmigrate