Commit Graph

13 Commits

Author SHA1 Message Date
Andrew Gunnerson 4db33db175 Add GitHub Actions workflow to build modules
Fixes: #123

Signed-off-by: Andrew Gunnerson <accounts+github@chiller3.com>
2023-08-11 15:17:22 -04:00
Pascal Roeleven 9d50d41f6b Give names to reusable workflows 2023-03-09 19:57:02 +01:00
Pascal Roeleven d53896f952 Use actions/cache lookup-only instead of custom action
Now that the lookup-only option is available, we should use this instead
2023-03-09 19:57:00 +01:00
Pascal Roeleven df9a6c2970 Make cache pre-checks more robust
Also fix preload Magisk cache workflow
2023-03-06 12:18:57 +01:00
Andrew Gunnerson 4847ebf27a Merge tests_ci into tests
This commit merges the CI tests from `tests_ci/` into `tests/` so we
have a single way to test against both full OTAs and stripped/dummy
OTAs.

Features kept from tests_ci:

* Support for dummy OTAs. They're now called stripped OTAs to hopefully
  better signify that they're a stripped down version of the original
  file instead of a test file created from scratch.
* Extracting AVB partitions and verifying their hashes.
* Writing sparse files where possible.
* Ability to change the working directory for downloads and output
  files.

Test script changes:

* There are now 4 subcommands:
    strip -i <input> -o <output>
    add -u <url> -d <device> [-H <expected hash>]
    download [--magisk | --no-magisk] [[-d <device>] ... | --no-devices]
    test [[-d <device>] ...]
* Downloads now use the parallel downloader for both full and stripped
  OTAs.

Config file changes:

* It now uses strictyaml instead of configparser/TOML since it's a bit
  more readable now that we have more nesting in the data structure. The
  config loader now also makes use of strictyaml's schema feature.
* All hashes are now SHA-256 for consistency.
* For stripped OTAs, the list of byte ranges now uses half-open
  intervals for easier calculations.
* Use device IDs as the key instead of the marketing model name.

CI changes:

* Compute all cache keys (and prefixes) in the main workflow and pass
  them to the preload scripts.
* Only run on `push` for the `master` branch to avoid double workflow
  runs on PRs from internal branches.
* Increase timeout for patching tests because `tests.py` patches twice
  (once with `--magisk` and once with `--prepatched`).

Signed-off-by: Andrew Gunnerson <accounts+github@chiller3.com>
2023-03-04 21:39:08 -05:00
Pascal Roeleven e9419850f5 Run workflow on pull requests 2023-03-03 16:00:25 +01:00
Pascal Roeleven 9dec3f8408 Use sparse images in GA
Also invalidate caches by adding version prefix
2023-03-02 15:22:34 +01:00
Pascal Roeleven f8ef998794 Reorder steps 2023-03-01 16:50:12 +01:00
Pascal Roeleven 4ac7826c32 Cache tox environments with tox hash 2023-03-01 16:11:32 +01:00
Pascal Roeleven 50b8d28779 Cache images with database hash 2023-03-01 16:04:14 +01:00
Pascal Roeleven 0b6f76637f Move caching of Magisk to setup workflow
It's unnecessary to spin up an entire runner for just this short and
simple task.
2023-03-01 16:04:14 +01:00
Pascal Roeleven 41ce7d653f Cache Magisk with database hash
Simplify caching by caching on database hash instead of Magisk hash.
hashFiles is only available in the steps, hence the reason for it being
exported to the outputs from the steps (and not directly).
2023-03-01 16:03:59 +01:00
Pascal Roeleven fb2c512248 Test all device images in Github Actions 2023-02-27 16:38:39 +01:00