-
Notifications
You must be signed in to change notification settings - Fork 25
124 lines (107 loc) · 3.93 KB
/
Copy pathci.yml
File metadata and controls
124 lines (107 loc) · 3.93 KB
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
name: CI
on:
push:
branches: [ master, develop ]
pull_request:
branches: [ master, develop ]
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
DEVELOPER_DIR: /Applications/Xcode_16.4.app/Contents/Developer
jobs:
build-and-test:
name: Build and Test
runs-on: macos-15-arm64
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
scheme: [iBurn, iBurnTests, PlayaKitTests]
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
submodules: recursive
token: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Xcode
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: '16.4'
- name: Cache Ruby Gems
uses: actions/cache@v4
with:
path: vendor/bundle
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
restore-keys: |
${{ runner.os }}-gems-
- name: Cache CocoaPods
uses: actions/cache@v4
with:
path: Pods
key: ${{ runner.os }}-pods-${{ hashFiles('**/Podfile.lock') }}
restore-keys: |
${{ runner.os }}-pods-
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.1'
bundler-cache: true
- name: Setup Dependencies
run: |
bundle config path vendor/bundle
bundle install --jobs 4 --retry 3
bundle exec pod repo update --silent
bundle exec pod install
- name: Create Required Secret Files
env:
MAPBOX_ACCESS_TOKEN: ${{ secrets.MAPBOX_ACCESS_TOKEN }}
CRASHLYTICS_API_TOKEN: ${{ secrets.CRASHLYTICS_API_TOKEN }}
HOCKEY_BETA_IDENTIFIER: ${{ secrets.HOCKEY_BETA_IDENTIFIER }}
HOCKEY_LIVE_IDENTIFIER: ${{ secrets.HOCKEY_LIVE_IDENTIFIER }}
EMBARGO_PASSCODE_SHA256: ${{ secrets.EMBARGO_PASSCODE_SHA256 }}
UPDATES_URL: ${{ secrets.UPDATES_URL }}
MAPBOX_STYLE_URL: ${{ secrets.MAPBOX_STYLE_URL }}
run: |
# Create GoogleService-Info.plist (placeholder)
touch iBurn/GoogleService-Info.plist
# Create InfoPlistSecrets.h
cat > ./iBurn/InfoPlistSecrets.h << EOF
#define MAPBOX_ACCESS_TOKEN ${MAPBOX_ACCESS_TOKEN:-test}
#define CRASHLYTICS_API_TOKEN ${CRASHLYTICS_API_TOKEN:-test}
EOF
# Create BRCSecrets.m
cat > ./iBurn/BRCSecrets.m << EOF
NSString * const kBRCHockeyBetaIdentifier = @"${HOCKEY_BETA_IDENTIFIER:-}";
NSString * const kBRCHockeyLiveIdentifier = @"${HOCKEY_LIVE_IDENTIFIER:-}";
NSString * const kBRCEmbargoPasscodeSHA256Hash = @"${EMBARGO_PASSCODE_SHA256:-}";
NSString * const kBRCUpdatesURLString = @"${UPDATES_URL:-}";
NSString * const kBRCMapBoxStyleURL = @"${MAPBOX_STYLE_URL:-https://example.com}";
NSString * const kBRCMapBoxAccessToken = @"${MAPBOX_ACCESS_TOKEN:-}";
EOF
- name: Build App
if: matrix.scheme == 'iBurn'
run: |
xcodebuild -workspace iBurn.xcworkspace \
-scheme iBurn \
-sdk iphonesimulator \
-destination "platform=iOS Simulator,name=iPhone 16 Pro,arch=arm64,OS=latest" \
build | xcpretty -c
- name: Run Tests
if: matrix.scheme != 'iBurn'
run: |
xcodebuild -workspace iBurn.xcworkspace \
-scheme ${{ matrix.scheme }} \
-sdk iphonesimulator \
-destination "platform=iOS Simulator,name=iPhone 16 Pro,arch=arm64,OS=latest" \
test | xcpretty -c
- name: Archive Test Results
if: always() && matrix.scheme != 'iBurn'
uses: actions/upload-artifact@v4
with:
name: test-results-${{ matrix.scheme }}
path: |
~/Library/Developer/Xcode/DerivedData/*/Logs/Test/
*.xcresult
retention-days: 30