Skip to content

Commit

Permalink
Merge 6b2163d into 2c43087
Browse files Browse the repository at this point in the history
  • Loading branch information
nirinchev committed Mar 25, 2022
2 parents 2c43087 + 6b2163d commit 444a0fb
Show file tree
Hide file tree
Showing 7 changed files with 244 additions and 283 deletions.
249 changes: 243 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 @@ -57,7 +61,6 @@ jobs:
name: librealm-linux
path: binary/**
retention-days: 1

tests-linux:
runs-on: ubuntu-latest
name: Tests Linux
Expand Down Expand Up @@ -87,13 +90,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 @@ -109,7 +112,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 @@ -142,8 +144,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 @@ -158,3 +158,240 @@ 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

# Windows jobs
build-windows:
runs-on: windows-latest
name: Build Windows
steps:
- name: Checkout
uses: actions/checkout@v2
with:
submodules: 'recursive'
- name: Build Realm Dart for Windows
run: scripts\build.bat
- name: Store artifacts
uses: actions/upload-artifact@v2
with:
name: librealm-windows
path: binary/**
retention-days: 1
tests-windows:
runs-on: windows-latest
name: Tests Windows
needs:
- build-windows
steps:
- name: Checkout
uses: actions/checkout@v2
with:
submodules: false
- name: Fetch artifacts
uses: actions/download-artifact@v2
with:
name: librealm-windows
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\\windows.tar.gz" >> $env:GITHUB_ENV
echo "ARCHIVE_SOURCE_PATH=$(pwd)\\binary\\windows" >> $env:GITHUB_ENV
dart run realm_dart archive --source-dir ${{ env.ARCHIVE_SOURCE_PATH }} --output-file ${{ env.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-windows:
runs-on: windows-latest
name: Flutter Tests Windows
needs:
- build-windows
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-windows-desktop
- name: Install dependencies
run: flutter pub get
- name: Run tests
run: flutter drive -d windows --target=test_driver/app.dart --suppress-analytics --dart-entrypoint-args="" #--verbose #-a="Some test name"
working-directory: ./flutter/realm_flutter/tests

# generator
generator:
runs-on: ubuntu-latest
needs:
- build-linux
steps:
- name: Checkout
uses: actions/checkout@v2
with:
submodules: false
- name : Setup Dart SDK
uses: dart-lang/setup-dart@main
with:
sdk: stable
- name: Install generator dependencies
run: dart pub get
working-directory: ./generator/
- name: Run generator tests
run: dart test --reporter expanded --coverage ./coverage/ --test-randomize-ordering-seed random
working-directory: ./generator/
- name: Install realm_dart dependencies
run: dart pub get
- name: Run generator in realm-dart repo
run: |
find . -name "*.g.dart" -delete
dart run build_runner build --delete-conflicting-outputs
# TODO: fail the build if there are uncommitted changes as
# that would mean the generated files weren't pushed.
- name: Fetch artifacts
uses: actions/download-artifact@v2
with:
name: librealm-linux
path: binary
- name: Run realm_dart tests
run: dart test -r expanded -j 1 --test-randomize-ordering-seed random
- name: Generate generator coverage report
run: |
dart run coverage:format_coverage \
--in coverage/ \
--out ./coverage/lcov.info \
--check-ignore \
--lcov \
--packages .packages \
--report-on lib
working-directory: ./generator/
- name: Publish Generator Coverage
id: publish-generator-coverage
uses: coverallsapp/github-action@1.1.3
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
flag-name: realm_generator
path-to-lcov: ./generator/coverage/lcov.info
continue-on-error: true
- name: Output Coveralls response
if: ${{ success() }}
run: echo ${{ steps.publish-generator-coverage.outputs.coveralls-api-result }}
working-directory: ./generator/
61 changes: 0 additions & 61 deletions .github/workflows/realm-dart-macos.yml

This file was deleted.

Loading

0 comments on commit 444a0fb

Please sign in to comment.