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:
|
2024-04-30 18:11:02 +00:00
|
|
|
- image: koreader/kobase:0.3.2-20.04
|
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
|
2024-04-14 15:32:33 +00:00
|
|
|
environment:
|
|
|
|
BASH_ENV: "~/.bashrc"
|
2017-10-11 06:38:30 +00:00
|
|
|
parallelism: 2
|
2017-09-07 04:26:20 +00:00
|
|
|
steps:
|
|
|
|
- checkout
|
2017-10-10 06:47:46 +00:00
|
|
|
# need to init some stuff first or git will complain when sticking in base cache
|
2024-04-14 15:32:33 +00:00
|
|
|
- run: git submodule update --init base && git -C base submodule update --depth 1 --init --jobs 3 --recursive
|
2017-10-10 06:47:46 +00:00
|
|
|
# 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-10-10 15:57:50 +00:00
|
|
|
|
|
|
|
# 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:
|
2024-04-30 18:11:02 +00:00
|
|
|
- image: koreader/kobase:0.3.2-20.04
|
2022-01-04 21:17:40 +00:00
|
|
|
auth:
|
|
|
|
username: $DOCKER_USERNAME
|
|
|
|
password: $DOCKER_PASSWORD
|
|
|
|
environment:
|
|
|
|
EMULATE_READER: 1
|
2024-04-14 15:32:33 +00:00
|
|
|
environment:
|
|
|
|
BASH_ENV: "~/.bashrc"
|
2022-01-04 21:17:40 +00:00
|
|
|
parallelism: 1
|
|
|
|
steps:
|
|
|
|
- checkout
|
|
|
|
- run:
|
2024-04-14 15:32:33 +00:00
|
|
|
name: fetch
|
|
|
|
command: .ci/fetch.sh
|
2022-01-04 21:17:40 +00:00
|
|
|
|
|
|
|
# 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
|