-
Notifications
You must be signed in to change notification settings - Fork 197
218 lines (184 loc) · 5.29 KB
/
sdk-build-validation.yml
File metadata and controls
218 lines (184 loc) · 5.29 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
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
name: Appwrite SDK Build Validation
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
on: [pull_request]
jobs:
generate-and-build:
name: ${{ matrix.sdk }} (${{ matrix.platform }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
# Client SDKs
- sdk: web
platform: client
- sdk: flutter
platform: client
- sdk: apple
platform: client
- sdk: android
platform: client
- sdk: react-native
platform: client
# Server SDKs
- sdk: node
platform: server
- sdk: php
platform: server
- sdk: python
platform: server
- sdk: ruby
platform: server
- sdk: dart
platform: server
- sdk: go
platform: server
- sdk: swift
platform: server
- sdk: dotnet
platform: server
- sdk: kotlin
platform: server
# Console SDKs
- sdk: cli
platform: console
- sdk: web
platform: console
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.3'
extensions: curl
- name: Install Composer Dependencies
run: composer install
- name: Generate SDK for ${{ matrix.sdk }}
run: php example.php ${{ matrix.sdk }} ${{ matrix.platform }}
# Language-specific setup
- name: Setup Node.js
if: matrix.sdk == 'web' || matrix.sdk == 'node' || matrix.sdk == 'react-native' || matrix.sdk == 'cli'
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Setup Bun
if: matrix.sdk == 'cli'
uses: oven-sh/setup-bun@v2
with:
bun-version: 'latest'
- name: Setup Flutter
if: matrix.sdk == 'flutter'
uses: subosito/flutter-action@v2
with:
channel: 'stable'
- name: Setup Swift
if: matrix.sdk == 'apple' || matrix.sdk == 'swift'
run: |
sudo apt-get update
sudo apt-get install -y wget
wget https://download.swift.org/swift-5.9.2-release/ubuntu2204/swift-5.9.2-RELEASE/swift-5.9.2-RELEASE-ubuntu22.04.tar.gz
tar xzf swift-5.9.2-RELEASE-ubuntu22.04.tar.gz
sudo mv swift-5.9.2-RELEASE-ubuntu22.04 /usr/share/swift
echo "/usr/share/swift/usr/bin" >> $GITHUB_PATH
- name: Setup Java
if: matrix.sdk == 'android' || matrix.sdk == 'kotlin'
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
- name: Setup Python
if: matrix.sdk == 'python'
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Setup Ruby
if: matrix.sdk == 'ruby'
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.1'
- name: Setup Dart
if: matrix.sdk == 'dart'
uses: dart-lang/setup-dart@v1
with:
sdk: 'stable'
- name: Setup Go
if: matrix.sdk == 'go'
uses: actions/setup-go@v5
with:
go-version: '1.21'
- name: Setup .NET
if: matrix.sdk == 'dotnet'
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'
- name: Build SDK
working-directory: examples/${{ matrix.sdk }}
run: |
case "${{ matrix.sdk }}" in
web|node)
npm install
npm run build
;;
cli)
bun install
bun run linux-x64
bun run linux-arm64
bun run mac-x64
bun run mac-arm64
bun run windows-x64
bun run windows-arm64
npm install
npm run build
node dist/cli.cjs --help
;;
react-native)
npm install
npm run build || echo "No build script, checking syntax only"
;;
flutter)
flutter pub get
dart analyze --no-fatal-warnings
;;
apple|swift)
swift build
;;
android)
chmod +x ./gradlew || true
./gradlew build -x lint
;;
kotlin)
chmod +x ./gradlew || true
./gradlew build
;;
php)
composer install
composer test
;;
python)
pip install -e .
python -m compileall appwrite/
;;
ruby)
bundle install
;;
dart)
dart pub get
dart analyze --no-fatal-warnings
;;
go)
go mod tidy || true
go build ./...
;;
dotnet)
dotnet build
;;
*)
echo "Unknown SDK: ${{ matrix.sdk }}"
exit 1
;;
esac