Skip to content

ci: add GitHub Actions workflow for automated testing #18

@tooniez

Description

@tooniez

🚀 Feature Request: Add GitHub Actions CI/CD Workflow

Summary

The repository currently lacks a CI/CD pipeline to automatically run tests on pull requests and commits. Adding a GitHub Actions workflow will ensure code quality is maintained and prevent regressions from being merged into the main branch.

Current State

  • ❌ No .github/workflows/ci.yml or similar workflow file exists
  • ✅ Dependabot is configured for GitHub Actions updates only
  • ✅ Tests can be run locally via make test

Proposed Changes

1. Create .github/workflows/ci.yml

Add a comprehensive CI workflow that:

  • Runs on push to main and on all pull requests
  • Tests against multiple Python versions (3.9, 3.10, 3.11, 3.12)
  • Lints code with flake8 or ruff
  • Runs the full test suite via pytest
  • Uploads test results/coverage reports

Example workflow structure:

name: CI
on:
  push:
    branches: [main]
  pull_request:
    branches: [main]

jobs:
  test:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        python-version: ['3.9', '3.10', '3.11', '3.12']
    steps:
      - uses: actions/checkout@v4
      - name: Set up Python
        uses: actions/setup-python@v5
        with:
          python-version: ${{ matrix.python-version }}
      - name: Install dependencies
        run: |
          pip install -r requirements.txt
      - name: Run tests
        run: pytest

2. Update Dependabot Configuration

Extend .github/dependabot.yml to also monitor pip dependencies:

- package-ecosystem: "pip"
  directory: "/"
  schedule:
    interval: "weekly"

3. Add Code Quality Checks (Optional but recommended)

Consider adding:

  • flake8 or ruff for linting
  • black for code formatting
  • mypy for type checking
  • Test coverage reporting with pytest-cov

Acceptance Criteria

  • CI workflow runs automatically on PRs and pushes to main
  • Tests pass on all supported Python versions
  • Workflow badge added to README.md
  • Dependabot monitors pip dependencies

Benefits

  1. Quality Assurance: Catch bugs before they reach main
  2. Contributor Confidence: Contributors get immediate feedback on PRs
  3. Documentation: Badge shows project health to visitors
  4. Automation: Reduces manual testing burden

Related

  • Current Makefile has test commands ready for CI integration
  • pytest.ini is already configured for test discovery

Suggested commit message when implementing:

ci: add GitHub Actions workflow for automated testing

- Add CI workflow running tests on Python 3.9-3.12
- Add pip to Dependabot configuration
- Add CI badge to README

Fixes #[this issue number]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions