OverviewFilesCommitsIssuesDocsReleasesPeers

opencog-cogutil / .circleci / config.yml

234 lines · yaml ref:
version: 2.0

jobs:
  cogutil:
    docker:
      - image: $CIRCLE_PROJECT_USERNAME/opencog-deps
        user: root
        environment:
          CCACHE_DIR: /ws/ccache
    working_directory: /ws/cogutil
    steps:
      - run:
          name: Start restoring ccache
          command: date +%d-%m-%Y > /tmp/date
      - restore_cache:
          keys:
            - ccache-{{ checksum "/tmp/date" }}
            - ccache-
      - checkout
      - run:
          name: Set number of make jobs
          command: echo "export MAKEFLAGS=-j2" >> $BASH_ENV
      - run:
          name: CMake Configure
          command: mkdir build && cd build && cmake ..
      - run:
          name: Build
          command: cd build && make
      - run:
          name: Build tests
          command: cd build && make tests
      - run:
          name: Run tests
          command: cd build && make check ARGS="$MAKEFLAGS"
      - run:
          name: Print test log
          command: cat build/tests/Testing/Temporary/LastTest.log
          when: always
      - persist_to_workspace:
          root: /ws/
          paths:
            - cogutil
            - ccache

  atomspace:
    docker:
      - image: $CIRCLE_PROJECT_USERNAME/opencog-deps
        user: root
        environment:
          CCACHE_DIR: /ws/ccache
    working_directory: /ws/atomspace
    steps:
      - attach_workspace:
          at: /ws
      - run:
          name: Set number of make jobs
          command: echo "export MAKEFLAGS=-j2" >> $BASH_ENV
      - run:
          name: Install CogUtil
          command: cd /ws/cogutil/build && make install && ldconfig
      - run:
          name: Checkout AtomSpace
          command: git clone --depth 1 https://github.com/$CIRCLE_PROJECT_USERNAME/atomspace .
      - run:
          name: CMake Configure
          command: mkdir build && cd build && cmake ..
      - run:
          name: Build
          command: cd build && make
      - run:
          name: Build tests
          command: cd build && make tests
      - run:
          name: Run tests
          # Run single-threaded to *maybe* help ParallelUTest not fail
          command: cd build && make check
      - run:
          name: Install AtomSpace
          command: cd build && make install && ldconfig
      - run:
          name: Print test log
          command: cat build/tests/Testing/Temporary/LastTest.log
          when: always
      - persist_to_workspace:
          root: /ws/
          paths:
            - atomspace
            - ccache

  cogserver:
    docker:
      - image: $CIRCLE_PROJECT_USERNAME/opencog-deps
        user: root
        environment:
          CCACHE_DIR: /ws/ccache
    working_directory: /ws/cogserver
    steps:
      - attach_workspace:
          at: /ws
      - run:
          name: Set number of make jobs
          command: echo "export MAKEFLAGS=-j2" >> $BASH_ENV
      - run:
          name: Install CogUtil
          command: cd /ws/cogutil/build && make -j2 install && ldconfig
      - run:
          name: Install AtomSpace
          command: cd /ws/atomspace/build && make install && ldconfig
      - run:
          name: Checkout AtomSpace Storage
          command: |
            git clone --depth 1 https://github.com/$CIRCLE_PROJECT_USERNAME/atomspace-storage /ws/atomspace-storage
            mkdir -p /ws/atomspace-storage/build
            cd /ws/atomspace-storage/build && cmake .. && make -j2 && make -j2 install
            ldconfig
      - run:
          name: Checkout CogServer
          command: git clone --depth 1 https://github.com/$CIRCLE_PROJECT_USERNAME/cogserver .
      - run:
          name: CMake Configure
          command: mkdir build && cd build && cmake ..
      - run:
          name: Build
          command: cd build && make
      - run:
          name: Build tests
          command: cd build && make tests
      - run:
          name: Run tests
          command: cd build && make check
      - run:
          name: Install CogServer
          command: cd build && make install && ldconfig
      - run:
          name: Print test log
          command: cat build/tests/Testing/Temporary/LastTest.log
          when: always
      - persist_to_workspace:
          root: /ws/
          paths:
            - atomspace-storage
            - cogserver
            - ccache

  unify:
    docker:
      - image: $CIRCLE_PROJECT_USERNAME/opencog-deps
        user: root
        environment:
          CCACHE_DIR: /ws/ccache
    working_directory: /ws/unify
    steps:
      - attach_workspace:
          at: /ws
      - run:
          name: Set number of make jobs
          command: echo "export MAKEFLAGS=-j2" >> $BASH_ENV
      - run:
          name: Install CogUtil
          command: cd /ws/cogutil/build && make install && ldconfig
      - run:
          name: Install AtomSpace
          command: cd /ws/atomspace/build && make install && ldconfig
      - run:
          name: Checkout Unify
          command: git clone --depth 1 https://github.com/$CIRCLE_PROJECT_USERNAME/unify .
      - run:
          name: CMake Configure
          command: mkdir build && cd build && cmake ..
      - run:
          name: Build
          command: cd build && make
      - run:
          name: Build tests
          command: cd build && make tests
      - run:
          name: Run tests
          command: cd build && make check ARGS="$MAKEFLAGS"
      - run:
          name: Install Unify
          command: cd build && make install && ldconfig
      - run:
          name: Print test log
          command: cat build/tests/Testing/Temporary/LastTest.log
          when: always
      - persist_to_workspace:
          root: /ws/
          paths:
            - unify
            # - ccache

  package:
    docker:
      - image: $CIRCLE_PROJECT_USERNAME/opencog-deps
        user: root
    working_directory: /ws/cogutil
    steps:
      - attach_workspace:
          at: /ws/
      - run:
          name: Build Debian package
          command: cd build && make install && make package
      - store_artifacts:
          path: build/packages/
      - run:
          name: Start storing ccache
          command: date +%d-%m-%Y > /tmp/date
      - save_cache:
          key: ccache-{{ checksum "/tmp/date" }}
          paths:
            - /ws/ccache

workflows:
  version: 2
  build-test-package:
    jobs:
      - cogutil
      - atomspace:
          requires:
            - cogutil
      - cogserver:
          requires:
            - atomspace
      - unify:
          requires:
            - atomspace
      - package:
          requires:
            - unify
            - cogserver
          filters:
            branches:
              only: master