Skip to content

ci: Implement comprehensive CI/CD pipeline #66

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

Merged
merged 13 commits into from
Jul 26, 2025
Merged

ci: Implement comprehensive CI/CD pipeline #66

merged 13 commits into from
Jul 26, 2025

Conversation

RandomProgramm3r
Copy link
Owner

This commit introduces a robust CI/CD pipeline using GitHub Actions, consolidating linting and testing into a single workflow. It also adds configuration for code coverage reporting.

Key changes:

  • New ci.yml Workflow: A new ci.yml workflow replaces the old linting.yml. This new workflow includes jobs for:
    • Linting: Running ruff to check code style and formatting.
    • Testing: Building Docker containers, running the test suite with coverage, and uploading the results to Codecov.
  • Coverage Configuration: A .coveragerc file has been added to configure the source files for coverage analysis and to exclude irrelevant files like tests and migrations.
  • README Update: The README.md has been updated to include a Codecov badge and reflect the new CI/CD workflow name.
  • Test Refinement: Removed redundant assertions from TestUserPromoFeed that checked for the absence of promo_common and promo_unique fields, as this is handled by the serializer.
  • Add Codecov badge URL in README
  • requirements/prod.txt: Added coverage to the list of production requirements.
  • Coverage Configuration: A .coveragerc file has been added to configure the source files for coverage analysis and to exclude irrelevant files like tests and migrations.

This commit introduces a robust CI/CD pipeline using GitHub Actions, consolidating linting and testing into a single workflow. It also adds configuration for code coverage reporting.

Key changes:
- **New `ci.yml` Workflow:** A new `ci.yml` workflow replaces the old `linting.yml`. This new workflow includes jobs for:
     - **Linting:** Running `ruff` to check code style and formatting.
     - **Testing:** Building Docker containers, running the test suite with `coverage`, and uploading the results to Codecov.
- **Coverage Configuration:** A `.coveragerc` file has been added to configure the source files for coverage analysis and to exclude irrelevant files like tests and migrations.
- **README Update:** The `README.md` has been updated to include a Codecov badge and reflect the new `CI/CD` workflow name.
 - **Test Refinement:** Removed redundant assertions from `TestUserPromoFeed` that checked for the absence of `promo_common` and `promo_unique` fields, as this is handled by the serializer.
This commit updates the `ci.yml` workflow to include the `docker/compose-action@v2`. This action ensures that Docker Compose and Buildx are properly set up and available for subsequent steps in the CI pipeline, improving the reliability of the build process.
This commit modifies the `ci.yml` workflow to manually install the Docker Compose plugin using `apt-get`. This replaces the `docker/compose-action` and provides more direct control over the installed version.

The new step updates the package list and installs `docker-compose-plugin`, ensuring that the `docker-compose` command is available for subsequent build and test steps.
This commit refactors the `ci.yml` workflow to use the modern Docker Compose V2 syntax (`docker compose` instead of `docker-compose`).

The manual installation step for the Docker Compose plugin has been removed, as the GitHub Actions runner environment includes a compatible version of Docker Compose V2 by default. This simplifies the workflow and relies on the standard tooling provided by the runner.
This commit updates the `ci.yml` workflow to use `POSTGRES_DB` and `POSTGRES_USER` instead of `POSTGRES_DATABASE` and `POSTGRES_USERNAME`.

This change aligns the environment variable names with the official PostgreSQL Docker image, ensuring correct database initialization in the CI environment.
This commit reverts the environment variable names for the PostgreSQL connection in the `ci.yml` workflow back to `POSTGRES_DATABASE` and `POSTGRES_USERNAME`.
This commit updates the `ci.yml` workflow to explicitly set the `POSTGRES_HOST` environment variable to `db`. This ensures the web service can reliably connect to the PostgreSQL container.

Additionally, a new step has been added to `cat` the `.env` file, providing better visibility into the environment configuration for debugging purposes.
This commit moves the `coverage` package into the main production dependencies to ensure it is always available in the application environment.

 Key changes:
 **`requirements/prod.txt`:** Added `coverage` to the list of production requirements.
 - **`ci.yml`:** Removed the temporary debugging step that printed the `.env` file contents, as it is no longer needed.
This commit updates the `ci.yml` workflow to use a `heredoc` (`<<EOF`) for creating the `.env` file. This improves the readability and maintainability of the environment variable setup compared to using multiple `echo` commands.
This commit updates the `ci.yml` workflow by quoting the `heredoc` delimiter (`<<'EOF'`). This prevents the shell from interpreting `${{...}}` as a shell variable, ensuring that the GitHub Actions context is correctly used to populate the secrets.
This commit updates the `ci.yml` workflow to change into the `promo_code` directory before executing the `coverage run` command.
This commit updates the `ci.yml` workflow with new environment variables for the anti-fraud service.

Key changes:
- The `ANTIFRAUD_INTERNAL_PORT` and `ANTIFRAUD_EXTERNAL_PORT` have been  changed to `9090`.
- The `ANTIFRAUD_CACHE_MS` has been increased to `5000`.
- A new `ANTIFRAUD_ADDRESS` variable has been added to provide the full  service URL.
@RandomProgramm3r RandomProgramm3r merged commit b03cb3c into main Jul 26, 2025
6 checks passed
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.

1 participant