Repository navigation
163 lines (155 loc) · 5.4 KB
/
Copy pathcompile.yml
File metadata and controls
163 lines (155 loc) · 5.4 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
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
name: Compile CI
on:
pull_request:
branches:
- main
workflow_dispatch:
permissions:
contents: read
concurrency:
group: compile-${{ github.ref }}
cancel-in-progress: true
env:
PLACEHOLDER_APP_ID: "00000000000000000000000000000000"
jobs:
android:
name: Android (${{ matrix.name }})
runs-on: ubuntu-latest
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
include:
- name: Full
project: Android/APIExample
- name: Audio
project: Android/APIExample-Audio
- name: Compose
project: Android/APIExample-Compose
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: temurin
java-version: "17"
cache: gradle
cache-dependency-path: |
${{ matrix.project }}/**/*.gradle*
${{ matrix.project }}/gradle/wrapper/gradle-wrapper.properties
- uses: android-actions/setup-android@v3
with:
packages: "platform-tools platforms;android-35 build-tools;35.0.0"
- name: Configure compile-only App ID
working-directory: ${{ matrix.project }}
run: printf 'AGORA_APP_ID=%s\nAGORA_APP_CERT=\n' "$PLACEHOLDER_APP_ID" > local.properties
- name: Compile
working-directory: ${{ matrix.project }}
run: ./gradlew --no-daemon --stacktrace :app:assembleDebug
ios:
name: iOS (${{ matrix.name }})
runs-on: macos-latest
timeout-minutes: 45
strategy:
fail-fast: false
matrix:
include:
- name: Full
project: iOS/APIExample
workspace: APIExample.xcworkspace
scheme: APIExample
key_center: APIExample/Common/KeyCenter.swift
rtc_pod: AgoraRtcEngine_iOS
- name: Audio
project: iOS/APIExample-Audio
workspace: APIExample-Audio.xcworkspace
scheme: APIExample-Audio
key_center: APIExample-Audio/Common/KeyCenter.swift
rtc_pod: AgoraAudio_iOS
- name: SwiftUI
project: iOS/APIExample-SwiftUI
workspace: APIExample-SwiftUI.xcworkspace
scheme: APIExample-SwiftUI
key_center: APIExample-SwiftUI/Common/KeyCenter.swift
rtc_pod: AgoraRtcEngine_iOS
- name: Objective-C
project: iOS/APIExample-OC
workspace: APIExample-OC.xcworkspace
scheme: APIExample-OC
key_center: APIExample-OC/Common/KeyCenter.m
rtc_pod: AgoraRtcEngine_iOS
steps:
- uses: actions/checkout@v4
- name: Select the published RTC pod
working-directory: ${{ matrix.project }}
env:
RTC_POD: ${{ matrix.rtc_pod }}
run: |
if grep -Eq "^[[:space:]]*pod 'sdk'" Podfile; then
rtc_version="$(grep -E "pod '$RTC_POD'" Podfile | grep -Eo '[0-9]+\.[0-9]+\.[0-9]+' | head -n 1)"
test -n "$rtc_version"
perl -0pi -e "s/^[ \\t]*pod 'sdk', :path => 'sdk\\.podspec'/ pod '$RTC_POD', '$rtc_version'/m" Podfile
fi
- name: Configure compile-only App ID
working-directory: ${{ matrix.project }}
env:
KEY_CENTER: ${{ matrix.key_center }}
run: |
perl -0pi -e 's/<#YOUR AppId#>/"$ENV{PLACEHOLDER_APP_ID}"/g; s/<#APPID#>/"$ENV{PLACEHOLDER_APP_ID}"/g; s/<#YOUR APPID#>/@"$ENV{PLACEHOLDER_APP_ID}"/g' "$KEY_CENTER"
! grep -Eq '<#[^#]+#>' "$KEY_CENTER"
- name: Install CocoaPods dependencies
working-directory: ${{ matrix.project }}
run: pod install --repo-update
- name: Compile
working-directory: ${{ matrix.project }}
env:
WORKSPACE_NAME: ${{ matrix.workspace }}
SCHEME: ${{ matrix.scheme }}
run: |
xcodebuild \
-workspace "$WORKSPACE_NAME" \
-scheme "$SCHEME" \
-configuration Debug \
-sdk iphonesimulator \
-destination 'generic/platform=iOS Simulator' \
-derivedDataPath "$RUNNER_TEMP/ios-${{ matrix.name }}" \
CODE_SIGNING_ALLOWED=NO \
build
macos:
name: macOS
runs-on: macos-latest
timeout-minutes: 45
steps:
- uses: actions/checkout@v4
- name: Configure compile-only App ID
working-directory: macOS
run: |
perl -0pi -e 's/<#YOUR AppId#>/"$ENV{PLACEHOLDER_APP_ID}"/g' APIExample/Common/KeyCenter.swift
! grep -Eq '<#[^#]+#>' APIExample/Common/KeyCenter.swift
- name: Install CocoaPods dependencies
working-directory: macOS
run: pod install --repo-update
- name: Compile
working-directory: macOS
run: |
xcodebuild \
-workspace APIExample.xcworkspace \
-scheme APIExample \
-configuration Debug \
-derivedDataPath "$RUNNER_TEMP/macos" \
CODE_SIGNING_ALLOWED=NO \
build
windows:
name: Windows
runs-on: windows-2022
timeout-minutes: 45
steps:
- uses: actions/checkout@v4
- uses: microsoft/setup-msbuild@v2
- name: Install public dependencies
working-directory: windows/APIExample
shell: pwsh
run: ./install.ps1
- name: Compile
working-directory: windows/APIExample
shell: pwsh
run: msbuild APIExample.sln -m /p:Configuration=Release /p:Platform=Win32 /p:PlatformToolset=v143