sageteamorg / django-sage-tools

Reusable, generic mixins for Django
MIT License
6 stars 5 forks source link

πŸ”§ πŸ’š Missing CI Action #36

Closed ARYAN-NIKNEZHAD closed 3 months ago

ARYAN-NIKNEZHAD commented 3 months ago

Description

This GitHub Action is set up to automate the testing and code quality checks for our Python package. The workflow is triggered on every push and pull_request event, ensuring that all code changes are validated before being merged.

Workflow Overview

The CI workflow consists of the following steps:

  1. Checkout Repository:
    The repository code is checked out using the actions/checkout@v2 action.

  2. Set up Python:
    The workflow sets up a Python environment using actions/setup-python@v2. The Python version is specified as 3.x, which allows for compatibility with different versions of Python 3.

  3. Install Dependencies:
    The necessary dependencies are installed, including coverage, codecov, and pytest. Additionally, any development dependencies listed in packages/requirements-dev.txt are installed.

  4. Run Tests:
    Tests are executed using pytest with coverage tracking enabled through coverage. This step ensures that the code functions as expected.

  5. Generate Coverage Report:
    A coverage report in XML format is generated, which is required for integration with Codecov.

  6. Run Tox Tests:
    The workflow runs tests across multiple Python environments and/or configurations using tox, ensuring compatibility and adherence to the project's testing standards.

  7. Run Pre-Commit Hooks:
    Pre-commit hooks are executed via tox -e pre-commit to enforce code quality and style checks.

  8. Upload Coverage to Codecov:
    Finally, the coverage report is uploaded to Codecov. The CODECOV_TOKEN secret is used to authenticate the upload securely.

Environment Variables