version: 2

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

        working_directory: ~/MeadowsECS

        steps:
            - checkout
            - run:
                command: |
                    mkdir ~/build
                    mkdir -p ~/release/lib
                    mkdir -p ~/release/include
                    cp include/MeadowsECS/* ~/release/include
                    cd ~/build
                    cmake -G"Unix Makefiles" -DBUILD_SHARED_LIBS=ON -DBUILD_TEST=ON ~/MeadowsECS
            - run:
                command: |
                    cd ~/build
                    make -j2 MeadowsECS
                    cp libMeadowsECS.so ~/release/lib
            - run:
                command: |
                    mkdir ~/artifacts
                    cd ~/release
                    tar -zcf ~/artifacts/MeadowsECS-${CIRCLE_BRANCH}-${CIRCLE_BUILD_NUM}.tar.gz ./*
            - run:
                command: |
                    mkdir -p ~/test-results/junit
                    cd ~/build
                    make -j2 MeadowsECSTest
                    ./test/MeadowsECSTest -r junit > ~/test-results/junit/MeadowsECSTests.xml
            - store_test_results:
                path: ~/test-results
            - store_artifacts:
                path: ~/artifacts
version: 2

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

        working_directory: ~/MeadowsECS

        steps:
            - checkout
            - run:
                command: |
                    mkdir ~/build
                    mkdir -p ~/release/lib
                    mkdir -p ~/release/include
                    cp include/MeadowsECS/* ~/release/include
                    cd ~/build
                    cmake -G"Unix Makefiles" -DBUILD_SHARED_LIBS=ON -DBUILD_TEST=ON ~/MeadowsECS
            - run:
                command: |
                    cd ~/build
                    make -j2 MeadowsECS
                    cp libMeadowsECS.so ~/release/lib
            - run:
                command: |
                    mkdir ~/artifacts
                    cd ~/release
                    tar -zcf ~/artifacts/MeadowsECS-${CIRCLE_BRANCH}-${CIRCLE_BUILD_NUM}.tar.gz *
            - run:
                command: |
                    mkdir -p ~/test-results/junit
                    cd ~/build
                    make -j2 MeadowsECSTest
                    ./test/MeadowsECSTest -r junit > ~/test-results/junit/MeadowsECSTests.xml
            - store_artifacts:
                path: ~/artifacts
            - store_artifacts:
                path: ~/test-results
            - store_test_results:
                path: ~/test-results
Fix release tar.gz layout and add test results to artifacts
Fix release tar.gz layout and add test results to artifacts
