-
Notifications
You must be signed in to change notification settings - Fork 4
146 lines (144 loc) · 4.82 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
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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
name: build-framework
on:
pull_request:
types: [ opened, edited, synchronize ]
jobs:
core_build:
runs-on: macos-13
steps:
- name: Select Xcode Version
uses: maxim-lobanov/[email protected]
with:
xcode-version: '15.0.1'
- name: Checkout actions
uses: actions/checkout@v3
- name: Run xcodegen
uses: xavierLowmiller/[email protected]
with:
spec: project-ci.yml
version: '2.33.0'
- name: Run fastlane build_framework TARGET_NAME:SparkCore
run: fastlane build_framework TARGET_NAME:SparkCore
core_unit_tests:
name: core_unit_tests
needs: [ core_build ]
runs-on: macos-13
steps:
- name: Select Xcode Version
uses: maxim-lobanov/[email protected]
with:
xcode-version: '15.0.1'
- name: Checkout actions
uses: actions/checkout@v3
- name: Run sourcery
run: |
brew install sourcery
sourcery
- name: Run xcodegen
uses: xavierLowmiller/[email protected]
with:
spec: project-ci.yml
version: '2.33.0'
- name: Run fastlane unit_tests TARGET_NAME:SparkCore
run: fastlane unit_tests TARGET_NAME:SparkCore
- name: Tar files
run: tar -cvf xcresult-SparkCore.tar out/SparkCore.xcresult
continue-on-error: true
- name: Archive xcresult
uses: actions/upload-artifact@v3
with:
name: xcresult-SparkCore
path: xcresult-SparkCore.tar
retention-days: 15
# core_snapshot_tests:
# name: core_snapshot_tests
# needs: [ core_build ]
# runs-on: macos-13
# steps:
# - name: Checkout actions
# uses: actions/checkout@v3
# - name: Run sourcery
# run: |
# brew install sourcery
# sourcery
# - name: Run xcodegen
# uses: xavierLowmiller/[email protected]
# with:
# spec: project-ci.yml
# version: '2.33.0'
# # Get the current source branch name of the spark-ios-repository-PR and store it in "outputs.branch".
# - name: Extract branch name
# shell: bash
# run: echo "branch=$(echo ${GITHUB_HEAD_REF#refs/heads/})" >>$GITHUB_OUTPUT
# id: extract_branch
# # Now try to checkout the same branch (outputs.branch) in spark-ios-snapshots-repository.
# - name: Run snapshots
# uses: actions/checkout@v3
# continue-on-error: true
# id: checkout_snapshot_branch_similar_to_main_repo
# with:
# repository: adevinta/spark-ios-snapshots
# ref: ${{ steps.extract_branch.outputs.branch }}
# path: spark-ios-snapshots
# # If checking out (outputs.branch)-branch in spark-ios-snapshots fails, fallback to main branch.
# - name: Run snapshot on main
# if: steps.checkout_snapshot_branch_similar_to_main_repo.outcome != 'success'
# uses: actions/checkout@v3
# with:
# repository: adevinta/spark-ios-snapshots
# path: spark-ios-snapshots
# - name: Run fastlane unit_tests TARGET_NAME:SparkDemo
# run: fastlane unit_tests TARGET_NAME:SparkDemo
# - name: Tar files
# run: tar -cvf xcresult-SparkCoreSnapshots.tar out/SparkCoreSnapshots.xcresult
# continue-on-error: true
# - name: Archive xcresult
# uses: actions/upload-artifact@v3
# with:
# name: xcresult-SparkCoreSnapshots
# path: xcresult-SparkCoreSnapshots.tar
# retention-days: 15
build:
needs: [ core_build ]
runs-on: macos-13
steps:
- name: Select Xcode Version
uses: maxim-lobanov/[email protected]
with:
xcode-version: '15.0.1'
- name: Checkout actions
uses: actions/checkout@v3
- name: Run xcodegen
uses: xavierLowmiller/[email protected]
with:
spec: project-ci.yml
version: '2.33.0'
- name: Run fastlane build_framework TARGET_NAME:Spark
run: fastlane build_framework TARGET_NAME:Spark
unit_tests:
name: unit_tests
needs: [ build ]
runs-on: macos-13
steps:
- name: Select Xcode Version
uses: maxim-lobanov/[email protected]
with:
xcode-version: '15.0.1'
- name: Checkout actions
uses: actions/checkout@v3
- name: Run xcodegen
uses: xavierLowmiller/[email protected]
with:
spec: project-ci.yml
version: '2.33.0'
- name: Run fastlane lane unit_tests TARGET_NAME:Spark
run: fastlane unit_tests TARGET_NAME:Spark
- name: Tar files
run: tar -cvf xcresult-Spark.tar out/Spark.xcresult
continue-on-error: true
- name: Archive xcresult
uses: actions/upload-artifact@v3
with:
name: xcresult-Spark
path: xcresult-Spark.tar
retention-days: 15