-
Notifications
You must be signed in to change notification settings - Fork 87
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
20 changed files
with
705 additions
and
93 deletions.
There are no files selected for viewing
This file contains 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,154 @@ | ||
name: PR Build | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
env: | ||
REALM_CI: true | ||
|
||
jobs: | ||
baas-linux: | ||
runs-on: ubuntu-latest | ||
name: BaaS Linux | ||
outputs: | ||
clusterName: ${{ steps.deploy-mdb-apps.outputs.clusterName }} | ||
timeout-minutes: 20 | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
submodules: false | ||
- uses: realm/ci-actions/mdb-realm/deployApps@fac1d6958f03d71de743305ce3ab27594efbe7b7 | ||
id: deploy-mdb-apps | ||
with: | ||
projectId: ${{ secrets.ATLAS_PROJECT_ID }} | ||
apiKey: ${{ secrets.ATLAS_PUBLIC_API_KEY }} | ||
privateApiKey: ${{ secrets.ATLAS_PRIVATE_API_KEY }} | ||
differentiator: dart-linux | ||
- name : Setup Dart SDK | ||
uses: dart-lang/setup-dart@main | ||
with: | ||
sdk: stable | ||
- name: Deploy Apps | ||
run: dart run realm_dart deploy-apps --baas-url https://realm-dev.mongodb.com --atlas-cluster ${{ steps.deploy-mdb-apps.outputs.clusterName }} --api-key ${{ secrets.ATLAS_PUBLIC_API_KEY }} --private-api-key ${{ secrets.ATLAS_PRIVATE_API_KEY }} --project-id ${{ secrets.ATLAS_PROJECT_ID }} | ||
build-linux: | ||
runs-on: ubuntu-latest | ||
name: Build Linux | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
submodules: 'recursive' | ||
- name: Setup Ninja | ||
uses: seanmiddleditch/gha-setup-ninja@master | ||
- name: Build Realm Dart for Linux | ||
run: ./scripts/build-linux.sh | ||
- name: Store artifacts | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: librealm-linux | ||
path: binary/** | ||
retention-days: 1 | ||
|
||
tests-linux: | ||
runs-on: ubuntu-latest | ||
name: Tests Linux | ||
env: | ||
BAAS_URL: https://realm-dev.mongodb.com | ||
BAAS_CLUSTER: ${{ needs.baas-linux.outputs.clusterName }} | ||
BAAS_API_KEY: ${{ secrets.ATLAS_PUBLIC_API_KEY }} | ||
BAAS_PRIVATE_API_KEY: ${{ secrets.ATLAS_PRIVATE_API_KEY }} | ||
BAAS_PROJECT_ID: ${{ secrets.ATLAS_PROJECT_ID}} | ||
needs: | ||
- baas-linux | ||
- build-linux | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
submodules: false | ||
- name: Fetch artifacts | ||
uses: actions/download-artifact@v2 | ||
with: | ||
name: librealm-linux | ||
path: binary | ||
- name : Setup Dart SDK | ||
uses: dart-lang/setup-dart@main | ||
with: | ||
sdk: stable | ||
- name: Install dependencies | ||
run: dart pub get | ||
- name: Run tests | ||
run: | | ||
dart test -r expanded -j 1 --test-randomize-ordering-seed random | ||
# TODO: these should go away once we have a proper release workflow | ||
- name: Archive binary | ||
if: ${{ success() && github.event_name == 'push' && github.ref_type == 'tag' }} | ||
run: | | ||
dart run realm_dart archive --source-dir $(pwd)/binary/linux --output-file $ARCHIVE_PATH | ||
- name: Release artifacts | ||
if: ${{ success() && github.event_name == 'push' && github.ref_type == 'tag' }} | ||
uses: ncipollo/release-action@v1 | ||
with: | ||
allowUpdates: true | ||
artifactErrorsFailBuild: true | ||
draft: true | ||
omitNameDuringUpdate: true | ||
prerelease: false | ||
omitPrereleaseDuringUpdate: true | ||
artifacts: ${{ env.ARCHIVE_PATH }} | ||
body: "ADD RELEASE NOTES" | ||
omitBodyDuringUpdate: true | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
flutter-linux: | ||
runs-on: ubuntu-latest | ||
name: Flutter Tests Linux | ||
needs: | ||
- build-linux | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
submodules: false | ||
- name: Setup GTK | ||
run: | | ||
sudo apt-get update -y | ||
sudo apt-get install -y libgtk-3-dev xvfb | ||
- name: Setup Ninja | ||
uses: seanmiddleditch/gha-setup-ninja@master | ||
- name: Fetch artifacts | ||
uses: actions/download-artifact@v2 | ||
with: | ||
name: librealm-linux | ||
path: binary | ||
- name: Setup Flutter | ||
uses: subosito/flutter-action@v2 | ||
with: | ||
channel: 'stable' | ||
- name: Enable Flutter Desktop support | ||
run: flutter config --enable-linux-desktop | ||
- name: Install dependencies | ||
run: flutter pub get | ||
- name: Run tests | ||
run: xvfb-run flutter drive -d linux --target=test_driver/app.dart --suppress-analytics --dart-entrypoint-args="" #--verbose #-a="Some test name" | ||
working-directory: ./flutter/realm_flutter/tests | ||
|
||
|
||
cleanup-linux: | ||
runs-on: ubuntu-latest | ||
name: Cleanup Linux | ||
needs: | ||
- tests-linux | ||
if: always() | ||
timeout-minutes: 5 | ||
steps: | ||
- uses: realm/ci-actions/mdb-realm/cleanup@fac1d6958f03d71de743305ce3ab27594efbe7b7 | ||
with: | ||
projectId: ${{ secrets.ATLAS_PROJECT_ID}} | ||
apiKey: ${{ secrets.ATLAS_PUBLIC_API_KEY}} | ||
privateApiKey: ${{ secrets.ATLAS_PRIVATE_API_KEY }} | ||
differentiator: dart-linux |
This file was deleted.
Oops, something went wrong.
This file contains 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
This file contains 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
This file contains 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
This file contains 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 |
---|---|---|
@@ -1,10 +1,10 @@ | ||
Dart packages should distribute their prebuilt native extension binaries (if any) in the lib directory of the package. | ||
This is where Dart VM looks for the binary when an application loads the Dart package. | ||
On Windows Dart VM have a bug which looks for the package with incorrect path. | ||
For Realm Dart this is something like C:\C:\<DART_PACKAGES_CACHE_PATH>\realm_dart\lib\src\realm_dart.dartrealm_dart_extension.dll. | ||
The name of the native extension binary and the device letter is incorreth path on Windows. | ||
Dart packages should distribute their prebuilt native extension binaries (if any) in the lib directory of the package. | ||
This is where Dart VM looks for the binary when an application loads the Dart package. | ||
On Windows Dart VM have a bug which looks for the package with incorrect path. | ||
For Realm Dart this is something like C:\C:\<DART_PACKAGES_CACHE_PATH>\realm_dart\lib\src\realm_dart.dartrealm_dart_extension.dll. | ||
The name of the native extension binary and the device letter is incorrect path on Windows. | ||
|
||
To workaround this bug Realm Dart package has a script in its binary directory which copies the native extension to the correct place on Windows | ||
When the Dart VM bug is fixed Realm Dart package should move the native extension dll to its lib directory and this script will not be needed. | ||
When the Dart VM bug is fixed Realm Dart package should move the native extension dll to its lib directory and this script will not be needed. | ||
|
||
In order to use the Realm Dart package application developers should execute `pub run realm_dart install` from the root directory of their Dart application. | ||
In order to use the Realm Dart package application developers should execute `pub run realm_dart install` from the root directory of their Dart application. |
This file contains 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
This file contains 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
Oops, something went wrong.