Skip to content

Commit

Permalink
Merge pull request #1 from glicerico/add_circleci
Browse files Browse the repository at this point in the history
added circleci yaml file
  • Loading branch information
glicerico authored Apr 9, 2019
2 parents 6c80ce5 + 557499b commit c8fd618
Showing 1 changed file with 144 additions and 0 deletions.
144 changes: 144 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
version: 2.0

jobs:
atomspace:
docker:
- image: opencog/opencog-deps
user: root
environment:
PGHOST: opencog-postgres
PGUSER: opencog_test
PGPASSWORD: cheese
CCACHE_DIR: /ws/ccache
- image: opencog/postgres
name: opencog-postgres
working_directory: /ws/learn
steps:
- attach_workspace:
at: /ws
- run:
name: Start restoring ccache
command: date +%d-%m-%Y > /tmp/date
- restore_cache:
keys:
- ccache-{{ checksum "/tmp/date" }}
- ccache-
- run:
name: Install cogutil
command: |
git clone --depth 1 https://github.com/$CIRCLE_PROJECT_USERNAME/cogutil /ws/cogutil
mkdir -p /ws/cogutil/build
cd /ws/cogutil/build && cmake .. && make -j2 && make -j2 install
ldconfig
- run:
name: Checkout AtomSpace
command: git clone --depth 1 https://github.com/$CIRCLE_PROJECT_USERNAME/atomspace /ws/atomspace
- restore_cache:
name: Restore GCH Cache
keys:
- ghc-{{checksum "/ws/atomspace/opencog/haskell/stack.yaml"}}-{{ arch }}
- restore_cache:
name: Restore Haskell Deps Cache
keys:
- haskelldeps-{{checksum "/ws/atomspace/opencog/haskell/stack.yaml"}}-{{checksum "/ws/atomspace/opencog/haskell/opencog-atomspace.cabal"}}-{{ arch }}
- run:
name: Install AtomSpace
command: |
mkdir -p /ws/atomspace/build
cd /ws/atomspace/build && cmake .. && make -j4 && make -j4 install
ldconfig
- save_cache:
name: Save GHC Cache
key: ghc-{{checksum "/ws/atomspace/opencog/haskell/stack.yaml"}}-{{ arch }}
paths:
- /root/.stack
- save_cache:
name: Save Haskell Deps Cache
key: haskelldeps-{{checksum "/ws/atomspace/opencog/haskell/stack.yaml"}}-{{checksum "/ws/atomspace/opencog/haskell/opencog-atomspace.cabal"}}-{{ arch }}
paths:
- /ws/atomspace/opencog/haskell/.stack-work
- run:
name: Checkout OpenCog
command: git clone --depth 1 https://github.com/$CIRCLE_PROJECT_USERNAME/opencog /ws/opencog
- run:
name: Install OpenCog
command: |
mkdir -p /ws/opencog/build
cd /ws/opencog/build && cmake .. && make -j4 && make -j4 install
ldconfig
- checkout
- restore_cache:
name: Restore GCH Cache
keys:
- ghc-{{checksum "/ws/atomspace/opencog/haskell/stack.yaml"}}-{{ arch }}
- restore_cache:
name: Restore Haskell Deps Cache
keys:
- haskelldeps-{{checksum "/ws/atomspace/opencog/haskell/stack.yaml"}}-{{checksum "/ws/atomspace/opencog/haskell/opencog-atomspace.cabal"}}-{{ arch }}
- run:
name: CMake Configure
command: mkdir build && cd build && cmake ..
- run:
name: Build
command: cd build && make -j2
- run:
name: Build tests
command: cd build && make -j2 tests
- run:
name: Run tests
command: cd build && make -j2 test ARGS=-j2
- run:
name: Install learn
command: cd build && make -j2 install && ldconfig
# - run:
# name: Build examples
# command: cd build && make -j2 examples
- run:
name: Print test log
command: cat build/tests/Testing/Temporary/LastTest.log
when: always
- save_cache:
name: Save GHC Cache
key: ghc-{{checksum "/ws/atomspace/opencog/haskell/stack.yaml"}}-{{ arch }}
paths:
- /root/.stack
- save_cache:
name: Save Haskell Deps Cache
key: haskelldeps-{{checksum "/ws/atomspace/opencog/haskell/stack.yaml"}}-{{checksum "/ws/atomspace/opencog/haskell/opencog-atomspace.cabal"}}-{{ arch }}
paths:
- /ws/atomspace/opencog/haskell/.stack-work
- persist_to_workspace:
root: /ws/
paths:
- cogutil
- atomspace
- opencog
- ccache

# package: #Place holder
# docker:
# - image: opencog/opencog-deps
# user: root
# working_directory: /ws/atomspace
# steps:
# - attach_workspace:
# at: /ws/
# - 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:
# - atomspace
# - package:
# requires:
# - atomspace
# filters:
# branches:
# only: master

0 comments on commit c8fd618

Please sign in to comment.