This directory contains all GitHub-specific configuration files for the Call2Action project.
Runs on every push and pull request to main, develop, and feature branches.
Jobs:
- Lint: Checks code formatting with Black and linting with Ruff
- Test: Runs tests across multiple OS (Ubuntu, macOS) and Python versions (3.10-3.13)
- Includes code coverage reporting with Codecov
- Type Check: Runs mypy for static type checking
- Security: Runs Bandit for security linting and Safety for dependency vulnerability checks
Required Secrets:
OPENAI_API_KEY: OpenAI API key for running tests (optional, tests will skip if not present)CODECOV_TOKEN: Token for uploading coverage reports to Codecov
Triggered when a version tag (v*..) is pushed.
Jobs:
- Builds the Python package
- Creates a GitHub release with release notes
- Publishes to PyPI
Required Secrets:
PYPI_API_TOKEN: Token for publishing to PyPI
Runs CodeQL security analysis on pushes, pull requests, and weekly schedule.
Purpose:
- Identifies security vulnerabilities
- Detects code quality issues
- Runs security-and-quality queries
Structured template for reporting bugs with fields for:
- Bug description
- Reproduction steps
- Expected vs actual behavior
- Environment details (Python version, OS, package version)
- Configuration details
- Error logs
Template for proposing new features with:
- Problem statement
- Proposed solution
- Alternatives considered
- Use case description
- Priority level
Configuration for issue templates with links to:
- GitHub Discussions
- Documentation
- Configuration help
Defines code ownership and automatic review requests.
- Default owner: @leoneperdigao
- Ensures proper review for all changes
Comprehensive PR template with sections for:
- Description and type of change
- Related issues
- Testing details and coverage
- Configuration changes checklist
- Breaking changes documentation
Robust GitHub Copilot configuration that defines:
- Project architecture and patterns
- Code standards and style guidelines
- Type hints and documentation requirements
- Testing best practices
- Common code patterns and examples
- Security considerations
- Performance optimization guidelines
This ensures consistent, high-quality AI-assisted code generation that follows project standards.
Automated dependency updates configuration:
- Weekly updates for Python dependencies
- Weekly updates for GitHub Actions
- Automatic labeling and commit message formatting
- Ignores major version updates to maintain stability
Placeholder for project funding/sponsorship options.
Add the following secrets to your GitHub repository (Settings > Secrets and variables > Actions):
OPENAI_API_KEY # For running integration tests (optional)
CODECOV_TOKEN # For code coverage reporting (optional)
PYPI_API_TOKEN # For automated releases to PyPI
Ensure GitHub Actions are enabled in your repository settings.
Recommended branch protection rules for main and develop:
Main Branch:
- Require pull request reviews before merging
- Require status checks to pass (CI, Type Check, Security)
- Require branches to be up to date before merging
- Require linear history
- Do not allow force pushes
- Do not allow deletions
Develop Branch:
- Require status checks to pass (CI, Type Check)
- Require branches to be up to date before merging
Dependabot is automatically configured via dependabot.yml. Ensure Dependabot alerts are enabled in:
- Settings > Code security and analysis > Dependabot alerts
- Settings > Code security and analysis > Dependabot security updates
CodeQL will run automatically via the workflow. For additional security features:
- Settings > Code security and analysis > CodeQL analysis
The copilot-instructions.md file will automatically be used by GitHub Copilot to provide context-aware suggestions. No additional setup required for users with Copilot enabled.
Before pushing, you can run the CI checks locally:
# Formatting check
black --check src/ tests/
# Linting
ruff check src/ tests/
# Type checking
mypy src/call2action --ignore-missing-imports
# Tests with coverage
pytest tests/ -v --cov=src/call2action --cov-report=term
# Security checks
bandit -r src/call2action
safety checkTo create a new release:
- Update version in
pyproject.toml - Commit changes:
git commit -am "chore: bump version to X.Y.Z" - Create and push tag:
git tag vX.Y.Z && git push origin vX.Y.Z - The release workflow will automatically:
- Build the package
- Create a GitHub release
- Publish to PyPI
Dependabot will automatically create PRs for dependency updates. Review and merge them regularly to keep dependencies up-to-date.
Monitor workflow runs in the "Actions" tab of your repository.
View coverage reports at: https://codecov.io/gh/leoneperdigao/call2action
Check security alerts in:
- Settings > Code security and analysis
- Security tab > Dependabot alerts
- Security tab > Code scanning alerts
When contributing:
- Follow the PR template
- Ensure all CI checks pass
- Maintain or improve code coverage
- Follow the coding standards in
copilot-instructions.md - Update documentation as needed
Black/Ruff Errors:
# Auto-fix formatting
black src/ tests/
ruff check --fix src/ tests/Test Failures:
# Run tests locally with verbose output
pytest tests/ -v -sType Errors:
# Check types locally
mypy src/call2action --ignore-missing-importsIf Dependabot PRs are failing:
- Check the logs in the PR
- Test the update locally
- May need to update code for compatibility
If release workflow fails:
- Verify
PYPI_API_TOKENis set correctly - Check that version number is unique
- Ensure build passes locally:
python -m build
- Never commit secrets - Use environment variables and GitHub Secrets
- Keep dependencies updated - Review Dependabot PRs regularly
- Monitor security alerts - Address vulnerabilities promptly
- Maintain test coverage - Aim for >80% coverage
- Write descriptive commits - Use conventional commits format
- Review CI logs - Understand why builds fail
- Update documentation - Keep this README and others up-to-date