mirror of
https://github.com/koreader/koreader
synced 2024-11-16 06:12:56 +00:00
624762a6bf
Add authentication to Docker image. This will be required by November 1. See <https://docs.docker.com/docker-hub/download-rate-limit/> and <https://discuss.circleci.com/t/authenticate-with-docker-to-avoid-impact-of-nov-1st-rate-limits/37567?mkt_tok=eyJpIjoiT1dVNE9EWmhNRFJtWTJObSIsInQiOiJOd1lnZHJidWpyU2ZqMG1JM21cL1Yxc1BsK1M1cWYwWnljeE43WlQ2K2tcL0ZKNnpXUElISjl6djlIM2FucTl4ekY3bjFBUVRxbXJ5XC93YTlZYlF2Z0pWeU1OM2FQR2RFNWFWOFBURk80RElsK3JabHZqT09qc3FYOE1aS0VUdFo4MiJ9> for more information.
83 lines
2.8 KiB
YAML
83 lines
2.8 KiB
YAML
version: 2
|
|
jobs:
|
|
build:
|
|
docker:
|
|
- image: koreader/koappimage:0.1.7
|
|
auth:
|
|
username: $DOCKER_USERNAME
|
|
password: $DOCKER_PASSWORD
|
|
environment:
|
|
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: 2
|
|
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
|
|
- restore_cache:
|
|
keys:
|
|
- build-{{ arch }}-{{ checksum "git-rev-base" }}
|
|
- run: echo 'export PATH=${HOME}/bin:${PATH}' >> $BASH_ENV
|
|
- 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" }}-{{ checksum ".ci/helper_luarocks.sh" }}
|
|
paths:
|
|
- "/home/ko/bin"
|
|
- "/home/ko/.luarocks"
|
|
# compiled luarocks binaries
|
|
- "install"
|
|
|
|
# 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: docs-and-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
|
|
|
|
workflows:
|
|
version: 2
|
|
build:
|
|
jobs:
|
|
- build:
|
|
context: koreader-vars
|