Skip to content

refactor(workflows): use reusable workflows with a single branch#170

Merged
gustavovalverde merged 39 commits intomainfrom
ref-pipelines
Apr 16, 2025
Merged

refactor(workflows): use reusable workflows with a single branch#170
gustavovalverde merged 39 commits intomainfrom
ref-pipelines

Conversation

@gustavovalverde
Copy link
Member

Summary

This PR introduces a comprehensive GitHub Actions CI/CD pipeline for automating the build, testing, and publishing of Docker images for recent Odoo versions. It also updates the default environment configuration in .env to align base versions and testing settings.

Key Changes

1. CI/CD Pipeline Implementation (.github/workflows/)

  • build-test-publish.yaml: Main workflow triggered on pushes/PRs to main. Orchestrates the build, test, and publish stages.
  • image-builder.yaml: Reusable workflow for building and publishing multi-platform Docker images:
    • Builds for linux/amd64 and linux/arm64.
    • Supports multiple Odoo versions (15.0, 16.0, 17.0, 18.0, master) via matrix strategy.
    • Utilizes Docker buildx and layer caching (type=gha) for efficiency.
    • Pushes images to GHCR, Docker Hub, and GCR on pushes to the main branch.
    • Uses docker/metadata-action for consistent image tagging.
  • unit-tests.yaml: Reusable workflow (structure added) intended for running Odoo unit tests within the CI environment (currently excludes the master branch due to known issues).

2. Environment Configuration Update (.env)

  • Updated default Python version to 3.12 (slim-bookworm).
  • Updated default PostgreSQL version to 14.
  • Updated default Odoo version to 15.0. (Note: Confirm if this is the desired default for local setups).
  • Added WKHTMLTOX_VERSION explicitly.
  • Set default LOG_LEVEL to test.
  • Commented out RUN_TESTS and EXTRA_MODULES, suggesting tests are primarily run via CI rather than by default on local startup.

Rationale

  • Automation & Reliability: The CI/CD pipeline automates repetitive build and test tasks, ensuring consistency and reducing manual errors.
  • Multi-Platform Support: Building for amd64 and arm64 increases the usability of the Docker images across different architectures (e.g., Apple Silicon Macs, ARM servers).
  • Multi-Registry Publishing: Hosting images on multiple registries (GHCR, Docker Hub, GCR) improves availability and user choice.
  • Environment Standardization: Aligning the .env file provides a clearer default configuration, potentially geared towards compatibility with CI testing or a specific baseline version.

Points for Review

  • Please confirm the change of the default ODOO_VERSION in .env from 16.0 to 15.0.
  • Verify if LOG_LEVEL=test and commented-out RUN_TESTS/EXTRA_MODULES align with the intended default local development experience.

- Introduced a new GitHub Actions workflow for building, testing, and publishing Odoo images.
- Replaced the previous publish.yaml with a more modular approach using image-builder.yaml.
- Configured a matrix strategy for multiple Odoo versions and Python variants.
- Enhanced permissions and concurrency settings for better workflow management.
- Removed the old publish workflow to streamline CI/CD processes.
@gustavovalverde gustavovalverde merged commit 32424df into main Apr 16, 2025
10 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