Skip to content

Commit

Permalink
Improve CI jobs (#1465)
Browse files Browse the repository at this point in the history
  • Loading branch information
marandaneto authored May 22, 2023
1 parent 6572f8d commit d883d62
Show file tree
Hide file tree
Showing 11 changed files with 61 additions and 47 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/dart.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,35 +34,35 @@ jobs:
os: [ubuntu-latest, windows-latest, macos-latest]
sdk: [stable, beta]
exclude:
- os: windows-latest
sdk: beta
- os: macos-latest
sdk: beta
steps:
- uses: dart-lang/setup-dart@6a218f2413a3e78e9087f638a238f6b40893203d # pin@v1
with:
sdk: ${{ matrix.sdk }}
- uses: actions/checkout@v3
# coverage with 'chrome' platform hangs the build

- name: Test (VM and browser)
if: runner.os != 'macOS'
run: |
dart pub get
dart test -p chrome --test-randomize-ordering-seed=random --chain-stack-traces
dart test -p vm --coverage=coverage --test-randomize-ordering-seed=random --chain-stack-traces
dart pub run coverage:format_coverage --lcov --in=coverage --out=coverage/lcov.info --packages=.dart_tool/package_config.json --report-on=lib
- name: Install webdev
if: runner.os != 'Windows'
run: dart pub global activate webdev

- name: Build example
run: |
cd example
dart pub get
dart compile exe bin/example.dart
dart compile aot-snapshot bin/example.dart
# Windows if condition because of: The pubspec.lock file has changed since the .dart_tool/package_config.json file was generated, please run "pub get" again.
# stable if condition because of: beta channel requires newer build_web_compilers and build_runner with Dart 3
- name: Build Web example
if: runner.os != 'Windows' && matrix.sdk == 'stable'
if: runner.os != 'Windows'
run: |
cd example_web
dart pub get
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/dio.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,16 @@ jobs:
os: [ubuntu-latest, windows-latest, macos-latest]
sdk: [stable, beta]
exclude:
- os: windows-latest
sdk: beta
- os: macos-latest
sdk: beta
steps:
- uses: dart-lang/setup-dart@6a218f2413a3e78e9087f638a238f6b40893203d # pin@v1
with:
sdk: ${{ matrix.sdk }}
- uses: actions/checkout@v3
# coverage with 'chrome' platform hangs the build

- name: Test (VM and browser)
run: |
dart pub get
Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/file.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,12 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
sdk: [stable]
sdk: [stable, beta]
exclude:
- os: windows-latest
sdk: beta
- os: macos-latest
sdk: beta
steps:
- uses: dart-lang/setup-dart@6a218f2413a3e78e9087f638a238f6b40893203d # pin@v1
with:
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/flutter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ jobs:
shell: bash
strategy:
fail-fast: false
# max-parallel: 4
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
target: ['ios', 'android', 'web', 'macos', 'linux', 'windows']
Expand All @@ -43,6 +42,10 @@ jobs:
target: windows
- os: windows-latest
target: ios
- os: windows-latest
target: android
- os: windows-latest
target: web
- os: windows-latest
target: macos
- os: windows-latest
Expand Down Expand Up @@ -96,7 +99,6 @@ jobs:
flutter test --platform chrome --test-randomize-ordering-seed=random --tags canvasKit --web-renderer canvaskit
- name: Test VM with coverage
if: runner.os != 'macOS'
run: |
cd flutter
flutter test --coverage --test-randomize-ordering-seed=random
Expand Down
58 changes: 30 additions & 28 deletions .github/workflows/flutter_integration_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,36 +54,38 @@ jobs:
arch: x86_64
profile: Nexus 6
script: flutter test integration_test/integration_test.dart --verbose
test-ios:
runs-on: macos-latest
timeout-minutes: 30
defaults:
run:
working-directory: ./flutter/example
strategy:
fail-fast: false
matrix:
# 'beta' is flaky because of https://github.com/flutter/flutter/issues/124340
sdk: ['stable']
steps:
- name: checkout
uses: actions/checkout@v3

- uses: subosito/flutter-action@48cafc24713cca54bbe03cdc3a423187d413aafa # pin@v2.10.0
with:
channel: ${{ matrix.sdk }}
# Enable after fixing https://github.com/getsentry/sentry-dart/issues/1448
# test-ios:
# runs-on: macos-latest
# timeout-minutes: 30
# defaults:
# run:
# working-directory: ./flutter/example
# strategy:
# fail-fast: false
# matrix:
# # 'beta' is flaky because of https://github.com/flutter/flutter/issues/124340
# sdk: ['stable']
# steps:
# - name: checkout
# uses: actions/checkout@v3

- name: flutter upgrade
run: flutter upgrade
# - uses: subosito/flutter-action@48cafc24713cca54bbe03cdc3a423187d413aafa # pin@v2.10.0
# with:
# channel: ${{ matrix.sdk }}

- name: flutter pub get
run: flutter pub get
# - name: flutter upgrade
# run: flutter upgrade

- name: launch ios emulator
uses: futureware-tech/simulator-action@ee05c113b79f056b47f354d7b313555f5491e158 #pin@v2
with:
model: 'iPhone 14'
os_version: '16.2'
# - name: flutter pub get
# run: flutter pub get

# - name: launch ios emulator
# uses: futureware-tech/simulator-action@ee05c113b79f056b47f354d7b313555f5491e158 #pin@v2
# with:
# model: 'iPhone 14'
# os_version: '16.2'

- name: run ios integration test
run: flutter test integration_test/integration_test.dart --verbose
# - name: run ios integration test
# run: flutter test integration_test/integration_test.dart --verbose
4 changes: 3 additions & 1 deletion .github/workflows/logging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,16 @@ jobs:
os: [ubuntu-latest, windows-latest, macos-latest]
sdk: [stable, beta]
exclude:
- os: windows-latest
sdk: beta
- os: macos-latest
sdk: beta
steps:
- uses: dart-lang/setup-dart@6a218f2413a3e78e9087f638a238f6b40893203d # pin@v1
with:
sdk: ${{ matrix.sdk }}
- uses: actions/checkout@v3
# coverage with 'chrome' platform hangs the build

- name: Test (VM and browser)
run: |
dart pub get
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/min_version_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
access_token: ${{ github.token }}

build-android:
runs-on: macos-latest
runs-on: ubuntu-latest
timeout-minutes: 30

steps:
Expand All @@ -33,7 +33,7 @@ jobs:
- uses: subosito/flutter-action@48cafc24713cca54bbe03cdc3a423187d413aafa # pin@v2.10.0
with:
flutter-version: '3.0.0'
# Add flutter build web (missing index)

- name: Build Android
run: |
cd min_version_test
Expand All @@ -50,7 +50,7 @@ jobs:
- uses: subosito/flutter-action@48cafc24713cca54bbe03cdc3a423187d413aafa # pin@v2.10.0
with:
flutter-version: '3.0.0'
# Add flutter build web (missing index)

- name: Build iOS
run: |
cd min_version_test
Expand Down
6 changes: 2 additions & 4 deletions .github/workflows/sqflite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ jobs:
shell: bash
strategy:
fail-fast: false
# max-parallel: 4
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
target: ['ios', 'android', 'macos', 'linux', 'windows']
Expand All @@ -43,15 +42,15 @@ jobs:
target: windows
- os: windows-latest
target: ios
- os: windows-latest
target: android
- os: windows-latest
target: macos
- os: windows-latest
target: linux
# macos-latest is taking hours due to limited resources
- os: macos-latest
target: android
- os: macos-latest
target: web
- os: macos-latest
target: linux
- os: macos-latest
Expand Down Expand Up @@ -89,7 +88,6 @@ jobs:
flutter pub get
- name: Test VM with coverage
if: runner.os != 'macOS'
run: |
cd sqflite
flutter test --coverage --test-randomize-ordering-seed=random
Expand Down
2 changes: 1 addition & 1 deletion file/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ issue_tracker: https://github.com/getsentry/sentry-dart/issues
documentation: https://docs.sentry.io/platforms/dart/configuration/integrations/file/

environment:
sdk: '>=2.19.0 <3.0.0'
sdk: '>=2.19.0 <4.0.0'

dependencies:
sentry: 7.6.1
Expand Down
1 change: 1 addition & 0 deletions flutter/example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ dependencies:
sentry_dio:
sentry_logging:
sentry_sqflite:
sentry_file:
universal_platform: ^1.0.0
feedback: ^2.0.0
provider: ^6.0.0
Expand Down
2 changes: 2 additions & 0 deletions flutter/example/pubspec_overrides.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,5 @@ dependency_overrides:
path: ../../logging
sentry_sqflite:
path: ../../sqflite
sentry_file:
path: ../../file

0 comments on commit d883d62

Please sign in to comment.