version: 2.1

orbs:
    slack: circleci/slack@3.4.2

workflows:
    version: 2

    nightly:
        when:
            and:
                - equal: [ scheduled_pipeline, << pipeline.trigger_source >> ]
                - equal: [ "nightly_v7", << pipeline.schedule.name >> ]
        jobs:
            - checkout_ce
            - build_dev:
                  is_ee_built: false
                  requires:
                      - checkout_ce
            - test_back_static_and_acceptance:
                  requires:
                      - build_dev
            - test_front_static_acceptance_and_integration:
                  requires:
                      - build_dev
            - test_back_phpunit:
                  requires:
                      - build_dev
            - test_back_behat_legacy:
                  requires:
                      - build_dev
            - test_back_data_migrations:
                  requires:
                      - build_dev
