Commit Graph

25 Commits (master)

Author SHA1 Message Date
Benoit Pierre 76bdb7e65c ci/circle: improve caching
Don't cache the whole base directory; instead independently cache:
- the build output directory
- the ccache directory

This allow completely avoiding the need for building base if a
cache (keyed on the relevant parts of the git tree for base) is
successfully restored, as well as reducing the amount of cached
data.

Additionally, ensure caches are isolated by branch name (but allow
falling back to a "master" cache for restore): we don't want PRs
using each others' caches.
5 days ago
Frans de Jonge ec280f874f
[CI] Fix CircleCI context issue by separating out docs & translations (#8614)
See <https://github.com/koreader/koreader/pull/8607> for discussion.
2 years ago
Frans de Jonge 668eee97fa
[CI] Add curly braces check (#5809)
Update shellcheck and shfmt to the latest version.

Fixes <https://github.com/koreader/koreader/issues/5152>.

Btw, you can apply shellcheck suggestions with a command like:

```
shellcheck --include=SC2250 -f diff *.sh | git apply
```
4 years ago
Frans de Jonge 143c7e4131
[chore] Prevent useless POT updates (#5734)
If only 1 line changed, it's just the timestamp. Otherwise every commit in the main repo will result in a useless one in koreader/koreader-translations, such as <eadc9f133a>.
4 years ago
Frans de Jonge 8a474e6922
Finish Weblate migration (#5713)
Closes #3754.

Adds an automated source file push to the koreader/koreader-translations repo and a cute little badge.
4 years ago
Frans de Jonge 49f06f8d36
Disable Transifex push 4 years ago
Frans de Jonge a4e3e8b990
[fix, CI] Push developer docs once again (#5243)
It's been broken since https://github.com/koreader/koreader/pull/3340 nearly two years ago.
5 years ago
Frans de Jonge e2ceace302
[fix, CI] Push to Transifex from master, fix multiline strings for xgettext (#5238)
Related to https://github.com/koreader/koreader/pull/5237
5 years ago
Frans de Jonge 53c0756def CircleCI: finishing touches (#3340)
* junit test results; unfortunately this seems to conflict with the verbose out

* fix deps cache: two files can change independently

* verbose print obsoleted by gtest in upsream busted
7 years ago
Frans de Jonge aaab777ddb [CI] Switch to Codecov (#3336)
The debug output from Coveralls was rubbish. `"Build processing error"`
Besides some basics like checking if we were actually sending
valid JSON that gives us absolutely nothing to work with.
7 years ago
Frans de Jonge fa7763f59b CircleCI: run docs & coverage in first container only (#3335)
I wrote this whole complicated wofkflow-based config file, but except
in the case of a base rebuild it wouldn't really be any faster than
this simple tweak.

```
defaults: &defaults
    docker:
      - image: houqp/kobase:0.0.5
        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

version: 2
jobs:
  install-and-build:
    <<: *defaults
    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" }}
      # 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
      - 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"
      - run:
          name: fetch
          command: .ci/fetch.sh
      - run:
          name: check
          command: .ci/check.sh
      - run:
          name: build
          command: .ci/build.sh
      - save_cache:
          key: build-{{ checksum "base/git-rev" }}
          paths:
            - "/home/ko/.ccache"
            - "base"
      - persist_to_workspace:
          # Must be an absolute path, or relative path from working_directory
          root: "./"
          # Must be relative path from root
          paths:
            # front build
            - "koreader-emulator-x86_64-linux-gnu/koreader"

  test:
    <<: *defaults
    parallelism: 4
    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" }}
      # 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
      - attach_workspace:
          # Must be absolute path or relative path from working_directory
          at: "./"
      - run:
          name: test
          command: .ci/test.sh

  docs-and-coverage:
    <<: *defaults
    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" }}
      # 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
      - attach_workspace:
          # Must be absolute path or relative path from working_directory
          at: "./"
      - run:
          name: cleanup
          command: .ci/after_success.sh

workflows:
  version: 2
  build-and-test:
    jobs:
      - install-and-build
      - test:
          requires:
            - install-and-build
      - docs-and-coverage:
          requires:
            - install-and-build
```
7 years ago
Frans de Jonge 99d06ae928 CircleCI docs (#3327)
* Environment variable key replaced by CircleCI GitHub push key.
  See <https://circleci.com/docs/1.0/adding-read-write-deployment-key/>.

* Temporarily added `|| true` to luacov so it won't cause a fail.
7 years ago
Qingping Hou 283bffdce9 Add CircleCI (#3321) 7 years ago
Frans de Jonge 7376c57ceb [ci] after_success.sh: add --verbose flag to luacov-coveralls 7 years ago
Frans de Jonge 9ba69f4c4f fix coverage 7 years ago
Frans de Jonge e8c01274f4 Travis: enforce shellscript coding style
* enormous coding style update

* update luajit-launcher

All changes are formatting only except for:

* new more correct pushd/popd style
	* keeps useful indentation
	* prevents execution of commands when pushd failed (cf. https://github.com/koalaman/shellcheck/wiki/SC2164 and https://github.com/koalaman/shellcheck/issues/863)

```
pushd some_dir && {
    command1
    command2
} || exit
popd
```
7 years ago
Frans de Jonge 9d39f11f59 Travis: speed up by caching base and running luacheck earlier (#2741)
* Travis: speed up by caching base and running luacheck earlier
* ignore bin and install for git status change detection
* skip coverage except on official master branch. It adds 3 whole minutes and does nothing to prevent regressions
* also cache ~/.luarocks. It evens out but would generally prevent remote timeout shenenigans
* remove base cache dir before caching with verbose remove to see what's going on
* more inclusive shell code quality analysis
* fixed more shellcheck issues
* better shellcheck/shfmt debugging info
7 years ago
Frans de Jonge e5bcdee85e Add ShellCheck and shfmt shell code quality analysis (#2712)
* Add ShellCheck and shfmt shell code quality analysis

* kobo/koreader.sh: remove useless $PREFIX

* kobo/koreader.sh: fix rotation issue caused by #2731

* Travis: speed up (caching Luarocks should shave a minute off install process)
7 years ago
Qingping Hou 2242751d4a build: fix automated documentation build 8 years ago
Qingping Hou 31206cb80f ci: fix coverage report 8 years ago
Qingping Hou 2c23f79098 doc: use git add -A to pick up deleted files in travis 8 years ago
Qingping Hou f1ba3ef10d doc: add new files in travis doc push 8 years ago
Qingping Hou 8c01835458 fix: only show reader status at the end of the book 8 years ago
Qingping Hou 69f9ebd528 build: fix doc generation
also moved MD5 to koreader-base/ffi
8 years ago
Qingping Hou 83cc67b660 build: deploy doc update after sucess 8 years ago