diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index 8d2b54d..70a26ce 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -2,29 +2,52 @@ name: CI on: push: - branches: [main] + branches: + - main pull_request: - branches: [main] + branches: + - main jobs: test: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - + - name: Checkout code + uses: actions/checkout@v4 + - name: Set up Python uses: actions/setup-python@v5 with: python-version: '3.11' - + - name: Install dependencies run: | + python -m pip install --upgrade pip pip install -r requirements.txt - + pip install pytest pytest-cov + - name: Run tests - run: pytest tests/ -v --cov=man_card --cov-report=term-missing - - - name: Check code quality run: | - pip install ruff - ruff check man_card/ tests/ + pytest tests/ -v --tb=short + + - name: Run tests with coverage + run: | + pytest tests/ --cov=man_card --cov-report=term-missing --cov-report=xml + + lint: + runs-on: ubuntu-latest + needs: test + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.11' + + - name: Check code formatting + run: | + pip install black ruff + black --check man_card/ + ruff check man_card/ \ No newline at end of file