Skip to content

Commit

Permalink
Add jobs to deploy and cleanup baas on cloud-dev (#309)
Browse files Browse the repository at this point in the history
Co-authored-by: Kasper Overgård Nielsen <kasper.nielsen@mongodb.com>
  • Loading branch information
nirinchev and nielsenko committed Mar 28, 2022
1 parent 816a9c5 commit fc665ac
Show file tree
Hide file tree
Showing 21 changed files with 706 additions and 138 deletions.
162 changes: 162 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,162 @@
name: PR Build

on:
push:
branches:
- master
tags:
- '[0-9]+.[0-9]+.[0-9]+**' # matches tags like number(s).number(s).number(s)(any) for ex: 1.0.0 and also 1.0.0+beta
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 }}

47 changes: 0 additions & 47 deletions .github/workflows/realm-flutter-linux.yml

This file was deleted.

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

31 changes: 20 additions & 11 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,17 @@ 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
Support result value from write transaction callbacks ([#294](https://github.com/realm/realm-dart/pull/294/))
* Support result value from write transaction callbacks ([#294](https://github.com/realm/realm-dart/pull/294/))

### Fixed
* None

### 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)
==============================================================
Expand All @@ -14,7 +23,7 @@ Support result value from write transaction callbacks ([#294](https://github.com

### 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 @@ -79,7 +88,7 @@ Support result value from write transaction callbacks ([#294](https://github.com
* 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 @@ -102,7 +111,7 @@ Support result value from write transaction callbacks ([#294](https://github.com

* 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 @@ -136,7 +145,7 @@ Support result value from write transaction callbacks ([#294](https://github.com

**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 @@ -145,9 +154,9 @@ Support result value from write transaction callbacks ([#294](https://github.com
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 @@ -159,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 @@ -176,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
Loading

0 comments on commit fc665ac

Please sign in to comment.