File tree Expand file tree Collapse file tree 1 file changed +31
-1
lines changed Expand file tree Collapse file tree 1 file changed +31
-1
lines changed Original file line number Diff line number Diff line change 3
3
GitHub action to build and run Swift package tests on an Android emulator
4
4
5
5
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
+
7
37
8
38
## Releasing
9
39
You can’t perform that action at this time.
0 commit comments