Skip to content

Commit 8be8745

Browse files
committed
Update README
1 parent 6b5c73d commit 8be8745

File tree

1 file changed

+31
-1
lines changed

1 file changed

+31
-1
lines changed

README.md

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,37 @@
33
GitHub action to build and run Swift package tests on an Android emulator
44

55
You can add this action to your Swift CI workflow from the
6-
[GitHub Marketplace](https://github.com/marketplace/actions/swift-android-action).
6+
[GitHub Marketplace](https://github.com/marketplace/actions/swift-android-action),
7+
or you can manually create a workflow by adding a
8+
`.github/workflows/swift-ci.yml` file to your project.
9+
This sample action will run your Swift package's test cases
10+
on a host macOS machine, as well as on an Android emulator
11+
and an iOS simulator.
12+
13+
```yml
14+
name: Swift Package CI
15+
on:
16+
push:
17+
branches: [ main ]
18+
pull_request:
19+
branches:
20+
- '*'
21+
jobs:
22+
test:
23+
# important: must be macos-13, since the Android emulator does not work on macos-14
24+
runs-on: macos-13
25+
steps:
26+
- uses: actions/checkout@v4
27+
- name: "Test Swift Package Locally"
28+
run: swift test
29+
- name: "Test Swift Package on Android"
30+
uses: skiptools/swift-android-action@v1
31+
- name: "Test Swift Package on iOS"
32+
run: xcodebuild test -scheme "$(xcodebuild -list -json | jq -r '.workspace.schemes[-1]')" -sdk "iphonesimulator" -destination "platform=iOS Simulator,name=iPhone 15"
33+
34+
```
35+
36+
737

838
## Releasing
939

0 commit comments

Comments
 (0)