Skip to content

Add CI/CD pipeline with GitHub Actions — lint, test, build, publish #12

@rudra496

Description

@rudra496

Summary

Set up a comprehensive GitHub Actions CI/CD pipeline for the project.

What to create

1. CI Workflow (.github/workflows/ci.yml)

on: [push, pull_request]
jobs:
  lint:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-python@v5
        with: { python-version: "3.12" }
      - run: pip install -e ".[dev]"
      - run: ruff check .
      - run: black --check .
      - run: mypy ai_trust_validator

  test:
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        os: [ubuntu-latest, windows-latest, macos-latest]
        python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-python@v5
        with: { python-version: "${{ matrix.python-version }}" }
      - run: pip install -e ".[dev]"
      - run: pytest --cov --cov-report=xml
      - uses: codecov/codecov-action@v4

2. Publish Workflow (.github/workflows/publish.yml)

  • Trigger on git tags (v*)
  • Build package
  • Publish to PyPI

3. PR Check Workflow

  • Run on pull requests
  • Validate code, check coverage threshold
  • Block merge if coverage < 70%

Acceptance Criteria

  • CI runs on push and PR
  • Tests run on Python 3.8-3.12 across 3 OSes
  • Lint + type checking passes
  • Coverage reported
  • Publish workflow ready for releases
  • Status badges in README

Difficulty

Beginner — GitHub Actions configuration, well-documented patterns.

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions