Skip to content

Conversation

@sebastianorbell-qm
Copy link

Summary

Add comprehensive CI/CD automation using GitHub Actions and establish foundational test infrastructure for the superconducting calibrations project.

Changes

🚀 GitHub Actions CI Workflow (.github/workflows/ci.yml)

Triggers:

  • Push to master, styx-ci-cd, KAVR_12182025 branches
  • Pull requests to master, styx-ci-cd, KAVR_12182025
  • Manual workflow dispatch

Features:

  • Multi-Python testing: Tests across Python 3.10, 3.11, and 3.12
  • Fast dependency resolution: Uses uv with caching for ~10x faster installs
  • Smart pre-commit checks: Runs only on changed files (not entire codebase)
    • Uses --from-ref and --to-ref for efficient diff-based checking
  • Test execution: Runs pytest with coverage reporting
  • Coverage upload: Uploads coverage to Codecov (Python 3.12 only)

🧪 Test Infrastructure (tests/)

New test files:

  • test_sanity.py - Basic infrastructure tests:

    • Verifies pytest is working correctly
    • Checks Python version is 3.10+
    • Basic assertion tests
  • test_imports.py - Package import verification:

    • Tests core packages (calibrations, quam_config, calibration_utils)
    • Verifies key dependencies are available
    • Uses pytest.skip for graceful handling of missing imports

Pre-commit configuration updates:

  • Exclude tests/ from pylint checks (avoids false positives on test patterns)
  • Removed explicit --rcfile argument (pylint auto-discovers .pylintrc)

- Move .pre-commit-config.yaml, .pylintrc, and CONTRIBUTING.md to superconducting/
- Update pyproject.toml to reference .pylintrc in same directory
- Update CONTRIBUTING.md with correct repository paths

This consolidates all configuration files at the same level as pyproject.toml
for better organization and easier maintenance.
Pylint automatically discovers .pylintrc in the same directory,
so the [tool.pylint.main] section is unnecessary.
Add standard Python project exclusions including:
- Virtual environments (.venv/, venv/)
- Python cache files (*.pyc, __pycache__/)
- Test artifacts (.coverage, htmlcov/)
- IDE files (.vscode/, .idea/, .DS_Store)
- Build artifacts (dist/, build/, *.egg-info/)
- Tool caches (.mypy_cache/, .ruff_cache/, .pre-commit-cache/)

Note: uv.lock is intentionally tracked for reproducible builds.
Add comprehensive CI workflow that:
- Runs on push to master, styx-ci-cd, and KAVR_12182025 branches
- Triggers on pull requests to master, styx-ci-cd, and KAVR_12182025
- Tests on Python 3.10, 3.11, and 3.12
- Uses uv for fast dependency installation
- Runs pre-commit hooks on changed files only (not all files)
- Runs pytest with coverage reporting
- Uploads coverage to Codecov for Python 3.12

The workflow uses --from-ref and --to-ref to run pre-commit only on
changed files in the current commit/PR, not the entire codebase.
Create initial test suite with:
- test_imports.py: Verify all main packages can be imported
- test_sanity.py: Basic sanity tests to verify test infrastructure
- __init__.py: Mark tests as a proper Python package

Also update .pre-commit-config.yaml to:
- Remove explicit --rcfile argument (pylint finds .pylintrc automatically)
- Exclude tests/ directory from pylint checks

This provides a foundation for the test suite and allows CI to run
successfully. The tests verify that:
- Core packages (calibrations, quam_config, calibration_utils) can be imported
- Key dependencies are available
- Python version is 3.10+
- Basic pytest functionality works
Copy link
Collaborator

@OziEgri OziEgri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was it tested E2E yet?

@sebastianorbell-qm
Copy link
Author

@OziEgri Yes, you can see here the logs of the workflow runs with github acttions on the /chore/styx--github-actions branch https://github.com/qua-platform/CS_installations/actions

Copy link
Collaborator

@OziEgri OziEgri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants