Files
man-card/.gitea/workflows/ci.yml
7000pctAUTO e8fe6471a4
Some checks failed
CI / lint (push) Has been cancelled
CI / build (push) Has been cancelled
CI / test (push) Has been cancelled
Add Gitea Actions workflow: ci.yml
2026-01-31 21:41:28 +00:00

84 lines
2.1 KiB
YAML

name: CI
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
test:
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: 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
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
- 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')"