From d7a1a473d92d617c8b7f48fbbc4bb689e8bcee79 Mon Sep 17 00:00:00 2001 From: 7000pctAUTO Date: Sun, 22 Mar 2026 21:59:51 +0000 Subject: [PATCH] Add pyproject.toml and simplify CI workflow --- .gitea/workflows/ci.yml | 48 +++++++++++++++++++++++++---------------- 1 file changed, 29 insertions(+), 19 deletions(-) diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index 3665eab..675f1d7 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -2,56 +2,66 @@ name: CI on: push: - branches: [ main, master ] - pull_request: - branches: [ main, master ] + branches: [ main ] jobs: test: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - name: Checkout + uses: actions/checkout@v4 - name: Set up Python uses: actions/setup-python@v5 with: - python-version: '3.10' + python-version: '3.11' - name: Install dependencies run: | pip install -e ".[dev]" - pip install ruff mypy + + - name: Run tests + run: pytest tests/ -v + + lint: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.11' + + - name: Install dependencies + run: | + pip install -e . + pip install ruff - name: Run linting run: ruff check src/ - - name: Run type checking - run: mypy src/mockapi/ || true - - - name: Run tests - run: pytest tests/unit/test_generators.py tests/unit/test_config.py tests/unit/test_validator.py tests/integration/test_cli.py tests/integration/test_server.py -v - build: runs-on: ubuntu-latest needs: test steps: - - uses: actions/checkout@v4 + - name: Checkout + uses: actions/checkout@v4 - name: Set up Python uses: actions/setup-python@v5 with: - python-version: '3.10' + python-version: '3.11' - name: Install build dependencies - run: | - pip install build + run: pip install build - name: Build package - run: | - python -m build + run: python -m build - name: Upload artifacts uses: actions/upload-artifact@v4 with: name: dist - path: dist/ \ No newline at end of file + path: dist/