-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sargon CI/CD on ubuntu #218
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #218 +/- ##
======================================
Coverage 97.0% 97.0%
======================================
Files 938 934 -4
Lines 15011 14810 -201
Branches 66 66
======================================
- Hits 14562 14374 -188
+ Misses 442 429 -13
Partials 7 7
Flags with carried forward coverage won't be shown. Click here to find out more. |
f1ac7d0
to
5143347
Compare
bb3a35b
to
6178197
Compare
// Currently our CI supports building on Mac OS and we don't care about Mac Intel for now. | ||
// So we skip the rest. | ||
val supported = listOf(DarwinAArch64) | ||
val ciSupported = listOf( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we ever need to build for other os, for example windows, we can add more to that and also make sure release-desktop.yml
includes an entry to that host in the matrix.
tasks.getByName("clean") { | ||
dependsOn(cleanTask) | ||
} | ||
fun Project.currentTargetTriple(): DesktopTargetTriple { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Helper function to let gradle detect the underlying target triple by running rustc --version --verbose
and reading from host:
Exec::class | ||
) { | ||
val regenerate = properties["regenerate"] ?: true //TODO improve by using gradle outputs | ||
afterEvaluate { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This block sums up the order of tasks that need to run on each occasion. Tasks that involve unit tests don't need to build cargo with ndk, but need to generate bindings. On the other hand tasks that involve building for android or building the integration tests that should run on an android device need to compile ndk binaries and exclude the desktop ones.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice, lgtm!
The purpose of this PR is to run all possible jobs that do not include swift in an ubuntu machine.
Changes made:
MacOs
andLinux
. Also removed the instruction to installktlint
as it extremely slows down the build.nightly-2024-07-30
inrust-toolchain.toml
and in all github workflow files. The reason behind it is because when building on linux, a dependency we useiota-crypto
has a transitive dependency toed25519-dalek
which uses a feature not being available in the current nightly toolchain. Although the newer toolchain produces some warnings with tarpaulin. We might need to resolve them in a later PR.gradle
related files:sargon-desktop
module is no loner needed. When therelease-desktop.yml
workflow is invoked it automatically packages only the related sargon binaries and publishes them into a jar. Having a second module was making it extremely difficult to run unit tests on on ubuntu.sargon-android
gradle script is now aware of the underlying arch and decides what binaries to build according to it. When developing sargon and need to run unit tests, the script will detect if it is running on a MacOs or Linux machine and build the related binaries only, while skipping the ndk binaries. This saves a lot of time in both local development and github tests.