Skip to content
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

Android support #106

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Android support #106

wants to merge 3 commits into from

Conversation

marcprux
Copy link

As discussed in #83, and now that the Android SDK nightly-6.1 supports Swift Testing (swiftlang/swift-package-manager#8362), this PR adds experimental support for cross-compiling Swift packages for Android and running their tests on an Android emulator. It is only run when the enable_android_checks input is set to true, making it opt-in for now.

It uses swift-android-action to set up the environment and run the tests, which is the same workflow that powers https://swift-everywhere.org and various other Swift CI workflows. This action, in turn, delegates to the reactivecircus/android-emulator-runner workflow to set up and run the emulator based in the inputs passed to the workflow (android_api_level, android_channel, android_profile, and android_target). Support for transferring specific files to the Android emulator (with android_copy_files) and setting custom test environment variables (with android_test_env) enable customization of the test environment (for example, see https://github.com/jpsim/Yams/blob/main/.github/workflows/swiftpm.yml#L146).

This works towards the one of the goals of the Android Workgroup to provide continuous integration support for Android. A successful run of this workflow can be seen at https://github.com/marcprux/swift-algorithms/actions/runs/13838259992

Closes #83.

@marcprux marcprux requested a review from a team as a code owner March 13, 2025 15:42
glbrntt pushed a commit to grpc/grpc-swift that referenced this pull request Mar 17, 2025
This PR follows-up #2206 and fixes the Android build I noticed at
https://swift-everywhere.org.

Hopefully we will soon have CI support for Android
(swiftlang/github-workflows#106) to catch this
sort of breakage sooner.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add an Android workflow, for Swift packages to build the Android SDK and test against
1 participant