version: 2 workflows: version: 2 build: jobs: - build - docs: context: koreader-vars filters: branches: only: master requires: - build jobs: build: docker: - image: koreader/kobase:0.3.2-20.04 auth: username: $DOCKER_USERNAME password: $DOCKER_PASSWORD environment: EMULATE_READER: 1 environment: BASH_ENV: "~/.bashrc" parallelism: 2 steps: - checkout # need to init some stuff first or git will complain when sticking in base cache - run: git submodule update --init base && git -C base submodule update --depth 1 --init --jobs 3 --recursive # we can't use command output directly for cache check so we write it to git-rev-base - run: pushd base && git_rev_base=$(git describe HEAD) && popd && echo $git_rev_base && echo $git_rev_base >git-rev-base - restore_cache: keys: - build-{{ arch }}-{{ checksum "git-rev-base" }} # installs everything and caches base - run: name: fetch command: .ci/fetch.sh - run: name: check command: .ci/check.sh - run: name: build command: .ci/build.sh # 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" # our lovely unit tests - run: name: test command: .ci/test.sh # docs, coverage, and test timing (can we use two outputs at once?); master branch only - run: name: coverage command: .ci/after_success.sh # by storing the test results CircleCI automatically distributes tests based on execution time - store_test_results: path: koreader-emulator-x86_64-linux-gnu/koreader # CircleCI doesn't make the test results available as artifacts (October 2017) - store_artifacts: path: koreader-emulator-x86_64-linux-gnu/koreader/junit-test-results.xml docs: docker: - image: koreader/kobase:0.3.2-20.04 auth: username: $DOCKER_USERNAME password: $DOCKER_PASSWORD environment: EMULATE_READER: 1 environment: BASH_ENV: "~/.bashrc" parallelism: 1 steps: - checkout - run: name: fetch command: .ci/fetch.sh # docs, coverage, and test timing (can we use two outputs at once?); master branch only - run: name: docs-and-translation command: .ci/after_success_docs_translation.sh