diff --git a/.ci/after_success.sh b/.ci/after_success.sh index 7e537ad42..3632260f6 100755 --- a/.ci/after_success.sh +++ b/.ci/after_success.sh @@ -6,12 +6,10 @@ source "${CI_DIR}/common.sh" set +e -echo "$CIRCLE_NODE_INDEX" +echo "CIRCLE_NODE_INDEX: ${CIRCLE_NODE_INDEX}" if [ ! "$CIRCLE_NODE_INDEX" = 0 ]; then echo -e "\\n${ANSI_GREEN}Not on first node. Skipping documentation update and coverage." elif [ -z "${CIRCLE_PULL_REQUEST}" ] && [ "${CIRCLE_BRANCH}" = 'master' ]; then - travis_retry luarocks --local install ldoc - echo -e "\\n${ANSI_GREEN}Checking out koreader/doc for update." git clone git@github.com:koreader/doc.git koreader_doc @@ -34,13 +32,10 @@ elif [ -z "${CIRCLE_PULL_REQUEST}" ] && [ "${CIRCLE_BRANCH}" = 'master' ]; then echo -e "\\n${ANSI_GREEN}Documentation update pushed." } && popd || exit - # rerun make to regenerate /spec dir (was deleted to prevent uploading to cache) - echo -e "\\n${ANSI_GREEN}make all" - make all travis_retry make coverage pushd koreader-*/koreader && { - # temporarily use || true so builds won't fail until we figure out the coverage issue - luajit "$(which luacov-coveralls)" --verbose || true + # see https://github.com/codecov/example-lua + bash <(curl -s https://codecov.io/bash) } && popd || exit else echo -e "\\n${ANSI_GREEN}Not on official master branch. Skipping documentation update and coverage." diff --git a/.ci/helper_luarocks.sh b/.ci/helper_luarocks.sh index d21becfa0..42209d3d7 100755 --- a/.ci/helper_luarocks.sh +++ b/.ci/helper_luarocks.sh @@ -13,9 +13,9 @@ travis_retry luarocks --local install luafilesystem travis_retry luarocks --local install ansicolors travis_retry luarocks --local install busted 2.0.rc12-1 #- mv -f $HOME/.luarocks/bin/busted_bootstrap $HOME/.luarocks/bin/busted -travis_retry luarocks --local install luacov -# luasec doesn't automatically detect 64-bit libs -travis_retry luarocks --local install luasec OPENSSL_LIBDIR=/usr/lib/x86_64-linux-gnu -travis_retry luarocks --local install luacov-coveralls --server=http://rocks.moonscript.org/dev travis_retry luarocks --local install luacheck travis_retry luarocks --local install lanes # for parallel luacheck + +# used only on master branch but added to cache for better speed +travis_retry luarocks --local install ldoc +travis_retry luarocks --local install luacov diff --git a/.circleci/config.yml b/.circleci/config.yml index fd11f8c9f..a8782e387 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -7,7 +7,7 @@ jobs: EMULATE_READER: 1 # this is for shellcheck 0.4.5 and lower; can be removed for 0.4.6 LC_ALL: en_US.UTF8 - parallelism: 4 + parallelism: 3 steps: - checkout - restore_cache: @@ -25,9 +25,20 @@ jobs: - run: name: setup command: .ci/before_install.sh + + # installs and caches testing tools - run: name: install command: .ci/install.sh + - save_cache: + key: deps-{{ arch }}-{{ checksum ".ci/install.sh" }} + paths: + - "/home/ko/bin" + - "/home/ko/.luarocks" + # compiled luarocks binaries + - "install" + + # installs everything and caches base - run: name: fetch command: .ci/fetch.sh @@ -37,25 +48,19 @@ jobs: - run: name: build command: .ci/build.sh - - run: - name: test - command: .ci/test.sh - - run: - name: cleanup - command: .ci/after_success.sh - - - run: - name: clean up cache - command: rm -frv ./base/build/*/{spec,cache/*} + # we want to save cache prior to testing so we don't have to clean it up - save_cache: key: build-{{ arch }}-{{ checksum "git-rev-base" }} paths: - "/home/ko/.ccache" - "base" - - save_cache: - key: deps-{{ arch }}-{{ checksum ".ci/install.sh" }} - paths: - - "/home/ko/bin" - - "/home/ko/.luarocks" - # compiled luarocks binaries - - "install" + + # our lovely unit tests + - run: + name: test + command: .ci/test.sh + + # docs and coverage, master branch only + - run: + name: docs-and-coverage + command: .ci/after_success.sh diff --git a/README.md b/README.md index 4859962dd..9e50aaa2f 100644 --- a/README.md +++ b/README.md @@ -300,8 +300,8 @@ http://ccache.samba.org [linux-vm]:http://www.howtogeek.com/howto/11287/how-to-run-ubuntu-in-windows-7-with-vmware-player/ [l10n-readme]:https://github.com/koreader/koreader/blob/master/l10n/README.md [koreader-transifex]:https://www.transifex.com/projects/p/koreader/ -[coverage-badge]:https://coveralls.io/repos/github/koreader/koreader/badge.svg?branch=master -[coverage-link]:https://coveralls.io/github/koreader/koreader?branch=master +[coverage-badge]:https://codecov.io/gh/koreader/koreader/branch/master/graph/badge.svg +[coverage-link]:https://codecov.io/gh/koreader/koreader [licence-badge]:http://img.shields.io/badge/licence-AGPL-brightgreen.svg [gitter-badge]:https://badges.gitter.im/Join%20Chat.svg [gitter-link]:https://gitter.im/koreader/koreader?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge