2017-09-07 04:26:20 +00:00
|
|
|
version: 2
|
2022-01-04 21:17:40 +00:00
|
|
|
|
|
|
|
workflows:
|
|
|
|
version: 2
|
|
|
|
build:
|
|
|
|
jobs:
|
|
|
|
- build
|
|
|
|
- docs:
|
|
|
|
context: koreader-vars
|
|
|
|
filters:
|
|
|
|
branches:
|
|
|
|
only: master
|
|
|
|
requires:
|
|
|
|
- build
|
|
|
|
|
2017-09-07 04:26:20 +00:00
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
docker:
|
2021-10-06 07:09:28 +00:00
|
|
|
- image: koreader/koappimage:0.1.8
|
2020-10-09 17:15:16 +00:00
|
|
|
auth:
|
|
|
|
username: $DOCKER_USERNAME
|
|
|
|
password: $DOCKER_PASSWORD
|
2017-09-07 04:26:20 +00:00
|
|
|
environment:
|
|
|
|
EMULATE_READER: 1
|
2017-10-11 06:38:30 +00:00
|
|
|
parallelism: 2
|
2017-09-07 04:26:20 +00:00
|
|
|
steps:
|
|
|
|
- checkout
|
|
|
|
- restore_cache:
|
|
|
|
keys:
|
2017-10-10 06:47:46 +00:00
|
|
|
# binary dependencies require {{ arch }} because there are different CPUs in use on the servers
|
2017-10-11 06:38:30 +00:00
|
|
|
- deps-{{ arch }}-{{ checksum ".ci/install.sh" }}-{{ checksum ".ci/helper_luarocks.sh" }}
|
2017-10-10 06:47:46 +00:00
|
|
|
# need to init some stuff first or git will complain when sticking in base cache
|
|
|
|
- run: git submodule init base && git submodule update base && pushd base && git submodule init && git submodule update && popd
|
|
|
|
# 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" }}
|
2017-09-07 04:26:20 +00:00
|
|
|
- run: echo 'export PATH=${HOME}/bin:${PATH}' >> $BASH_ENV
|
|
|
|
- run:
|
|
|
|
name: setup
|
|
|
|
command: .ci/before_install.sh
|
2017-10-10 15:57:50 +00:00
|
|
|
|
|
|
|
# installs and caches testing tools
|
2017-09-07 04:26:20 +00:00
|
|
|
- run:
|
|
|
|
name: install
|
|
|
|
command: .ci/install.sh
|
2017-10-10 15:57:50 +00:00
|
|
|
- save_cache:
|
2017-10-11 06:38:30 +00:00
|
|
|
key: deps-{{ arch }}-{{ checksum ".ci/install.sh" }}-{{ checksum ".ci/helper_luarocks.sh" }}
|
2017-10-10 15:57:50 +00:00
|
|
|
paths:
|
|
|
|
- "/home/ko/bin"
|
|
|
|
- "/home/ko/.luarocks"
|
|
|
|
# compiled luarocks binaries
|
|
|
|
- "install"
|
|
|
|
|
|
|
|
# installs everything and caches base
|
2017-09-07 04:26:20 +00:00
|
|
|
- run:
|
|
|
|
name: fetch
|
|
|
|
command: .ci/fetch.sh
|
|
|
|
- run:
|
|
|
|
name: check
|
|
|
|
command: .ci/check.sh
|
|
|
|
- run:
|
|
|
|
name: build
|
|
|
|
command: .ci/build.sh
|
2017-10-10 15:57:50 +00:00
|
|
|
# we want to save cache prior to testing so we don't have to clean it up
|
2017-09-07 04:26:20 +00:00
|
|
|
- save_cache:
|
2017-10-10 06:47:46 +00:00
|
|
|
key: build-{{ arch }}-{{ checksum "git-rev-base" }}
|
2017-09-07 04:26:20 +00:00
|
|
|
paths:
|
|
|
|
- "/home/ko/.ccache"
|
|
|
|
- "base"
|
2017-10-10 15:57:50 +00:00
|
|
|
|
|
|
|
# our lovely unit tests
|
|
|
|
- run:
|
|
|
|
name: test
|
|
|
|
command: .ci/test.sh
|
|
|
|
|
2017-10-11 06:38:30 +00:00
|
|
|
# docs, coverage, and test timing (can we use two outputs at once?); master branch only
|
2017-10-10 15:57:50 +00:00
|
|
|
- run:
|
2022-01-04 21:17:40 +00:00
|
|
|
name: coverage
|
2017-10-10 15:57:50 +00:00
|
|
|
command: .ci/after_success.sh
|
2017-10-11 06:38:30 +00:00
|
|
|
# by storing the test results CircleCI automatically distributes tests based on execution time
|
|
|
|
- store_test_results:
|
2019-04-26 11:57:09 +00:00
|
|
|
path: koreader-emulator-x86_64-linux-gnu/koreader
|
2017-10-29 20:09:13 +00:00
|
|
|
# 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
|
2022-01-04 21:17:40 +00:00
|
|
|
docs:
|
|
|
|
docker:
|
|
|
|
- image: koreader/koappimage:0.2.2
|
|
|
|
auth:
|
|
|
|
username: $DOCKER_USERNAME
|
|
|
|
password: $DOCKER_PASSWORD
|
|
|
|
environment:
|
|
|
|
EMULATE_READER: 1
|
|
|
|
parallelism: 1
|
|
|
|
steps:
|
|
|
|
- checkout
|
|
|
|
- restore_cache:
|
|
|
|
keys:
|
|
|
|
# binary dependencies require {{ arch }} because there are different CPUs in use on the servers
|
|
|
|
- deps-{{ arch }}-{{ checksum ".ci/install.sh" }}-{{ checksum ".ci/helper_luarocks.sh" }}
|
|
|
|
# need to init some stuff first or git will complain when sticking in base cache
|
|
|
|
- run: git submodule init base && git submodule update base && pushd base && git submodule init && git submodule update && popd
|
|
|
|
# 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
|
2019-08-21 22:12:53 +00:00
|
|
|
|
2022-01-04 21:17:40 +00:00
|
|
|
- run:
|
|
|
|
name: init-submodules
|
|
|
|
command: git submodule init && git submodule sync && git submodule update
|
|
|
|
|
|
|
|
# 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
|