-
Notifications
You must be signed in to change notification settings - Fork 0
101 lines (87 loc) · 3.25 KB
/
reusable-ios-checks.yaml
File metadata and controls
101 lines (87 loc) · 3.25 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
name: iOS checks
on:
workflow_call:
inputs:
googleServicesFileLocation:
required: false
type: string
default: './DemoApp/REES46Demo/Supporting Files/'
googleServicesFileName:
required: false
type: string
default: GoogleService-Info.plist
secrets:
googleServicesString:
description: Google services file as base64 string
required: true
cocoapodsToken:
description: Cocoapods token
required: true
env_vars:
required: false
jobs:
run:
runs-on: macos-latest
env:
ACTIONS_IS_RUNNING: true
env_vars: ${{ secrets.env_vars }}
steps:
- run: |
echo $env_vars
for i in $env_vars; do
i=$(echo $i | sed 's/=.*//g')=$(echo ${i#*=} | base64 -d | base64 -d)
echo ::add-mask::${i#*=}
printf '%s\n' "$i" >> $GITHUB_ENV
done
env
- uses: actions/checkout@v4
- uses: swift-actions/setup-swift@v2
- uses: actions/cache@v4
with:
path: ~/Library/Developer/Xcode/DerivedData
key: ${{ runner.os }}-deriveddata-${{ hashFiles('**/Podfile.lock') }}
restore-keys: |
${{ runner.os }}-deriveddata-
- uses: actions/cache@v4
with:
path: Pods
key: ${{ runner.os }}-pods-${{ hashFiles('**/Podfile.lock') }}
restore-keys: |
${{ runner.os }}-pods-
- name: Pod install
working-directory: ./DemoApp
run: |
pod install
- name: Decode signing key file
uses: timheuer/base64-to-file@v1.2
id: service_account_json_file
with:
fileName: ${{ inputs.googleServicesFileName }}
fileDir: ${{ inputs.googleServicesFileLocation }}
encodedString: ${{ secrets.googleServicesString }}
- name: Copy Google Service
run: |
cp ./DemoApp/REES46Demo/Supporting\ Files/GoogleService-Info.plist ./DemoApp/GoogleService-Info.plist
cp ./DemoApp/REES46Demo/Supporting\ Files/GoogleService-Info.plist ./DemoApp/REES46.xcodeproj/xcshareddata/xcschemes/GoogleService-Info.plist
cp ./DemoApp/REES46Demo/Supporting\ Files/GoogleService-Info.plist ./DemoApp/REES46Demo/GoogleService-Info.plist
- name: Build
run: |
xcodebuild build -workspace ./DemoApp/REES46.xcworkspace -scheme REES46Demo \
-sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 16,OS=latest' \
CODE_SIGN_IDENTITY='' CODE_SIGNING_REQUIRED='NO' CODE_SIGN_ENTITLEMENTS=''
- name: Run tests
if: ${{ !cancelled() }}
run: |
xcodebuild test -workspace ./DemoApp/REES46.xcworkspace -scheme REES46Demo \
-sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 16,OS=latest' \
CODE_SIGN_IDENTITY='' CODE_SIGNING_REQUIRED='NO' CODE_SIGN_ENTITLEMENTS=''
- name: Lint spec
if: ${{ !cancelled() }}
env:
COCOAPODS_TRUNK_TOKEN: ${{ secrets.cocoapodsToken }}
run: pod spec lint --allow-warnings
- name: Lint lib
if: ${{ !cancelled() }}
env:
COCOAPODS_TRUNK_TOKEN: ${{ secrets.cocoapodsToken }}
run: pod lib lint --allow-warnings