jobs:
    test_back_catalogs_ce:
        machine:
            image: 'ubuntu-2004:2022.04.1'
            docker_layer_caching: true
        steps:
            -   attach_workspace:
                    at: ~/
            -   fix_files_permissions
            -   load_docker_image_php
            -   run:
                    name: Coupling back
                    command: make catalogs-coupling-back
            -   run:
                    name: Lint back
                    command: make catalogs-cs-back catalogs-lint-back catalogs-check-configuration-back
            -   run:
                    name: Unit back
                    command: make catalogs-unit-back catalogs-mutation-unit-back
            -   start_test_containers
            -   run:
                    name: Integration back
                    command: APP_ENV=test EXPERIMENTAL_TEST_DATABASE=1 make catalogs-integration-back
            -   run:
                    name: Acceptance back
                    command: APP_ENV=test make catalogs-acceptance-back
            -   when:
                    condition: << pipeline.parameters.run-database-tests >>
                    steps:
                        -   run:
                                name: Lint migrations
                                command: make migration-lint-back migration-coupling-back
                        -   run:
                                name: Migrations tests
                                command: CI=false make migration-back
            -   store_test_results:
                    path: var/tests/phpunit
