-
Notifications
You must be signed in to change notification settings - Fork 78
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add jobs to deploy and cleanup baas on cloud-dev (#309)
Co-authored-by: Kasper Overgård Nielsen <kasper.nielsen@mongodb.com>
- Loading branch information
Showing
21 changed files
with
706 additions
and
138 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,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 |
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 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
Oops, something went wrong.