docs: 标记所有任务完成 #51
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: | |
| push: | |
| branches: [master, main] | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: ci-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| quality: | |
| name: Quality checks | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| cache: pip | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| python -m pip install ".[dev]" | |
| - name: Black | |
| run: python -m black --check src/ main.py tests/ | |
| - name: isort | |
| run: python -m isort --check-only src/ main.py tests/ | |
| - name: Flake8 | |
| run: python -m flake8 src/ main.py --max-line-length=120 --count --select=E9,F63,F7,F82 --show-source --statistics | |
| - name: Type check (mypy) | |
| run: python -m mypy src/ --ignore-missing-imports | |
| - name: Security check (bandit) | |
| run: python -m bandit -r src/ -c pyproject.toml -ll | |
| - name: Runtime path baseline | |
| run: python -m pytest -q tests/test_runtime_paths.py | |
| tests: | |
| name: Tests (Python ${{ matrix.python-version }}) | |
| needs: quality | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| python-version: ["3.10", "3.12"] | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| cache: pip | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| python -m pip install ".[dev]" | |
| - name: Run test suite | |
| run: python -m pytest -q --cov=src --cov-report=xml --cov-report=term-missing | |
| - name: Upload coverage report | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: coverage-report-${{ matrix.python-version }} | |
| path: coverage.xml | |
| retention-days: 7 | |
| build: | |
| name: Build package | |
| needs: quality | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| - name: Install build dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| python -m pip install build twine | |
| - name: Build | |
| run: python -m build | |
| - name: Check package metadata | |
| run: python -m twine check dist/* | |
| - name: Verify installed CLI | |
| run: | | |
| python -m pip install dist/*.whl | |
| cleanbook --version | |
| python -c "import src.resources; print('packaged resources OK')" |