Skip to content

Commit

Permalink
Move the macos workflows to pr.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
nirinchev committed Mar 25, 2022
1 parent c25053b commit d8dc58e
Show file tree
Hide file tree
Showing 4 changed files with 96 additions and 108 deletions.
101 changes: 95 additions & 6 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,15 @@ 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:
# Linux jobs

baas-linux:
runs-on: ubuntu-latest
name: BaaS Linux
Expand Down Expand Up @@ -51,7 +55,6 @@ jobs:
name: librealm-linux
path: binary/**
retention-days: 1

tests-linux:
runs-on: ubuntu-latest
name: Tests Linux
Expand Down Expand Up @@ -81,13 +84,13 @@ jobs:
- name: Install dependencies
run: dart pub get
- name: Run tests
run: |
dart test -r expanded -j 1 --test-randomize-ordering-seed random
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: |
echo "ARCHIVE_PATH=$(pwd)/binary/linux.tar.gz" >> $GITHUB_ENV
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' }}
Expand All @@ -103,7 +106,6 @@ jobs:
body: "ADD RELEASE NOTES"
omitBodyDuringUpdate: true
token: ${{ secrets.GITHUB_TOKEN }}

flutter-linux:
runs-on: ubuntu-latest
name: Flutter Tests Linux
Expand Down Expand Up @@ -136,8 +138,6 @@ jobs:
- 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
Expand All @@ -152,3 +152,92 @@ jobs:
apiKey: ${{ secrets.ATLAS_PUBLIC_API_KEY}}
privateApiKey: ${{ secrets.ATLAS_PRIVATE_API_KEY }}
differentiator: dart-linux

# macOS jobs

build-macos:
runs-on: macos-latest
name: Build macOS
steps:
- name: Checkout
uses: actions/checkout@v2
with:
submodules: 'recursive'
- name: Build Realm Dart for macOS
run: ./scripts/build-macos.sh
- name: Store artifacts
uses: actions/upload-artifact@v2
with:
name: librealm-macos
path: binary/**
retention-days: 1
tests-macos:
runs-on: macos-latest
name: Tests macOS
needs:
- build-macos
steps:
- name: Checkout
uses: actions/checkout@v2
with:
submodules: false
- name: Fetch artifacts
uses: actions/download-artifact@v2
with:
name: librealm-macos
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: |
echo "ARCHIVE_PATH=$(pwd)/binary/macos.tar.gz" >> $GITHUB_ENV
dart run realm_dart archive --source-dir $(pwd)/binary/macos --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-macos:
runs-on: macos-latest
name: Flutter Tests macOS
needs:
- build-macos
steps:
- name: Checkout
uses: actions/checkout@v2
with:
submodules: false
- name: Fetch artifacts
uses: actions/download-artifact@v2
with:
name: librealm-macos
path: binary
- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
channel: 'stable'
- name: Enable Flutter Desktop support
run: flutter config --enable-macos-desktop
- name: Install dependencies
run: flutter pub get
- 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
61 changes: 0 additions & 61 deletions .github/workflows/realm-dart-macos.yml

This file was deleted.

40 changes: 0 additions & 40 deletions .github/workflows/realm-flutter-macos.yml

This file was deleted.

2 changes: 1 addition & 1 deletion lib/src/init.dart
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ DynamicLibrary initRealm() {

if (Platform.isLinux) {
if (isFlutterPlatform) {
return '${File(Platform.resolvedExecutable).parent.path}/lib/lib$binaryName.so';
return '${File(Platform.resolvedExecutable).parent.path}/lib/lib$binaryName.so';
}

if (path.isEmpty) {
Expand Down

0 comments on commit d8dc58e

Please sign in to comment.