-
Notifications
You must be signed in to change notification settings - Fork 45
92 lines (69 loc) · 2.74 KB
/
tests.yaml
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
name: Tests
on:
push:
branches:
- main
pull_request:
jobs:
spm:
name: "iOS ${{ matrix.sdk }}"
runs-on: macos-14-xlarge
strategy:
fail-fast: false # Don’t fail-fast so that we get all snapshot test changes
matrix:
include:
- sdk: "15.4"
destination: platform=iOS Simulator,OS=15.4,name=iPhone SE (3rd generation)
installation_required: true
- sdk: "16.2"
destination: platform=iOS Simulator,OS=16.2,name=iPhone SE (3rd generation)
installation_required: true
- sdk: "17.2"
destination: platform=iOS Simulator,OS=17.2,name=iPhone SE (3rd generation)
# The iOS 17.2 SDK is pre-installed on the macOS 13 image.
# Attempting to install it will fail with an error.
installation_required: false
steps:
- uses: actions/checkout@v4
- name: Read env
run: cat .github/workflows/env.properties >> $GITHUB_ENV
- name: Switch to Xcode ${{ env.xcode_version }}
run: sudo xcode-select -s /Applications/Xcode_${{ env.xcode_version }}.app
- name: Install xcodes
run: brew install aria2 xcodesorg/made/xcodes
- name: Install iOS ${{ matrix.sdk }}
if: ${{ matrix.installation_required }}
run: sudo xcodes runtimes install "iOS ${{ matrix.sdk }}"
- name: Build & Test
run: |
xcodebuild -scheme "BlueprintUI-Package" -destination "${{ matrix.destination }}" build test
- name: Package snapshot changes
if: ${{ failure() }}
run: |
git ls-files -mo BlueprintUICommonControls/Tests/Sources/Resources/ReferenceImages | xargs tar -cvf snapshot_changes_${{ matrix.sdk }}.tar
- name: Archive snapshot changes
uses: actions/upload-artifact@v4
if: ${{ failure() }}
with:
name: snapshot_changes_${{ matrix.sdk }}
path: snapshot_changes_${{ matrix.sdk }}.tar
cocoapods:
name: "CocoaPods"
runs-on: macos-14-xlarge
steps:
- uses: actions/checkout@v4
- name: Read env
run: cat .github/workflows/env.properties >> $GITHUB_ENV
- name: Switch to Xcode ${{ env.xcode_version }}
run: sudo xcode-select -s /Applications/Xcode_${{ env.xcode_version }}.app
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
# Uses version specified in .ruby_version
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
- name: Pod Install
run: |
bundle exec pod install --project-directory=SampleApp/
- name: Build & Test
run: |
xcodebuild -workspace SampleApp/SampleApp.xcworkspace -scheme "BlueprintUI-Unit-Tests" -destination "platform=iOS Simulator,OS=17.2,name=iPhone SE (3rd generation)"