step-security/Swift Android Action

Cross-compiles a swift package for Android and runs the test cases in an Android emulator

View on GitHub

Trust Signals

Scorecard Score
not yet scored
Maintenance Recency
Stale
License
None
namedescriptionrequireddefault
swift-versionSwift toolchain version to install. Accepts release tags (e.g. "6.3"), the aliases "latest" / "snapshot" / "latest-6.2", nightly identifiers like "nightly-main" or "nightly-6.3", and explicit dev snapshots such as "6.3-DEVELOPMENT-SNAPSHOT-2025-12-07-a".yeslatest
ndk-versionAndroid NDK version selector for Swift 6.2 and newer (e.g. "27", "27.0", "27.2.12479018", or "latest"). Leave empty to keep the runner default.no""
swift-branchOverride for the swift.org download branch (e.g. "swift-6.3-release", "development"). When empty the branch is inferred from `swift-version`.yes""
package-pathPath to the Swift package to build, relative to the workspace root.yes.
swift-build-flagsExtra arguments appended to every `swift build` invocation.yes""
swift-configurationBuild configuration: "debug" or "release".yesdebug
swift-test-flagsExtra arguments forwarded to the test-runner binaries on the emulator.yes""
android-emulator-test-folderAbsolute on-device folder used to stage and execute the test bundle inside the emulator.yes/data/local/tmp/swift-android-tests
test-envWhitespace-separated `KEY=VALUE` pairs exported into the test process on the emulator.yes""
android-emulator-optionsExtra CLI flags passed through to the Android emulator process.yes-no-window -noaudio -no-boot-anim
android-emulator-boot-timeoutMaximum number of seconds to wait for the emulator to finish booting before giving up.yes600
free-disk-spaceWhen "true", deletes a curated set of large pre-installed runner tools (Xcodes, dotnet, chromium, etc.) prior to launching the emulator to recover disk space.nofalse
build-packageWhen "true", builds the Swift package after installing the toolchain/SDK. Set to "false" to only stage the environment.yestrue
build-testsWhen "true", `--build-tests` is added to the build so test binaries are produced. Set to "false" to skip building tests.yestrue
run-testsWhen "true", launches the emulator and executes the built test binaries. Set to "false" to stop after the build step.yestrue
copy-filesAdditional files or directories (relative to `package-path`) copied next to the test binaries on the emulator.yes""
android-coresNumber of CPU cores allocated to the Android emulator instance.yes2
android-api-levelAndroid API level that the emulator boots against (also drives the compile SDK target by default).yes28
compile-sdk-api-levelOverride for the API level baked into the Swift Android SDK build triple. Falls back to `android-api-level` when unset.no""
android-channelSDK Manager component channel used by the emulator runner ("stable", "beta", "dev", or "canary").nostable
android-profileHardware profile name used when creating the AVD (e.g. "pixel"). Empty selects the runner default.no""
android-targetSystem-image target for the AVD (e.g. "default", "google_apis", "aosp_atd").nodefault
installed-sdkTriple of a Swift Android SDK that is already installed on the runner; when set, the action skips downloading an SDK.no""
installed-swiftPath to a Swift host toolchain that is already installed; when set, the action skips downloading the host toolchain.no""
custom-sdk-urlDirect URL to a custom Swift Android SDK artifactbundle archive. Requires `installed-sdk` and `custom-sdk-id` to also be supplied.no""
custom-sdk-idArtifact identifier used when installing the SDK referenced by `custom-sdk-url`.no""
namedescription
swift-buildFully-formed `swift build` invocation wired to the host toolchain and Android SDK that this action installed.
swift-sdkIdentifier of the Android Swift SDK target triple selected for cross-compilation (e.g., x86_64-unknown-linux-android24).
swift-installAbsolute path to the installed Swift host toolchain (the `usr` directory containing bin/swift).