Commit Graph

67 Commits (master)

Author SHA1 Message Date
Benoit Pierre 21c6e37f5e ci: remove CircleCI unnecessary steps
The docker images should already contain all the necessary tools.
1 week ago
Frans de Jonge 50b8b60400
[CI] Don't hide docs generation log (#9204)
With reference to https://github.com/koreader/koreader/pull/9193#issuecomment-1153128485
2 years ago
Frans de Jonge d30a9b52dc
[CI] Use Ubuntu 20.04 Docker image for CI tests (#9007)
They don't seem to crash.

Supersedes #7775.
2 years ago
poire-z 56eae238f6 CI: force using luacheck 0.25.0 2 years ago
zwim f2557a7aa6
Terminal emulator: full rewrite, real vt52 emulator (#8636)
New real terminal emulator, replacing the old plugin.
The emulator is basically a vt52 terminal (enriched with
some ANSI-sequences, as ash, vi and mksh don't behave well
on a vt52 term).
So far working: ash, mksh, bash, nano, vi, busybox, watch...
The input supports: tab-completion; cursor movement;
backspace; start of line, end of line (long press);
page up, page down (long press).
User scripts may be placed in the koterm.koplugin/scripts/
folder, aliases can be put in the file aliases and startup
command in the file profile.user in that folder.
2 years 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 10584494ee
[CI] Minor updates for ShellCheck 0.8.0 (#8605)
Cf. <https://github.com/koreader/virdevenv/pull/71#discussion_r777025218>.
2 years ago
NiLuJe 77342908e6 CI: Update to Busted 2.0.0 3 years ago
NiLuJe cb2314d11b
Kobo, Mk.5: Tweak CPU frequency scaling (#6905)
* Run grep against /proc/modules directly instead of forking to lsmod

* Revamp the CPUFreq governor choice logic

I finally figured out why the scaling on the H2O was so wonky:
Because it relies on an obscure i.MX hardware feature called DVFS,
and it gets flipped for mysterious workaround-y reasons depending on
Wi-Fi state...

* Start playing with conservative, because just staying pegged at max
clock is entirely stupid.

And DVFS is extremely conservative, it needs somewhat sustained load to
clock up...

* Take care of the DVFS switcheroo in the Wi-Fi scripts
3 years ago
Frans de Jonge 9b8996cd02
[CI] Update shellcheck URL (#6445)
Otherwise it fails when it doesn't hit cache.

Also update to 0.7.1.
4 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
Robert dd0c6c0bb8 [UX] Footer - add option chapter markers width (#5708) 4 years ago
Frans de Jonge be87fb27a0
[chore] Convert a couple more todos (#5267)
Cf. <https://github.com/koreader/koreader/pull/5244>.

Also update check.
5 years ago
Frans de Jonge a2dcfe9aec
[doc] Tag @todo, @fixme and @warning (#5244)
This commit standardizes the various todos around the code a bit in a manner recognized by LDoc.

Besides drawing more attention by being displayed in the developer docs, they're also extractable with LDoc on the command line:

```sh
ldoc --tags todo,fixme *.lua
```

However, whether that particular usage offers any advantage over other search tools is questionable at best.

* and some random beautification
5 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 da988c15de
[CI] Switch to custom xgettext build to extract multiline strings (#5242)
Because let's face it, it just looks much better this way.

Docker image update in https://github.com/koreader/virdevenv/pull/43

Discussion in https://github.com/koreader/koreader/pull/5238#issuecomment-523675211 and https://github.com/koreader/koreader/pull/4524
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
Martín Fernández bcac5b845b switch from ant to gradle, (#5096)
add support for runtime permissions on api23+
add support for devices with a notch on api28+
fix some potential memory leaks
do not check luajit-launcher shell scripts
5 years ago
Frans de Jonge c0ba6ae48e
[CI] Bump busted to v2.0.rc13-0 (#4966)
Includes https://github.com/koreader/koreader-base/pull/906

Cf. https://github.com/koreader/koreader-base/issues/905
5 years ago
Frans de Jonge 942f3ed5e4
[chore, CI] Update to Docker koappimage 0.1.3 for Ubuntu 16.04 (#4296) 5 years ago
Frans de Jonge c0c4bcdace
[chore, CI] Ensure no whitespace between gettext() call and string (#4530)
Follow-up to https://github.com/koreader/koreader/pull/4524

The regex in the Python wasn't actually picking up on that style of writing it at all, because it's not only ugly, but also so counter-intuitive that I overlooked to test for and add support for it.

```
_(
[[
```

It'd be easy to fix up the Python regex a little, and perhaps I will,
but either way it makes more sense to automatically enforce this as a coding standard.
5 years ago
onde2rock dad7f209fa [CI] Add a check to detect tab in lua files (#3919) 6 years ago
Frans de Jonge dbd9348b59
[fix, CI] silly typo in busted junit output patch 7 years ago
Frans de Jonge 72235cfdf5
[CI] apply patch for busted junit testcase time (#3450)
Apply junit testcase time fix so CircleCI can actually do something useful
with the results. This can be removed once there is a busted 2.0.rc13 or final

See 830f175c57
7 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 868860a62e CircleCI parallelization
* Enable parallelism in .circleci/config.yml
* Add BUSTED_SPEC_FILE to Makefile testfront
* Use it in .ci/test.sh with xargs for test parallelization

NB This is the dumb method of improving test time.
Ideally we want a workflow fan-in/fan-out approach.
7 years ago
Frans de Jonge 91f07b9d99 CircleCI cache fix (#3329)
* Update luarocks/shellcheck/shfmt check based on `deps-{{ arch }}-{{ checksum ".ci/install.sh" }}`
* We generate a git-rev-base to check whether we can trust the cache
  with `build-{{ arch }}-{{ checksum "git-rev-base" }}`

Binary dependencies require `{{ arch }}` because there are different CPUs used on the servers.
More information here: https://discuss.circleci.com/t/use-the-arch-cache-template-key-if-you-rely-on-cached-compiled-binary-dependencies/16129
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
Frans de Jonge ea033431aa CircleCI fixes
* shellcheck 0.4.5 fix `LC_ALL: en_US.UTF8` (can be removed for shellcheck 0.4.6)

* hush updated luacheck on `reader.lua`; we're not assigning any variables but `= nil` is redundant
7 years ago
Qingping Hou 283bffdce9 Add CircleCI (#3321) 7 years ago
Frans de Jonge a6be301695 Added Size module 7 years ago
Frans de Jonge 9eb073a524 [travis] Add protection against unscaled sizes
As pointed out by @poire-z

* [fix, UX] SkimToWidget scaling

* [fix] Button scaling

* [fix, UX] Scale ProgressWidget

* [fix, UX] Scale confirmbox

* [fix, UX] Scale just about everything
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 e3c17aa6d0 Travis: run luacheck on unit tests (#3059)
* Travis: run luacheck on unit tests
7 years ago
Frans de Jonge bbb80ab93a Travis: update shfmt to 1.3.1 (#2949) 7 years ago
poire-z cca9c09bb4 Bump base/crengine for SVG images support
Parsing and rasterisation provided by nanosvg (some svg tags like text,
span and images are not supported).
Only svg image included as files in the .epub are supported
(embedded svg tags in html are not).
Holding on svg image shows it 4x zoomed in ImageViewer.
7 years ago
Frans de Jonge b3a93d1456 Travis: update shfmt to v1.3.0 (#2821)
* Travis: update shfmt to v1.3.0

* better error message

* fix kodev problem & fix slightly broken formatting
7 years ago
Qingping Hou 72ae80870c quickstart fix (#2804)
* translation text fix

* quickstart(fix): go back to home dir after document close

* quickstart(fix): purge old quick start files

* spec: fix quickstart tests
7 years ago
Frans de Jonge 6542382a0c Travis: `git fetch --unshallow` for version number
Travis only makes a shallow clone of --depth=50. KOReader is small enough that we can just grab it all. This is necessary to generate the version number, without which some tests will fail.

I'm not entirely sure why something like `git fetch origin master tags/v2015.11` doesn't do the trick, but it doesn't matter much.
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 86e924aa45 ci(fix): run luacheck on plugins dir 7 years ago
Qingping Hou 2242751d4a build: fix automated documentation build 8 years ago