Skip to content

[CI] Enable Android testing#558

Merged
lorentey merged 8 commits intoapple:mainfrom
swift-android-sdk:enable_android_sdk_checks
Mar 10, 2026
Merged

[CI] Enable Android testing#558
lorentey merged 8 commits intoapple:mainfrom
swift-android-sdk:enable_android_sdk_checks

Conversation

@marcprux
Copy link
Contributor

With the recent advent of building and testing for Android, this PR adds Android to the CI testing matrix.

Tests are passing on Android, as can be seen in this trial run.

CC: @swiftlang/android-workgroup

Checklist

  • I've read the Contribution Guidelines
  • My contributions are licensed under the Swift license.
  • I've followed the coding style of the rest of the project.
  • I've added tests covering all new code paths my change adds to the project (if appropriate).
  • I've added benchmarks covering new functionality (if appropriate).
  • I've verified that my change does not break any existing tests or introduce unexplained benchmark regressions.
  • I've updated the documentation if necessary.

@finagolfin
Copy link

I have been running these tests on my Android CI for awhile, so should work fine.

@marcprux, one elaboration to your official Android workflow that would be useful is to be able to specify multiple target triples to run the Android emulator with. That way, we could test the same Swift package against multiple Android API levels, which will be particularly useful once we roll out the new #available(Android level feature for the SDK.

I take it that might require downloading multiple emulator images, so may be more work to set up, but some Swift packages, like Testing, would benefit from it.

@marcprux
Copy link
Contributor Author

Good idea. I've turned your comment into a new enhancement issue at swiftlang/github-workflows#226 so we can track it.

Copy link
Member

@lorentey lorentey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! 👍

(I expect this will soon become another platform where we'll need to manually exclude specific swift versions as the package keeps bumping its minimum toolchain version. That is fine; but I'd like to rather declare the list of supported Swift versions in one place, rather than juggle exclusion lists per each platform. 😅)

@finagolfin
Copy link

This passed the new Android checks, as expected, don't know what's up with those pending linux checks.

@finagolfin
Copy link

Hold off on merging till the official workflow is fixed, swiftlang/github-workflows#218.

@a2022s056-web

This comment was marked as spam.

@a2022s056-web

This comment was marked as spam.

@marcprux

This comment was marked as outdated.

@finagolfin

This comment was marked as outdated.

@finagolfin
Copy link

The error annotations problem has been fixed by swiftlang/github-workflows#234, @marcprux, can you rebase?

@finagolfin
Copy link

@lorentey, one last run and we can get this in.

tests:
name: Test
uses: swiftlang/github-workflows/.github/workflows/[email protected].6
uses: swiftlang/github-workflows/.github/workflows/[email protected].7

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@marcprux, update to latest tag?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just synchronized the fork and now it is 0.0.7.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Latest is 0.0.8...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops, I hadn't seen that. I've set them all to 0.0.8.

@finagolfin
Copy link

Ping @lorentey, can we get this in after updating that CI workflow tag?

@lorentey
Copy link
Member

lorentey commented Mar 9, 2026

The dependabot PRs (#594, #595) already took care of bumping main to use the 0.0.8 workflow tags, but there is no merge issue.

I see we'll need new !os(Android) conditionals for the rudimentary crash tests we have on RigidDeque:

/home/runner/work/swift-collections/swift-collections/Tests/DequeTests/RigidDequeCrashTests.swift:76:38: 
error: 'failure' is unavailable: Exit tests are not available on this platform.

(Those tests aren't that useful in their current form, but it seems like a good idea to keep them, in case we have time to grow them into something better.)

@marcprux
Copy link
Contributor Author

I see we'll need new !os(Android) conditionals for the rudimentary crash tests we have on RigidDeque:

I've blocked the test within #if !os(Android). Ideally we would be able to mark those as skipped with @Test(.disabled(if: isAndroid)), but since these are compile errors, I think this is the best we can do for now (unless @grynspan has other suggestions…)

@lorentey lorentey added this to the 1.4.1 milestone Mar 10, 2026
@lorentey lorentey merged commit 6ff1e8e into apple:main Mar 10, 2026
83 of 84 checks passed
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.

4 participants