refactor(workflows): use reusable workflows with a single branch #24
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Test and Publish | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: [main] | |
| paths: | |
| - "**/workflows/**" | |
| - "**/resources/**" | |
| - Dockerfile | |
| pull_request: | |
| paths: | |
| - "**/workflows/**" | |
| - "**/resources/**" | |
| - Dockerfile | |
| permissions: | |
| contents: read | |
| packages: write | |
| id-token: write | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.job }}-${{ github.head_ref || github.run_id }} | |
| cancel-in-progress: true | |
| jobs: | |
| build: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| odoo_version: ["15.0", "16.0", "17.0", "18.0", master] | |
| include: | |
| # Odoo-version-specific configurations | |
| - odoo_version: "15.0" | |
| python_version: "3.12" | |
| python_variant: slim-bullseye | |
| wkhtmltox_version: 0.12.6.1-3 | |
| - odoo_version: "16.0" | |
| python_version: "3.12" | |
| python_variant: slim-bookworm | |
| wkhtmltox_version: 0.12.6.1-3 | |
| - odoo_version: "17.0" | |
| python_version: "3.12" | |
| python_variant: slim-bookworm | |
| wkhtmltox_version: 0.12.6.1-3 | |
| - odoo_version: "18.0" | |
| python_version: "3.12" | |
| python_variant: slim-bookworm | |
| wkhtmltox_version: 0.12.6.1-3 | |
| - odoo_version: master | |
| python_version: "3.12" | |
| python_variant: slim-bookworm | |
| wkhtmltox_version: 0.12.6.1-3 | |
| uses: ./.github/workflows/build-docker-image.yaml | |
| with: | |
| odoo_version: ${{ matrix.odoo_version }} | |
| python_version: ${{ matrix.python_version }} | |
| python_variant: ${{ matrix.python_variant }} | |
| wkhtmltox_version: ${{ matrix.wkhtmltox_version }} | |
| dockerfile_path: Dockerfile | |
| dockerfile_target: production | |
| secrets: inherit | |
| test: | |
| needs: [build] | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| odoo_version: ["15.0", "16.0", "17.0", "18.0", master] | |
| uses: ./.github/workflows/unit-tests.yaml | |
| with: | |
| odoo_version: ${{ matrix.odoo_version }} | |
| secrets: inherit | |
| publish: | |
| needs: | |
| - build | |
| - test | |
| strategy: | |
| matrix: | |
| odoo_version: ["15.0", "16.0", "17.0", "18.0", master] | |
| include: | |
| # Odoo-version-specific configurations | |
| - odoo_version: "15.0" | |
| python_version: "3.10" | |
| python_variant: slim-bullseye | |
| wkhtmltox_version: 0.12.6 | |
| - odoo_version: "16.0" | |
| python_version: "3.12" | |
| python_variant: slim-bullseye | |
| wkhtmltox_version: 0.12.6 | |
| - odoo_version: "17.0" | |
| python_version: "3.13" | |
| python_variant: slim-bullseye | |
| wkhtmltox_version: 0.12.6 | |
| - odoo_version: "18.0" | |
| python_version: "3.13" | |
| python_variant: slim-bullseye | |
| wkhtmltox_version: 0.12.6 | |
| - odoo_version: master | |
| python_version: "3.13" | |
| python_variant: slim-bullseye | |
| wkhtmltox_version: 0.12.6 | |
| uses: ./.github/workflows/build-docker-image.yaml | |
| if: ${{ github.event_name != 'pull_request' }} | |
| with: | |
| odoo_version: ${{ matrix.odoo_version }} | |
| python_version: ${{ matrix.python_version }} | |
| python_variant: ${{ matrix.python_variant }} | |
| wkhtmltox_version: ${{ matrix.wkhtmltox_version }} | |
| dockerfile_path: Dockerfile | |
| dockerfile_target: production | |
| secrets: inherit |