From d883d62345e5c21066faf14885eea7afd75b89e1 Mon Sep 17 00:00:00 2001 From: Manoel Aranda Neto <5731772+marandaneto@users.noreply.github.com> Date: Mon, 22 May 2023 10:00:29 +0200 Subject: [PATCH] Improve CI jobs (#1465) --- .github/workflows/dart.yml | 12 ++-- .github/workflows/dio.yml | 4 +- .github/workflows/file.yml | 7 ++- .github/workflows/flutter.yml | 6 +- .../workflows/flutter_integration_test.yml | 58 ++++++++++--------- .github/workflows/logging.yml | 4 +- .github/workflows/min_version_test.yml | 6 +- .github/workflows/sqflite.yml | 6 +- file/pubspec.yaml | 2 +- flutter/example/pubspec.yaml | 1 + flutter/example/pubspec_overrides.yaml | 2 + 11 files changed, 61 insertions(+), 47 deletions(-) diff --git a/.github/workflows/dart.yml b/.github/workflows/dart.yml index d400a7127d..312a573806 100644 --- a/.github/workflows/dart.yml +++ b/.github/workflows/dart.yml @@ -34,6 +34,8 @@ jobs: os: [ubuntu-latest, windows-latest, macos-latest] sdk: [stable, beta] exclude: + - os: windows-latest + sdk: beta - os: macos-latest sdk: beta steps: @@ -41,9 +43,8 @@ jobs: 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 @@ -51,18 +52,17 @@ jobs: 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 diff --git a/.github/workflows/dio.yml b/.github/workflows/dio.yml index ccd8e4b5c9..6bae44d19c 100644 --- a/.github/workflows/dio.yml +++ b/.github/workflows/dio.yml @@ -34,6 +34,8 @@ jobs: os: [ubuntu-latest, windows-latest, macos-latest] sdk: [stable, beta] exclude: + - os: windows-latest + sdk: beta - os: macos-latest sdk: beta steps: @@ -41,7 +43,7 @@ jobs: with: sdk: ${{ matrix.sdk }} - uses: actions/checkout@v3 - # coverage with 'chrome' platform hangs the build + - name: Test (VM and browser) run: | dart pub get diff --git a/.github/workflows/file.yml b/.github/workflows/file.yml index faa7a68956..1cf2b4d40d 100644 --- a/.github/workflows/file.yml +++ b/.github/workflows/file.yml @@ -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: diff --git a/.github/workflows/flutter.yml b/.github/workflows/flutter.yml index e03cb7d394..2df1901917 100644 --- a/.github/workflows/flutter.yml +++ b/.github/workflows/flutter.yml @@ -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'] @@ -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 @@ -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 diff --git a/.github/workflows/flutter_integration_test.yml b/.github/workflows/flutter_integration_test.yml index 41edc2b48d..c527265e39 100644 --- a/.github/workflows/flutter_integration_test.yml +++ b/.github/workflows/flutter_integration_test.yml @@ -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 diff --git a/.github/workflows/logging.yml b/.github/workflows/logging.yml index 88b0bfcfe4..88cc91d110 100644 --- a/.github/workflows/logging.yml +++ b/.github/workflows/logging.yml @@ -34,6 +34,8 @@ jobs: os: [ubuntu-latest, windows-latest, macos-latest] sdk: [stable, beta] exclude: + - os: windows-latest + sdk: beta - os: macos-latest sdk: beta steps: @@ -41,7 +43,7 @@ jobs: with: sdk: ${{ matrix.sdk }} - uses: actions/checkout@v3 - # coverage with 'chrome' platform hangs the build + - name: Test (VM and browser) run: | dart pub get diff --git a/.github/workflows/min_version_test.yml b/.github/workflows/min_version_test.yml index 7db24098e6..c5a4d0a756 100644 --- a/.github/workflows/min_version_test.yml +++ b/.github/workflows/min_version_test.yml @@ -19,7 +19,7 @@ jobs: access_token: ${{ github.token }} build-android: - runs-on: macos-latest + runs-on: ubuntu-latest timeout-minutes: 30 steps: @@ -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 @@ -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 diff --git a/.github/workflows/sqflite.yml b/.github/workflows/sqflite.yml index df2c7a0f46..9c0696065b 100644 --- a/.github/workflows/sqflite.yml +++ b/.github/workflows/sqflite.yml @@ -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'] @@ -43,6 +42,8 @@ jobs: target: windows - os: windows-latest target: ios + - os: windows-latest + target: android - os: windows-latest target: macos - os: windows-latest @@ -50,8 +51,6 @@ jobs: # 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 @@ -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 diff --git a/file/pubspec.yaml b/file/pubspec.yaml index b65fef36a5..6a0e9fd39b 100644 --- a/file/pubspec.yaml +++ b/file/pubspec.yaml @@ -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 diff --git a/flutter/example/pubspec.yaml b/flutter/example/pubspec.yaml index 155a01e34e..dc7a33caed 100644 --- a/flutter/example/pubspec.yaml +++ b/flutter/example/pubspec.yaml @@ -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 diff --git a/flutter/example/pubspec_overrides.yaml b/flutter/example/pubspec_overrides.yaml index 50b018cd98..7afb410d83 100644 --- a/flutter/example/pubspec_overrides.yaml +++ b/flutter/example/pubspec_overrides.yaml @@ -9,3 +9,5 @@ dependency_overrides: path: ../../logging sentry_sqflite: path: ../../sqflite + sentry_file: + path: ../../file