-
Notifications
You must be signed in to change notification settings - Fork 1
51 lines (50 loc) · 1.43 KB
/
build-and-test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
name: Build and Test
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
defaults:
run:
shell: bash -l -eo pipefail {0}
jobs:
build-and-test:
runs-on: macos-12
env:
destination: name=iphone-12-pro
steps:
- uses: actions/checkout@v3
- name: Setup Xcode version
uses: maxim-lobanov/[email protected]
with:
xcode-version: latest
- name: Swift Version
run: swift --version
- name: Xcode Targets List
run: xcodebuild -list
- name: Simulator Prepare
run: xcrun simctl create iphone-12-pro "iPhone 12 Pro"
- name: Build and Test Package
uses: sersoft-gmbh/xcodebuild-action@v2
with:
spm-package: .
scheme: SwiftUI-snapshot-testing
destination: ${{ env.destination }}
action: build-for-testing test-without-building
- name: Example App Test
uses: sersoft-gmbh/xcodebuild-action@master
with:
project: Example/Example.xcodeproj
scheme: Example
destination: ${{ env.destination }}
result-bundle-path: test-results/example-tests
action: test
- name: Archive results # due to: https://github.com/actions/upload-artifact/issues/243
if: always()
run: zip -FSry results.zip test-results || true
- name: Upload test results
if: always()
uses: actions/upload-artifact@v3
with:
name: test-results
path: results.zip