fix: Update CI workflow for Rust project (replace Python with Rust tooling)
This commit is contained in:
@@ -8,7 +8,6 @@ on:
|
|||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
checks: write
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
lint:
|
lint:
|
||||||
@@ -17,25 +16,16 @@ jobs:
|
|||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Set up Python
|
- name: Set up Rust
|
||||||
uses: actions/setup-python@v5
|
uses: dtolnay/rust-toolchain@stable
|
||||||
with:
|
with:
|
||||||
python-version: '3.11'
|
components: rustfmt, clippy
|
||||||
cache: 'pip'
|
|
||||||
|
|
||||||
- name: Install linting tools
|
- name: Check formatting
|
||||||
run: |
|
run: cargo fmt --check
|
||||||
python -m pip install --upgrade pip
|
|
||||||
pip install ruff mypy
|
|
||||||
|
|
||||||
- name: Run ruff check
|
- name: Run clippy
|
||||||
run: python -m ruff check config_convert tests
|
run: cargo clippy --all-features -- -D warnings
|
||||||
|
|
||||||
- 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
|
|
||||||
|
|
||||||
test:
|
test:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
@@ -43,43 +33,34 @@ jobs:
|
|||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Set up Python
|
- name: Set up Rust
|
||||||
uses: actions/setup-python@v5
|
uses: dtolnay/rust-toolchain@stable
|
||||||
with:
|
|
||||||
python-version: '3.11'
|
|
||||||
cache: 'pip'
|
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Build and test
|
||||||
run: |
|
run: cargo test --all-features
|
||||||
python -m pip install --upgrade pip
|
|
||||||
pip install -e ".[dev]"
|
|
||||||
|
|
||||||
- name: Run pytest
|
|
||||||
run: python -m pytest tests/ -v --tb=short --ignore=tests/integration/
|
|
||||||
|
|
||||||
release:
|
release:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: [lint, test]
|
needs: [lint, test]
|
||||||
if: startsWith(gitea.ref, 'refs/tags/')
|
if: startsWith(gitea.ref, 'refs/tags/')
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
- name: Set up Python
|
- name: Set up Rust
|
||||||
uses: actions/setup-python@v5
|
uses: dtolnay/rust-toolchain@stable
|
||||||
with:
|
with:
|
||||||
python-version: '3.11'
|
components: rust-src
|
||||||
|
|
||||||
- name: Install build tools
|
- name: Build release
|
||||||
run: pip install build
|
run: cargo build --release --all-features
|
||||||
|
|
||||||
- name: Build package
|
|
||||||
run: python -m build
|
|
||||||
|
|
||||||
- name: Create Release
|
- name: Create Release
|
||||||
uses: https://gitea.com/actions/release-action@main
|
uses: https://gitea.com/actions/release-action@main
|
||||||
with:
|
with:
|
||||||
files: |
|
files: |
|
||||||
dist/**
|
target/release/dotmigrate
|
||||||
|
|||||||
Reference in New Issue
Block a user