[CI] Github Actions tests#8607
Conversation
|
Edit: they both had a cache miss |
|
Cached took: Now they are both at 4 min |
Changing translations from nightly to every commit on master was a great improvement imho, and I'm extremely satisfied about changing it, so definitely a yes on that one. For the docs it probably matters less, but a discrepancy is still a bit annoying and would actively get in the way of my current workflow. Most contributors don't run ldoc locally first, and I rarely fetch their branch just to run ldoc; it's easier to check the results 3 minutes later and usually it's perfectly fine. This would be impossible if you made it worse, though I could live with it. But it only takes a handful of seconds so I'm not sure what the big deal is anyway? ;-) |
0d00f63 to
6e9af02
Compare
np, it is just annoying to trigger a commit in a different repo with GHA |
|
Within an organization even? That's a bit annoying. |
Frenzie
left a comment
There was a problem hiding this comment.
Looks like it should be able to live next to CircleCI now? If so I'm fine with merging this already to start testing the basics in the wild. ^_^
Yes :( |
It's a bit surprising that this is also necessary within GitHub, but that's 100% identical to the former Travis and the current CircleCI setup.
You mean as a security precaution? Unless GHA has some serious design flaws a token is once entered and never shown to anyone. The only available option afterwards is deleting them. I'm fine with generating new ones and entering them in the secrets here. |
If anyone merges a malicious or buggy GHA they can exfiltrate the PAT or just commit etc as me in any of my repos. This is why github by default won't run workflows for first time contributors as a precaution in case they change or take advantage of a gha. |
👍 |
| check_submodules | ||
|
|
||
| # shellcheck disable=2016 | ||
| mapfile -t shellscript_locations < <({ git grep -lE '^#!(/usr)?/bin/(env )?(bash|sh)' && git submodule --quiet foreach '[ "$path" = "base" -o "$path" = "platform/android/luajit-launcher" ] || git grep -lE "^#!(/usr)?/bin/(env )?(bash|sh)" | sed "s|^|$path/|"' && git ls-files ./*.sh; } | sort | uniq) |
There was a problem hiding this comment.
Does anyone know what exactly the git grep -lE '^#!(/usr)?/bin/(env )?(bash|sh)' is supposed to pick up?
When run from the .ci/ folder i get all the scripts inside it (that are also picked up by the other ones). This is the way CircleCi uses it.
If i run it locally directly in the repo I get tons of other files including many from crengine. however GHA doe not seem to pick u on those (it should also be running from the koreader folder).
Which set of files do we actually want with this?
There was a problem hiding this comment.
git blame should probably say why I wrote it.
If i run it locally directly in the repo I get tons of other files including many from crengine.
I can't confirm that? Could you post the full command and output? Afaik it's been the same from git 2.1x or so all the way up to 2.32.
koreader$ ({ git grep -lE '^#!(/usr)?/bin/(env )?(bash|sh)' && git submodule --quiet foreach '[ "$path" = "base" -o "$path" = "platform/android/luajit-launcher" ] || git grep -lE "^#!(/usr)?/bin/(env )?(bash|sh)" | sed "s|^|$path/|"' && git ls-files ./*.sh; } | sort | uniq)
.ci/after_success.sh
.ci/before_install.sh
.ci/build.sh
.ci/check.sh
.ci/common.sh
.ci/fetch.sh
.ci/helper_luarocks.sh
.ci/helper_shellchecks.sh
.ci/install.sh
.ci/script.sh
.ci/test.sh
kodev
platform/appimage/AppRun
platform/cervantes/disable-usbms.sh
platform/cervantes/disable-wifi.sh
platform/cervantes/enable-usbms.sh
platform/cervantes/enable-wifi.sh
platform/cervantes/koreader.sh
platform/cervantes/koreader-standalone.sh
platform/cervantes/obtain-ip.sh
platform/cervantes/release-ip.sh
platform/cervantes/restore-wifi-async.sh
platform/cervantes/resume.sh
platform/cervantes/spinning_zsync
platform/cervantes/suspend.sh
platform/common/spinning_zsync
platform/debian/do_debian_package.sh
platform/debian/koreader.sh
platform/kindle/extensions/koreader/bin/koreader-ext.sh
platform/kindle/koreader.sh
platform/kindle/libkohelper.sh
platform/kobo/disable-wifi.sh
platform/kobo/enable-wifi.sh
platform/kobo/fmon/koreader.sh
platform/kobo/koreader.sh
platform/kobo/nickel.sh
platform/kobo/obtain-ip.sh
platform/kobo/release-ip.sh
platform/kobo/restore-wifi-async.sh
platform/mac/do_mac_bundle.sh
platform/pocketbook/koreader.app
platform/pocketbook/system_koreader.app
platform/remarkable/disable-wifi.sh
platform/remarkable/enable-wifi.sh
platform/remarkable/koreader.sh
platform/sony-prstux/resume.sh
platform/sony-prstux/set-wifi.sh
platform/sony-prstux/suspend.sh
platform/ubuntu-touch/koreader.sh
plugins/backgroundrunner.koplugin/luawrapper.sh
plugins/backgroundrunner.koplugin/wrapper.sh
It was intended to be as inclusive as possible. See #5096 (comment) as for why luajit-launcher is excluded a bit more draconically than I intended.
In retrospect I should've probably suggested reducing it to git grep -lE '^#!(/usr)?/bin/(env )?(bash|sh)', but I really only meant to exclude the gradle script, not our own. Much the same applies for base really. At the time that wasn't ready to pass yet.
Of course in principle that should all be checked in the relevant submodules themselves, but I liked the idea of a final check on everything.
tl;dr You can probably safely reduce the line to git grep -lE '^#!(/usr)?/bin/(env )?(bash|sh)'.
There was a problem hiding this comment.
koreader]$ { git grep -lE '^#!(/usr)?/bin/(env )?(bash|sh)' && git submodule --quiet foreach '[ "$path" = "base" -o "$path" = "platform/android/luajit-launcher" ] || git grep -lE "^#!(/usr)?/bin/(env )?(bash|sh)" | sed "s|^|$path/|"' && git ls-files ./*.sh; } | sort | uniq
base/.ci/build_script.sh
base/.ci/common.sh
base/.ci/emulator_install.sh
base/.ci/helper_luarocks.sh
base/.ci/helper_shellchecks.sh
base/.ci/lint_install.sh
base/.ci/lint_script.sh
base/.ci/test_script.sh
base/thirdparty/cmake_modules/patch-wrapper.sh
base/thirdparty/kpvcrlib/crengine/.ci/script.sh
base/thirdparty/kpvcrlib/crengine/cr3gui/po/update-po
base/thirdparty/kpvcrlib/crengine/cr3wx/macros/autogen.sh
base/thirdparty/kpvcrlib/crengine/thirdparty/antiword/Docs/Mozilla
base/thirdparty/kpvcrlib/crengine/thirdparty/antiword/kantiword
base/thirdparty/kpvcrlib/crengine/thirdparty/antiword/Unix-only/KDE1-only/kantiword.sh
base/thirdparty/kpvcrlib/crengine/thirdparty/antiword/Unix-only/KDE3-only/kantiword.sh
base/thirdparty/kpvcrlib/crengine/thirdparty/chmlib/contrib/mozilla_helper.sh
base/thirdparty/kpvcrlib/crengine/thirdparty/chmlib/install-sh
base/thirdparty/kpvcrlib/crengine/thirdparty/freetype/autogen.sh
base/thirdparty/kpvcrlib/crengine/thirdparty/freetype/builds/atari/gen-purec-patch.sh
base/thirdparty/kpvcrlib/crengine/thirdparty/freetype/builds/unix/install-sh
base/thirdparty/kpvcrlib/crengine/thirdparty/freetype/configure
base/thirdparty/kpvcrlib/crengine/thirdparty/libpng/install-sh
base/thirdparty/kpvcrlib/crengine/thirdparty/zlib/configure
base/utils/pdfattach
.ci/after_success.sh
.ci/before_install.sh
.ci/build.sh
.ci/check.sh
.ci/common.sh
.ci/fetch.sh
.ci/helper_luarocks.sh
.ci/helper_shellchecks.sh
.ci/install.sh
.ci/script.sh
.ci/test.sh
kodev
platform/android/luajit-launcher/gradlew
platform/android/luajit-launcher/jni/luajit/mk-luajit.sh
platform/appimage/AppRun
platform/cervantes/disable-usbms.sh
platform/cervantes/disable-wifi.sh
platform/cervantes/enable-usbms.sh
platform/cervantes/enable-wifi.sh
platform/cervantes/koreader.sh
platform/cervantes/koreader-standalone.sh
platform/cervantes/obtain-ip.sh
platform/cervantes/release-ip.sh
platform/cervantes/restore-wifi-async.sh
platform/cervantes/resume.sh
platform/cervantes/spinning_zsync
platform/cervantes/suspend.sh
platform/common/spinning_zsync
platform/debian/do_debian_package.sh
platform/debian/koreader.sh
platform/kindle/extensions/koreader/bin/koreader-ext.sh
platform/kindle/koreader.sh
platform/kindle/libkohelper.sh
platform/kobo/disable-wifi.sh
platform/kobo/enable-wifi.sh
platform/kobo/fmon/koreader.sh
platform/kobo/koreader.sh
platform/kobo/nickel.sh
platform/kobo/obtain-ip.sh
platform/kobo/release-ip.sh
platform/kobo/restore-wifi-async.sh
platform/mac/do_mac_bundle.sh
platform/pocketbook/koreader.app
platform/pocketbook/system_koreader.app
platform/remarkable/disable-wifi.sh
platform/remarkable/enable-wifi.sh
platform/remarkable/koreader.sh
platform/sony-prstux/resume.sh
platform/sony-prstux/set-wifi.sh
platform/sony-prstux/suspend.sh
platform/ubuntu-touch/koreader.sh
plugins/backgroundrunner.koplugin/luawrapper.sh
plugins/backgroundrunner.koplugin/wrapper.shThere was a problem hiding this comment.
git --version
git version 2.34.1
There was a problem hiding this comment.
Which shell? It's clearly not excluding base and luajit-launcher like it should.
|
Do we still use travis anywhere? if not can i remove its third party permissions for the org? |
|
You can remove it. Travis.org stopped working some 4-5 months ago, cf. koreader/crengine#451 |
Travis could just run while not passing any secrets. (I.e., This is what recently developed into an issue with CircleCI, where it refused to run at all, except without GHA's nice "authorize" (except I don't want to authorize anything at all obviously!). If that's a problem, I would be more inclined to cancel GHA completely and just do some GHA stuff from the docs & translation repos once an hour or so. |
|
I.e., removing secrets from CircleCI will fix all CircleCI issues. If GHA has the same issues it doesn't fix anything. |
|
Merging the disscussion from above and koreader/koreader-base#1442
This is fixed for me now that we have CircleCi checks installed.
I am not sure what also as i asked before in #8304 (comment) github action are run with a GITHUB_TOKEN that only has permissions in the current repo. With a organization Github Apps one can give the app only repo permissions and these permissions will only be applied to the repos the app is installed to. Can we change the default permission for the GITHUB_TOKEN to read only as i don't think we are using github actions anywhere to write |
Yes. There are (or were) three issues:
Given the three above facts, a year ago GHA seemed like the most logical course of action. With 2 and 3 taken out of the equation there's no need to switch to GHA wholesale. There's may still be a role for GHA to play to work around point 1, and I'm not opposed to GHA taking on everything (in front), but especially 2 and to a lesser extent 3 were always the primary reason to want to move over to GHA. Because 2 would be fixed for sure and 3 might be fixed as a side effect.
Wouldn't adding release builds be write? |
I assume that without any secrets, you wouldn't have to click the "run this action" or whatever it says exactly button? That's what I mean. I don't want random PRs to have any secrets, like in Travis. If PRs get secrets, then it'd definitely have to be a dedicated user or some sort. |
Ohhh and point 1 also somewhat ceased to be an issue, at least in the sense that it now clearly says unauthorized. (See over on #8604 right now.) That means that every single reason I had to avoid spending time on CircleCI and to migrate to GHA or possibly GitLab CI instead is now gone. [Edit: which doesn't mean we should throw away this PR!] |
|
I've had much worse headaches with GHA already unfortunately. :-)
I'll fix that. I was kept from it by the fact that if it failed it wasn't a big red x and point 2. |
|
Which shell? It's clearly not excluding base and luajit-launcher like it should.
bash, the extra files come from the first `git grep -lE '^#!(/usr)?/bin/(env )?(bash|sh)'`
|
|
I added the However, in modern Git you can also do Edit: that is, back in Git |
|
Still needs some script changes. References <koreader#8607>.
Codecov Report
@@ Coverage Diff @@
## master #8607 +/- ##
=======================================
Coverage 39.67% 39.67%
=======================================
Files 289 289
Lines 50259 50259
=======================================
Hits 19941 19941
Misses 30318 30318 Continue to review full report at Codecov.
|
|
Is this PR still relevant? |
|
Doing something like that kodev-check() would be better regardless so if it doesn't bother you too much I'd prefer to leave it open for the moment (but just so it's easy to find as documentation). |



For real this time ;)
Depends on #8605
Docs translations and coverage need to be implemented.
Do the docs & translations need to run on each commit? Can i make a nightly / twice a day GHA in the doc repo to check if master changed and if yes rebuild the docs?This change is