Skip to content

Commit c8d8abe

Browse files
committed
Run against Android emulator
1 parent 9753633 commit c8d8abe

File tree

1 file changed

+23
-3
lines changed

1 file changed

+23
-3
lines changed

action.yml

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,34 @@ inputs:
99
description: 'The folder where the swift package is checked out'
1010
required: true
1111
default: '.'
12+
run-tests:
13+
description: 'Whether to run the tests or just the build'
14+
required: true
15+
default: 'true'
16+
android-api-level:
17+
description: 'The API level of the Android emulator to run against'
18+
required: true
19+
default: 24
1220
runs:
1321
using: "composite"
1422
steps:
23+
- name: Cache Homebrew packages
24+
uses: actions/cache@v4
25+
with:
26+
path: ~/Library/Caches/Homebrew
27+
key: homebrew-packages
1528
- name: Install Toolchain
16-
run: brew install swift-android-sdk/toolchain/swift-android-sdk@${{ inputs.swift-version }} skiptools/skip/skip
29+
run: brew install skiptools/skip/skip swift-android-sdk/toolchain/swift-android-sdk@${{ inputs.swift-version }}
1730
shell: bash
18-
- name: Build package
31+
- name: Build Swift package for Android
1932
run: skip android build --build-tests --package-path ${{ inputs.package-path }}
2033
shell: bash
21-
34+
- name: Run Swift tests on Android emulator
35+
if: ${{ inputs.run-tests == 'true' }}
36+
uses: reactivecircus/android-emulator-runner@v2
37+
with:
38+
api-level: ${{ inputs.android-api-level }}
39+
arch: x86_64
40+
script: |
41+
skip android test --package-path ${{ inputs.package-path }}
2242

0 commit comments

Comments
 (0)