From e8fe6471a4d67cbcd8c0e2cde8e9dbf225174a9c Mon Sep 17 00:00:00 2001 From: 7000pctAUTO Date: Sat, 31 Jan 2026 21:41:28 +0000 Subject: [PATCH] Add Gitea Actions workflow: ci.yml --- .gitea/workflows/ci.yml | 75 +++++++++++++++++++++++++++++++++++------ 1 file changed, 64 insertions(+), 11 deletions(-) diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index 8d2b54d..582a54b 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -2,29 +2,82 @@ 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' - + python-version: '3.9' + + - name: Cache pip packages + uses: actions/cache@v4 + with: + path: ~/.cache/pip + key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} + restore-keys: | + ${{ runner.os }}-pip- + - name: Install dependencies run: | + python -m pip install --upgrade pip pip install -r requirements.txt - + - name: Run tests - run: pytest tests/ -v --cov=man_card --cov-report=term-missing - - - name: Check code quality run: | + pytest tests/ -v --cov=man_card --cov-report=term-missing + + lint: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.9' + + - name: Install linting tools + run: | + python -m pip install --upgrade pip pip install ruff - ruff check man_card/ tests/ + + - name: Run linter + run: | + ruff check . + + build: + 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.9' + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -r requirements.txt + + - name: Verify build + run: | + python -c "from man_card import cli; print('CLI module imports successfully')" + python -c "from man_card import man_parser; print('man_parser module imports successfully')" + python -c "from man_card import card_generator; print('card_generator module imports successfully')" + python -c "from man_card import templates; print('templates module imports successfully')" + python -c "from man_card import config; print('config module imports successfully')"