Skip to content

Commit

Permalink
Merge 8f914c4 into 32ac88d
Browse files Browse the repository at this point in the history
  • Loading branch information
nirinchev authored Mar 24, 2022
2 parents 32ac88d + 8f914c4 commit daff025
Show file tree
Hide file tree
Showing 20 changed files with 705 additions and 93 deletions.
154 changes: 154 additions & 0 deletions .github/workflows/pr.yml
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
60 changes: 0 additions & 60 deletions .github/workflows/realm-dart-linux.yml

This file was deleted.

4 changes: 2 additions & 2 deletions .github/workflows/realm-flutter-ios.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ jobs:
uses: subosito/flutter-action@v2
with:
channel: 'stable'

- name: Install dependencies
run: flutter pub get

Expand Down Expand Up @@ -87,5 +87,5 @@ jobs:
artifacts: ${{ env.ARCHIVE_PATH }}
body: "ADD RELEASE NOTES"
omitBodyDuringUpdate: true
token: ${{ secrets.GITHUB_TOKEN }}
token: ${{ secrets.GITHUB_TOKEN }}

2 changes: 1 addition & 1 deletion .github/workflows/realm-flutter-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,4 @@ jobs:
- name: Run tests
run: flutter drive -d macos --target=test_driver/app.dart --suppress-analytics --dart-entrypoint-args="" #--verbose #-a="Some test name"
working-directory: ./flutter/realm_flutter/tests

38 changes: 28 additions & 10 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,29 @@
x.x.x Release notes (yyyy-MM-dd)
==============================================================

**This project is in the Alpha stage. All API's might change without warning and no guarantees are given about stability. Do not use it in production.**

### Enhancements
* None

### Fixed
* Fix running package commands.

### Compatibility
* Dart ^2.15 on Windows, MacOS and Linux

### Internal
* Added a command to deploy a MongoDB Realm app to `realm_dart`. Usage: `dart run realm_dart deploy-apps`. By default it will deploy apps to `http://localhost:9090` which is the endpoint of the local docker image. If `--atlas-cluster` is provided, it will authenticate, create an application and link the provided cluster to it. (PR [#309](https://github.com/realm/realm-dart/pull/309))
* Unit tests will now attempt to lookup and create if necessary MongoDB applications (similarly to the above mentioned command). See `test.dart/setupBaas()` for the environment variables that control the Url and Atlas Cluster that will be used. If the `BAAS_URL` environment variable is not set, no apps will be imported and sync tests will not run. (PR [#309](https://github.com/realm/realm-dart/pull/309))

0.2.1+alpha Release notes (2022-03-20)
==============================================================

**This project is in the Alpha stage. All API's might change without warning and no guarantees are given about stability. Do not use it in production.**

### Enhancements
* Support change notifications on query results. ([#208](https://github.com/realm/realm-dart/pull/208))

Every `RealmResults<T>` object now has a `changes` method returning a `Stream<RealmResultsChanges<T>>` which can be listened to.

```dart
Expand Down Expand Up @@ -70,7 +88,7 @@
* Added support for opening in-memory realms. ([#280](https://github.com/realm/realm-dart/pull/280))
* Primary key fields no longer required to be `final` in data model classes ([#240](https://github.com/realm/realm-dart/pull/240))

Previously primary key fields needed to be `final`.
Previously primary key fields needed to be `final`.

```dart
@RealmModel()
Expand All @@ -93,7 +111,7 @@

* List fields no longer required to be `final` in data model classes. ([#253](https://github.com/realm/realm-dart/pull/253))

Previously list fields needed to be `final`.
Previously list fields needed to be `final`.

```dart
@RealmModel()
Expand Down Expand Up @@ -127,7 +145,7 @@

**This project is in the Alpha stage. All API's might change without warning and no guarantees are given about stability. Do not use it in production.**

### Enhancements
### Enhancements
* Completely rewritten from the ground up with sound null safety and using Dart FFI

### Compatibility
Expand All @@ -136,9 +154,9 @@
0.2.0-alpha.2 Release notes (2022-01-29)
==============================================================

Notes: This release is a prerelease version. All API's might change without warning and no guarantees are given about stability.
Notes: This release is a prerelease version. All API's might change without warning and no guarantees are given about stability.

### Enhancements
### Enhancements
* Completеly rewritten from the ground up with sound null safety and using Dart FFI

### Fixed
Expand All @@ -150,9 +168,9 @@ Notes: This release is a prerelease version. All API's might change without warn
0.2.0-alpha.1 Release notes (2022-01-29)
==============================================================

Notes: This release is a prerelease version. All API's might change without warning and no guarantees are given about stability.
Notes: This release is a prerelease version. All API's might change without warning and no guarantees are given about stability.

### Enhancements
### Enhancements
* Completеly rewritten from the ground up with sound null safety and using Dart FFI

### Fixed
Expand All @@ -167,9 +185,9 @@ Notes: This release is a prerelease version. All API's might change without warn
0.2.0-alpha Release notes (2022-01-27)
==============================================================

Notes: This release is a prerelease version. All API's might change without warning and no guarantees are given about stability.
Notes: This release is a prerelease version. All API's might change without warning and no guarantees are given about stability.

### Enhancements
### Enhancements
* Completеly rewritten from the ground up with sound null safety and using Dart FFI

### Compatibility
Expand Down
14 changes: 7 additions & 7 deletions bin/README.md
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.
3 changes: 2 additions & 1 deletion flutter/realm_flutter/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ dependencies:
pub_semver: ^2.1.0
realm_common:
path: ../../common
realm_generator:
realm_generator:
path: ../../generator
tar: ^0.5.4
build_runner: ^2.1.0
Expand All @@ -39,6 +39,7 @@ dev_dependencies:
build_cli: ^2.1.3
json_serializable: ^6.1.0
lints: ^1.0.1
http: ^0.13.4

flutter:
plugin:
Expand Down
3 changes: 2 additions & 1 deletion flutter/realm_flutter/tests/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,10 @@ dev_dependencies:
flutter_lints: ^1.0.4
build_runner: ^2.1.2
test: ^1.20.1
http: ^0.13.4

# Remove once flutter_driver from sdk is updated
dependency_overrides:
dependency_overrides:
test_api: ^0.4.9

flutter:
Expand Down
Loading

0 comments on commit daff025

Please sign in to comment.