version: 2

jobs:
    build:
        docker:
            - image: rikorose/gcc-cmake

        working_directory: ~/MeadowsECS

        steps:
            - checkout
            - run:
                command: |
                    mkdir ~/build
                    cd ~/build
                    cmake -G"Unix Makefiles" -DBUILD_SHARED_LIBS=OFF ~/MeadowsECS
            - run:
                command: |
                    cd ~/build
                    make -j2
            - persist_to_workspace:
                root: ~/
                paths:
                    - build/*

    test:
        docker:
            - image: rikorose/gcc-cmake

        working_directory: ~/meadows

        steps:
            - checkout
            - attach_workspace:
                at: ~/
            - run:
                command: |
                    cd ~/build
                    make test

workflows:
    version: 2

    build_with_dependencies:
        jobs:
            - build
            - test:
                requires:
                    - build

version: 2

jobs:
    build:
        docker:
            - image: rikorose/gcc-cmake

        working_directory: ~/MeadowsECS

        steps:
            - checkout
            - run:
                command: |
                    mkdir ~/build
                    cd ~/build
                    cmake -G"Unix Makefiles" -DBUILD_SHARED_LIBS=OFF -DBUILD_TEST=ON ~/MeadowsECS
            - run:
                command: |
                    cd ~/build
                    make -j2 MeadowsECS
            - persist_to_workspace:
                root: ~/
                paths:
                    - build/*

    test:
        docker:
            - image: rikorose/gcc-cmake

        working_directory: ~/meadows

        steps:
            - checkout
            - attach_workspace:
                at: ~/
            - run:
                command: |
                    cd ~/build
                    make -j2 test

workflows:
    version: 2

    build_with_dependencies:
        jobs:
            - build
            - test:
                requires:
                    - build

Fix building of unit tests
Fix building of unit tests
