Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
67 changes: 67 additions & 0 deletions .github/workflows/swift_package_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,42 @@ on:
type: boolean
description: "Boolean to enable running build in windows docker container. Defaults to true"
default: true
enable_android_checks:
type: boolean
description: "Boolean to enable android testing. Defaults to false"
default: false
android_copy_files:
type: string
description: "Additional files to copy to the Android emulator for testing"
default: ""
android_cores:
type: number
description: "Number of cores to use for the Android emulator"
default: 2
android_api_level:
type: number
description: "The API level of the Android emulator"
default: 30
android_channel:
type: string
description: "Android channel to download the SDK components from - stable, beta, dev, canary"
default: "canary"
android_profile:
type: string
description: "Android emulator hardware profile used for creating the AVD"
default: "pixel"
android_target:
type: string
description: "Target of the Android system image"
default: "aosp_atd"
android_test_env:
type: string
description: "Android emulator test environment variables key=value"
default: ""
android_exclude_swift_versions:
type: string
description: "Exclude Android Swift version list (JSON)"
default: "[{\"swift_version\": \"\"}]"
needs_token:
type: boolean
description: "Boolean to enable providing the GITHUB_TOKEN to downstream job."
Expand Down Expand Up @@ -508,3 +544,34 @@ jobs:
Import-Module $env:ChocolateyInstall\helpers\chocolateyProfile.psm1
RefreshEnv
powershell.exe -NoLogo -File $env:TEMP\test-script\run.ps1; exit $LastExitCode

android-build:
name: Android (${{ matrix.swift_version }})
if: ${{ inputs.enable_android_checks }}
runs-on: 'ubuntu-24.04'
strategy:
fail-fast: false
matrix:
swift_version: ['nightly-6.1']
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
swift_version: ['nightly-6.1']
swift_version: ['nightly']

exclude:
- ${{ fromJson(inputs.android_exclude_swift_versions) }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Provide token
if: ${{ inputs.needs_token }}
run: |
echo "GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}" >> $GITHUB_ENV
- name: Build / Test
uses: skiptools/swift-android-action@v2
Comment on lines +565 to +566
Copy link
Member

Choose a reason for hiding this comment

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

We currently don't support running actions outside swiftlang org. Let's do something similar to static sdk or wasm sdk.

with:
swift-version: ${{ matrix.swift_version }}
swift-build-flags: ${{ (contains(matrix.swift_version, 'nightly') && inputs.swift_nightly_flags) || inputs.swift_flags }}
copy-files: ${{ inputs.android_copy_files }}
test-env: ${{ inputs.android_test_env }}
android-cores: ${{ inputs.android_cores }}
android-api-level: ${{ inputs.android_api_level }}
android-channel: ${{ inputs.android_channel }}
android-profile: ${{ inputs.android_profile }}
android-target: ${{ inputs.android_target }}