-
Notifications
You must be signed in to change notification settings - Fork 190
Add SDK build validation workflow for real spec files #1206
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
3da9477
Add SDK build validation workflow for real spec files
ChiragAgg5k a166f4b
Allow linter warnings in Flutter and Dart analysis
ChiragAgg5k 6a8b000
Update workflow name to reflect Appwrite spec validation
ChiragAgg5k 305772a
Remove duplicate Appwrite from job names
ChiragAgg5k aa2ea30
Use example.php with arguments instead of separate generate-sdk.php
ChiragAgg5k 3bf00f6
Fix Swift setup using direct installation instead of broken action
ChiragAgg5k 6a4b867
Fix Flutter and Dart analyze flags
ChiragAgg5k bb1bb44
fix flutter
ChiragAgg5k e727b00
Fix Swift and Apple Package.swift missing AppwriteEnums dependency
ChiragAgg5k 3211bb8
fix: to use dart analyze
ChiragAgg5k 9758a73
try fix
ChiragAgg5k efdce31
Skip lint checks in Android/Kotlin build validation
ChiragAgg5k 9205e71
fix: to not use lint in kotlin
ChiragAgg5k fa19212
fix: test
ChiragAgg5k ba72c1c
Refactor: extract SDK configuration into helper function
ChiragAgg5k ace7691
cleanup more
ChiragAgg5k e0d00a6
small fixes
ChiragAgg5k aa9db05
overide namespace
ChiragAgg5k 56a4fd6
update more
ChiragAgg5k File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,199 @@ | ||
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 | ||
|
||
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 == 'cli' || matrix.sdk == 'react-native' | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: '20' | ||
|
||
- 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) | ||
npm install | ||
npm run linux-x64 | ||
;; | ||
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 | ||
;; | ||
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 |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.