Skip to content
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

Add jobs to deploy and cleanup baas on cloud-dev #309

Merged
merged 27 commits into from
Mar 28, 2022
Merged
Show file tree
Hide file tree
Changes from 12 commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
89c8c45
Add jobs to deploy and cleanup baas on cloud-dev
nirinchev Mar 23, 2022
458d34d
Trigger a build
nirinchev Mar 23, 2022
e4309bf
Don't be so secretive about the urls
nirinchev Mar 23, 2022
7eeb93e
Add a PR build
nirinchev Mar 23, 2022
a47a3f8
Bring back baas
nirinchev Mar 23, 2022
319cd2d
Baas client WIP
nirinchev Mar 23, 2022
9ace801
Wrap up the baas client
nirinchev Mar 24, 2022
ea9d9c1
Try to deploy apps earlier
nirinchev Mar 24, 2022
83c3ba2
Merge branch 'master' into ni/baas
nirinchev Mar 24, 2022
e29f855
Trigger build
nirinchev Mar 24, 2022
3a83711
Do a proper checkout
nirinchev Mar 24, 2022
b89715f
Revert unrelated change
nirinchev Mar 24, 2022
8ae6ab1
Revert linux workflow
nirinchev Mar 24, 2022
b452e1f
Apply suggestions from code review
nirinchev Mar 24, 2022
b083f33
Nitpicking suggestions
nielsenko Mar 24, 2022
fd7f6af
Prefer const ctors
nielsenko Mar 24, 2022
699ee86
Fix workflow
nirinchev Mar 24, 2022
c2aa08b
Remove some default args
nirinchev Mar 24, 2022
52d71e7
Merge branch 'nielsenko/bass-suggestions' into ni/baas
nirinchev Mar 24, 2022
eec8649
Clean up the PR
nirinchev Mar 24, 2022
fd01fce
Fix indents
nirinchev Mar 24, 2022
f076c96
Add http to flutter dev dependencies
nirinchev Mar 24, 2022
8f914c4
Try to fix build again
nirinchev Mar 24, 2022
c25053b
Remove flutter linux workflow
nirinchev Mar 24, 2022
2c43087
Update .github/workflows/pr.yml
nirinchev Mar 25, 2022
938c7f2
Code review fixes
nirinchev Mar 28, 2022
280a47e
Merge branch 'master' into ni/baas
nirinchev Mar 28, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
104 changes: 104 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
name: PR Build

on:
push:
branches:
- master
pull_request:
nirinchev marked this conversation as resolved.
Show resolved Hide resolved
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
nielsenko marked this conversation as resolved.
Show resolved Hide resolved
id: deploy-mdb-apps
with:
projectId: ${{ secrets.ATLAS_PROJECT_ID }}
realmUrl: https://realm-dev.mongodb.com
atlasUrl: https://cloud-dev.mongodb.com
apiKey: ${{ secrets.ATLAS_PUBLIC_API_KEY }}
privateApiKey: ${{ secrets.ATLAS_PRIVATE_API_KEY }}
differentiator: dart-linux
blagoev marked this conversation as resolved.
Show resolved Hide resolved
- 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 }}
nirinchev marked this conversation as resolved.
Show resolved Hide resolved
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
nielsenko marked this conversation as resolved.
Show resolved Hide resolved
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: 'recursive'
- 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

cleanup-baas:
runs-on: ubuntu-latest
name: Cleanup Linux
nirinchev marked this conversation as resolved.
Show resolved Hide resolved
needs:
- tests-linux
if: always()
timeout-minutes: 5
steps:
- uses: realm/ci-actions/mdb-realm/cleanup@fac1d6958f03d71de743305ce3ab27594efbe7b7
nielsenko marked this conversation as resolved.
Show resolved Hide resolved
with:
projectId: ${{ secrets.ATLAS_PROJECT_ID}}
realmUrl: https://realm-dev.mongodb.com
atlasUrl: https://cloud-dev.mongodb.com
apiKey: ${{ secrets.ATLAS_PUBLIC_API_KEY}}
privateApiKey: ${{ secrets.ATLAS_PRIVATE_API_KEY }}
differentiator: dart-linux
41 changes: 37 additions & 4 deletions .github/workflows/realm-dart-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,31 @@ on:
- 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:

jobs:
deploy-baas:
runs-on: ubuntu-latest
name: Deploy BaaS
outputs:
clusterName: ${{ steps.deploy-mdb-apps.outputs.clusterName }}
timeout-minutes: 20
steps:
- uses: realm/ci-actions/mdb-realm/deployApps@fac1d6958f03d71de743305ce3ab27594efbe7b7
id: deploy-mdb-apps
with:
projectId: ${{ secrets.ATLAS_PROJECT_ID}}
realmUrl: https://realm-dev.mongodb.com
atlasUrl: https://cloud-dev.mongodb.com
apiKey: ${{ secrets.ATLAS_PUBLIC_API_KEY}}
privateApiKey: ${{ secrets.ATLAS_PRIVATE_API_KEY }}
differentiator: dart-linux

CI:
runs-on: ubuntu-latest
env:
REALM_CI: true

needs:
- deploy-baas
steps:
- name: Checkout
uses: actions/checkout@v2
Expand All @@ -38,7 +55,7 @@ jobs:
run: |
dart test -r expanded -j 1 --test-randomize-ordering-seed random
echo "ARCHIVE_PATH=$(pwd)/binary/linux.tar.gz" >> $GITHUB_ENV

- name: Archive binary
if: ${{ success() && github.event_name == 'push' && github.ref_type == 'tag' }}
run: |
Expand All @@ -57,4 +74,20 @@ jobs:
artifacts: ${{ env.ARCHIVE_PATH }}
body: "ADD RELEASE NOTES"
omitBodyDuringUpdate: true
token: ${{ secrets.GITHUB_TOKEN }}
token: ${{ secrets.GITHUB_TOKEN }}
cleanup-baas:
runs-on: ubuntu-latest
name: Cleanup BaaS
needs:
- CI
if: always()
timeout-minutes: 5
steps:
- uses: realm/ci-actions/mdb-realm/cleanup@fac1d6958f03d71de743305ce3ab27594efbe7b7
with:
projectId: ${{ secrets.ATLAS_PROJECT_ID}}
realmUrl: https://realm-dev.mongodb.com
atlasUrl: https://cloud-dev.mongodb.com
apiKey: ${{ secrets.ATLAS_PUBLIC_API_KEY}}
privateApiKey: ${{ secrets.ATLAS_PRIVATE_API_KEY }}
differentiator: dart-linux
1 change: 0 additions & 1 deletion .github/workflows/realm-dart-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ on:
- 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:

jobs:
CI:
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/realm-dart-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ on:
- 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:

jobs:
CI:
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/realm-flutter-android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ on:
- 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:

jobs:
CI:
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/realm-flutter-ios.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ on:
- 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:

jobs:
CI:
Expand Down Expand Up @@ -48,7 +47,7 @@ jobs:
uses: subosito/flutter-action@v2
with:
channel: 'stable'

- name: Install dependencies
run: flutter pub get

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

1 change: 0 additions & 1 deletion .github/workflows/realm-flutter-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ on:
- 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:

jobs:
CI:
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/realm-flutter-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ on:
- 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:

jobs:
CI:
Expand Down Expand Up @@ -37,4 +36,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

1 change: 0 additions & 1 deletion .github/workflows/realm-flutter-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ on:
- 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:

jobs:
CI:
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/realm-generator.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ on:
push:
branches:
- master
pull_request:

jobs:
CI:
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.
blagoev marked this conversation as resolved.
Show resolved Hide resolved
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.
Loading