CI now performs build checks on pushes to the master branch only.
For pull requests, the dev variant of the app is built and artifacts are uploaded for ease of testing and side-by-side installation. PR builds use autogenerated debug signing keys, resulting in different keys being used for each build on purpose to ensure they cannot be installed over each other, avoiding any possible conflict between two PRs.
The default `compiler_check` strategy used by ccache was causing a 0% hit rate, as it was using the compiler's "modified time" as part of the hash. Since the script installs dependencies from scratch for every run, mtime was always different, causing different hashes even when source files were unchanged. To avoid this, use the NDK version as part of the hash instead.
The build folder was being deleted at the end of CI runs but it has to be cached and this deletion wasn't necessary as the disk would be wiped at the end of the CI build, this has now been fixed.
We don't always have access to CI secrets, such as, when a certain CI action is triggered by a PR from an external repository then it won't have access to secrets and be signed. While we likely will allow for this in the future as all workflows do have to be approved, it is still important to not crash when keys are unavailable and have a graceful fallback for those situations.
The `restore-keys` parameter of `actions/cache@v3` is now utilized to add robust fallbacks for missing cache keys, it should automatically fall back to an older but still valid cache rather than entirely miss now.
The CI didn't cache the C++ build related directories under `app/build/` which caused a full recompilation of C++ code, this takes a significant amount of time.