Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

💚 Add CI workflow for automated testing and code coverage reporting #33

Merged

Conversation

ARYAN-NIKNEZHAD
Copy link
Collaborator

Description

This pull request introduces a Continuous Integration (CI) workflow using GitHub Actions to automate the testing process and report code coverage for every push and pull request. The CI workflow ensures that the codebase remains stable and well-tested throughout the development process.

Key Features of the CI Workflow:

  1. Triggered by Push and Pull Requests:

    • The workflow is triggered automatically on any push or pull request to the repository, ensuring that tests are run and code coverage is updated with every code change.
  2. Setup of the Python Environment:

    • The workflow uses the actions/setup-python@v2 action to set up a Python environment with the specified version (3.x).
  3. Dependency Installation:

    • Dependencies required for testing and coverage reporting are installed. This includes:
      • Upgrading pip to the latest version.
      • Installing coverage, codecov, and pytest for running tests and generating coverage reports.
      • Installing additional development dependencies from the packages/requirements-dev.txt file.
  4. Automated Testing:

    • The workflow runs the test suite using pytest with coverage tracking enabled. This ensures that every code change is validated by the existing tests.
  5. Code Coverage Reporting:

    • After the tests are run, a coverage report is generated in XML format.
    • The coverage report is then uploaded to Codecov using the codecov tool, which integrates with GitHub to display coverage metrics directly in the pull request.
  6. Security:

    • The Codecov upload process uses a secret token (CODECOV_TOKEN) stored in the repository’s secrets, ensuring secure communication with the Codecov service.

Benefits:

  • Automated Testing: This workflow ensures that the code is tested automatically on every change, reducing the chances of bugs being introduced.
  • Code Coverage Monitoring: By integrating Codecov, the project now has an easy way to track and improve test coverage over time.
  • Consistency: Running tests and generating coverage reports automatically helps maintain code quality and consistency across the project.

After merging this pull request, the CI workflow will be automatically triggered for all subsequent pushes and pull requests, helping to maintain a high standard of code quality and reliability in the project.

@sepehr-akbarzadeh sepehr-akbarzadeh merged commit 19fc88e into sageteamorg:master Aug 15, 2024
1 check failed
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.

2 participants