Skip to content

Add CI Pipeline #4

@crypto-a

Description

@crypto-a

User Story

As a developer
I need a CI pipeline that runs tests and linting across Linux, macOS, and Windows
So that code quality stays high and regressions are caught early with strong coverage

Details and Assumptions

  • Test runner: pytest with coverage via pytest-cov
  • Coverage threshold: ≥ 90% lines (build fails if lower)
  • OS matrix: ubuntu-latest, macos-latest, windows-latest
  • Python versions: 3.10, 3.11, 3.12
  • Linting: ruff (style + static checks) and black --check (format)
  • Cache Python deps between runs; upload coverage XML/HTML as artifacts
  • Pull requests must pass CI before merge
  • Main branch protected; CI runs on PRs and pushes to main

Acceptance Criteria

Feature: Cross-platform CI with high test coverage and linting

  Scenario: Tests and coverage run on all OS targets
    Given a PR or push to main
    When the CI pipeline executes on ubuntu-latest, macos-latest, and windows-latest
    Then pytest runs the full test suite on each OS
    And coverage is measured with pytest-cov
    And a coverage XML report is generated and stored as a build artifact

  Scenario: Enforcing minimum coverage
    Given the coverage threshold is set to 90 percent
    When pytest completes
    Then the job fails if total line coverage is below 90 percent
    And the job passes if total line coverage is 90 percent or higher

  Scenario: Linting and formatting checks
    Given the codebase contains Python files
    When ruff runs with the project configuration
    Then no errors or warnings are reported
    And black --check reports no formatting changes needed
    And the job fails if either tool reports issues

  Scenario: Python version matrix
    Given supported Python versions are 3.10, 3.11, and 3.12
    When the matrix build executes
    Then all jobs complete successfully across these Python versions

  Scenario: Fast, reproducible builds
    Given dependency caching is configured
    When subsequent CI runs occur
    Then dependency restoration reduces install time
    And builds remain deterministic using pinned/locked dependencies

  Scenario: Gate to merge
    Given branch protection rules require CI to pass
    When a pull request is opened or updated
    Then all matrix jobs (tests, coverage, lint) must succeed before merge

Metadata

Metadata

Type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions