diff --git a/.github/actions/coverage/action.yml b/.github/actions/coverage/action.yml index 5989db8aac..793488f143 100644 --- a/.github/actions/coverage/action.yml +++ b/.github/actions/coverage/action.yml @@ -21,12 +21,6 @@ runs: using: composite steps: - - name: Format coverage info - if: ${{ inputs.coverage != '' }} - run: dart pub run coverage:format_coverage --lcov --in=coverage --out=coverage/lcov.info --packages=.dart_tool/package_config.json --report-on=lib - shell: bash - working-directory: ${{ inputs.directory }} - - uses: codecov/codecov-action@e28ff129e5465c2c0dcc6f003fc735cb6ae0c673 # pin@v3 if: ${{ inputs.coverage != '' }} with: @@ -39,3 +33,4 @@ runs: with: path: './${{ inputs.directory }}/coverage/lcov.info' min_coverage: ${{ inputs.min-coverage }} + exclude: 'lib/src/native/cocoa/binding.dart' diff --git a/.github/actions/dart-test/action.yml b/.github/actions/dart-test/action.yml index bb13fa0300..cd4fd6c2a1 100644 --- a/.github/actions/dart-test/action.yml +++ b/.github/actions/dart-test/action.yml @@ -23,9 +23,16 @@ runs: working-directory: ${{ inputs.directory }} - name: Test VM - run: dart test -p vm ${{ (runner.os == 'Linux' && matrix.sdk == 'stable' && '--coverage=coverage') || '' }} --test-randomize-ordering-seed=random --chain-stack-traces - shell: bash working-directory: ${{ inputs.directory }} + shell: bash + run: | + testCmd="dart test -p vm --test-randomize-ordering-seed=random --chain-stack-traces" + if ${{ (matrix.os == 'ubuntu' && matrix.sdk == 'stable' && 'true') || 'false' }} ; then + $testCmd --coverage=coverage + dart run coverage:format_coverage --lcov --in=coverage --out=coverage/lcov.info --packages=.dart_tool/package_config.json --report-on=lib + else + $testCmd + fi - name: Test dart2js if: ${{ inputs.web == 'true' }} diff --git a/.github/actions/flutter-test/action.yml b/.github/actions/flutter-test/action.yml new file mode 100644 index 0000000000..8a228467eb --- /dev/null +++ b/.github/actions/flutter-test/action.yml @@ -0,0 +1,56 @@ +name: Flutter tests +description: Run Flutter tests +inputs: + directory: + description: The directory to run tests in + required: false + default: '' + +runs: + using: composite + + steps: + - uses: subosito/flutter-action@f2c4f6686ca8e8d6e6d0f28410eeef506ed66aff # pin@v2.18.0 + with: + channel: ${{ matrix.sdk }} + + - uses: actions/setup-java@v4 + if: ${{ matrix.target == 'android' }} + with: + java-version: '17' + distribution: 'adopt' + + # Install required dependencies for Flutter on Linux on Ubuntu + - name: "Setup Linux" + if: matrix.target == 'linux' + shell: bash + run: | + sudo apt-get update -qq + sudo apt-get install -qq -y cmake dbus libblkid-dev libgtk-3-dev liblzma-dev ninja-build pkg-config xvfb libcurl4-openssl-dev network-manager upower + + - run: flutter pub get + shell: bash + working-directory: ${{ inputs.directory }} + + - name: Test VM + if: matrix.target == 'linux' || matrix.target == 'windows' || matrix.target == 'macos' + working-directory: ${{ inputs.directory }} + shell: bash + run: | + testCmd="flutter test ${{ (inputs.directory == 'isar' && '-j 1') || '' }} --test-randomize-ordering-seed=random" + if ${{ (matrix.target == 'linux' && matrix.sdk == 'stable' && 'true') || 'false' }} ; then + $testCmd --coverage + if [[ '${{ inputs.directory }}' == 'flutter' ]] ; then + dart run remove_from_coverage -f coverage/lcov.info -r 'binding.dart' + fi + else + $testCmd + fi + + - name: Test web (${{ matrix.target }}) + if: matrix.target == 'js' || matrix.target == 'wasm' + working-directory: ${{ inputs.directory }} + shell: bash + run: | + flutter test --platform chrome ${{ (matrix.target == 'wasm' && '--wasm') || '' }} --test-randomize-ordering-seed=random --exclude-tags canvasKit + flutter test --platform chrome ${{ (matrix.target == 'wasm' && '--wasm') || '' }} --test-randomize-ordering-seed=random --tags canvasKit diff --git a/.github/workflows/dart.yml b/.github/workflows/dart.yml index 8f2c2f2b10..e5f7f676db 100644 --- a/.github/workflows/dart.yml +++ b/.github/workflows/dart.yml @@ -9,6 +9,9 @@ on: - '!**/*.md' - '!**/class-diagram.svg' - '.github/workflows/dart.yml' + - '.github/workflows/analyze.yml' + - '.github/actions/dart-test/**' + - '.github/actions/coverage/**' - 'dart/**' jobs: @@ -21,7 +24,7 @@ jobs: access_token: ${{ github.token }} build: - name: Dart ${{matrix.sdk}} on ${{matrix.os}} + name: '${{ matrix.os }} | ${{ matrix.sdk }}' runs-on: ${{ matrix.os }}-latest timeout-minutes: 30 strategy: @@ -36,6 +39,7 @@ jobs: - '3.2' - '3.3' - '3.4' + - '3.5' - stable - beta include: diff --git a/.github/workflows/dio.yml b/.github/workflows/dio.yml index 8aa8e578cd..ec461025a1 100644 --- a/.github/workflows/dio.yml +++ b/.github/workflows/dio.yml @@ -9,6 +9,9 @@ on: - '!**/*.md' - '!**/class-diagram.svg' - '.github/workflows/dio.yml' + - '.github/workflows/analyze.yml' + - '.github/actions/dart-test/**' + - '.github/actions/coverage/**' - 'dart/**' - 'dio/**' @@ -22,19 +25,15 @@ jobs: access_token: ${{ github.token }} build: - name: Build ${{matrix.sdk}} on ${{matrix.os}} - runs-on: ${{ matrix.os }} + name: '${{ matrix.os }} | ${{ matrix.sdk }}' + runs-on: ${{ matrix.os }}-latest timeout-minutes: 30 strategy: fail-fast: false matrix: - os: [ubuntu-latest, windows-latest, macos-latest] + os: [macos, ubuntu, windows] sdk: [stable, beta] - exclude: - - os: windows-latest - sdk: beta - - os: macos-latest - sdk: beta + steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/drift.yml b/.github/workflows/drift.yml index 616c1020b2..7fb68d999c 100644 --- a/.github/workflows/drift.yml +++ b/.github/workflows/drift.yml @@ -6,11 +6,14 @@ on: - release/** pull_request: paths: - - "!**/*.md" - - "!**/class-diagram.svg" - - ".github/workflows/drift.yml" - - "dart/**" - - "drift/**" + - '!**/*.md' + - '!**/class-diagram.svg' + - '.github/workflows/drift.yml' + - '.github/workflows/analyze.yml' + - '.github/actions/flutter-test/**' + - '.github/actions/coverage/**' + - 'dart/**' + - 'drift/**' jobs: cancel-previous-workflow: @@ -22,96 +25,32 @@ jobs: access_token: ${{ github.token }} build: - name: ${{ matrix.target }} | ${{ matrix.os }} | ${{ matrix.sdk }} - runs-on: ${{ matrix.os }} + name: '${{ matrix.target }} | ${{ matrix.sdk }}' + runs-on: ${{ matrix.target == 'linux' && 'ubuntu' || matrix.target }}-latest timeout-minutes: 30 - defaults: - run: - shell: bash strategy: fail-fast: false matrix: - os: [ubuntu-latest, macos-latest, windows-latest] - target: ["ios", "android", "macos", "linux", "windows"] - sdk: ["stable", "beta"] - exclude: - - os: ubuntu-latest - target: ios - - os: ubuntu-latest - target: macos - - os: ubuntu-latest - 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: linux - - os: macos-latest - target: windows - # Bad CPU type in executable - - os: macos-latest - sdk: beta - # Exclude beta for windows for now until the flutter set up action does not fail anymore - - os: windows-latest - sdk: beta + target: [macos, linux, windows] + sdk: [stable, beta] steps: - uses: actions/checkout@v4 - - uses: actions/setup-java@v4 - if: ${{ matrix.target == 'android' }} + - uses: ./.github/actions/flutter-test with: - java-version: "11" - distribution: "adopt" + directory: drift - # Install required dependencies for Flutter on Linux on Ubuntu - - name: "Setup Linux" - run: | - sudo apt update - sudo apt install -y cmake dbus libblkid-dev libgtk-3-dev liblzma-dev ninja-build pkg-config xvfb - sudo apt install -y network-manager upower - if: matrix.os == 'ubuntu-latest' && matrix.target == 'linux' - - - uses: subosito/flutter-action@f2c4f6686ca8e8d6e6d0f28410eeef506ed66aff # pin@v2.18.0 - with: - channel: ${{ matrix.sdk }} - - - run: flutter upgrade - - - name: Pub Get - run: | - cd drift - flutter pub get - - - name: Test VM with coverage - run: | - cd drift - flutter test --coverage --test-randomize-ordering-seed=random - - - uses: codecov/codecov-action@7f8b4b4bde536c465e797be725718b88c5d95e0e # pin@v3 - if: runner.os == 'Linux' && matrix.sdk == 'stable' && matrix.target == 'linux' + - uses: ./.github/actions/coverage + if: matrix.target == 'linux' && matrix.sdk == 'stable' with: - name: sentry_drift - file: ./drift/coverage/lcov.info - functionalities: "search" # remove after https://github.com/codecov/codecov-action/issues/600 token: ${{ secrets.CODECOV_TOKEN }} - - - uses: VeryGoodOpenSource/very_good_coverage@c953fca3e24a915e111cc6f55f03f756dcb3964c # pin@v3.0.0 - if: runner.os == 'Linux' && matrix.sdk == 'stable' && matrix.target == 'linux' - with: - path: "./drift/coverage/lcov.info" - min_coverage: 80 + directory: drift + coverage: sentry_drift + min-coverage: 80 analyze: uses: ./.github/workflows/analyze.yml with: package: drift - sdk: flutter \ No newline at end of file + sdk: flutter diff --git a/.github/workflows/e2e_dart.yml b/.github/workflows/e2e_dart.yml index 02b6384548..ba247b3394 100644 --- a/.github/workflows/e2e_dart.yml +++ b/.github/workflows/e2e_dart.yml @@ -9,6 +9,7 @@ on: - "!**/*.md" - "!**/class-diagram.svg" - ".github/workflows/e2e_dart.yml" + - '.github/workflows/analyze.yml' - "dart/**" - "e2e_test/**" diff --git a/.github/workflows/file.yml b/.github/workflows/file.yml index 6d5cd8f8c9..eda4c26ae3 100644 --- a/.github/workflows/file.yml +++ b/.github/workflows/file.yml @@ -9,6 +9,9 @@ on: - '!**/*.md' - '!**/class-diagram.svg' - '.github/workflows/file.yml' + - '.github/workflows/analyze.yml' + - '.github/actions/dart-test/**' + - '.github/actions/coverage/**' - 'dart/**' - 'flutter/**' - 'file/**' @@ -23,19 +26,15 @@ jobs: access_token: ${{ github.token }} build: - name: Build ${{matrix.sdk}} on ${{matrix.os}} - runs-on: ${{ matrix.os }} + name: '${{ matrix.os }} | ${{ matrix.sdk }}' + runs-on: ${{ matrix.os }}-latest timeout-minutes: 30 strategy: fail-fast: false matrix: - os: [ubuntu-latest, windows-latest, macos-latest] + os: [macos, ubuntu, windows] sdk: [stable, beta] - exclude: - - os: windows-latest - sdk: beta - - os: macos-latest - sdk: beta + steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/flutter.yml b/.github/workflows/flutter.yml index cf486c4de3..72638f8cd3 100644 --- a/.github/workflows/flutter.yml +++ b/.github/workflows/flutter.yml @@ -7,6 +7,9 @@ on: pull_request: paths: - '.github/workflows/flutter.yml' + - '.github/workflows/analyze.yml' + - '.github/actions/flutter-test/**' + - '.github/actions/coverage/**' - '!**/*.md' - '!**/class-diagram.svg' - 'dart/**' @@ -26,16 +29,11 @@ jobs: name: '${{ matrix.target }} | ${{ matrix.os }} | ${{ matrix.sdk }}' runs-on: ${{ matrix.os }}-latest timeout-minutes: 30 - defaults: - run: - shell: bash - working-directory: flutter strategy: fail-fast: false matrix: - target: [android, ios, macos, linux, windows, web] + target: [android, ios, macos, linux, windows, js, wasm] sdk: [stable, beta] - # Specify which platform to run on for each target: include: - target: android os: ubuntu @@ -47,75 +45,31 @@ jobs: os: ubuntu - target: windows os: windows - - target: web + - target: js + os: ubuntu + - target: wasm os: ubuntu - # Exclude beta for windows for now until the flutter set up action does not fail anymore - exclude: - - target: windows - sdk: beta steps: - uses: actions/checkout@v4 - - uses: actions/setup-java@v4 - if: ${{ matrix.target == 'android' }} + - uses: ./.github/actions/flutter-test with: - java-version: '17' - distribution: 'adopt' - - # Install required dependencies for Flutter on Linux on Ubuntu - - name: 'Setup Linux' - run: | - sudo apt update - sudo apt install -y cmake dbus libblkid-dev libgtk-3-dev liblzma-dev ninja-build pkg-config xvfb libcurl4-openssl-dev - sudo apt install -y network-manager upower - if: matrix.target == 'linux' - - - uses: subosito/flutter-action@f2c4f6686ca8e8d6e6d0f28410eeef506ed66aff # pin@v2.18.0 - with: - channel: ${{ matrix.sdk }} - - - run: flutter upgrade + directory: flutter - - name: Pub Get - run: flutter pub get - - - name: Test web (JS) - if: matrix.target == 'web' - run: | - flutter test --platform chrome --test-randomize-ordering-seed=random --exclude-tags canvasKit - flutter test --platform chrome --test-randomize-ordering-seed=random --tags canvasKit - - - name: Test web (WASM) - if: matrix.target == 'web' - run: | - flutter test --platform chrome --wasm --test-randomize-ordering-seed=random --exclude-tags canvasKit - flutter test --platform chrome --wasm --test-randomize-ordering-seed=random --tags canvasKit - - - name: Test VM with coverage - if: matrix.target == 'linux' || matrix.target == 'macos' || matrix.target == 'windows' - run: | - flutter test --coverage --test-randomize-ordering-seed=random - dart run remove_from_coverage -f coverage/lcov.info -r 'binding.dart' - - - uses: codecov/codecov-action@7f8b4b4bde536c465e797be725718b88c5d95e0e # pin@v3 - if: matrix.sdk == 'stable' && matrix.target == 'linux' + - uses: ./.github/actions/coverage + if: matrix.target == 'linux' && matrix.sdk == 'stable' with: - name: sentry_flutter - file: ./flutter/coverage/lcov.info - functionalities: 'search' # remove after https://github.com/codecov/codecov-action/issues/600 token: ${{ secrets.CODECOV_TOKEN }} + directory: flutter + coverage: sentry_flutter + min-coverage: 90 - - uses: VeryGoodOpenSource/very_good_coverage@c953fca3e24a915e111cc6f55f03f756dcb3964c # pin@v3.0.0 - if: matrix.sdk == 'stable' && matrix.target == 'linux' - with: - path: './flutter/coverage/lcov.info' - min_coverage: 90 - # 'native/c' for now because we run coverage on Linux where these are not tested yet. - exclude: 'lib/src/native/cocoa/binding.dart lib/src/native/c/*' - - - name: Build ${{ matrix.target }} + - name: Build example for ${{ matrix.target }} + # The example currently doesn't support compiling for WASM. Should be OK once we add package:web in v9. + if: matrix.target != 'wasm' working-directory: flutter/example + shell: bash run: | flutter config --enable-windows-desktop flutter config --enable-macos-desktop @@ -132,7 +86,7 @@ jobs: android) flutter build appbundle ;; - web) + js) flutter build web ;; linux) diff --git a/.github/workflows/flutter_integration_test.yml b/.github/workflows/flutter_integration_test.yml deleted file mode 100644 index 1cff181e01..0000000000 --- a/.github/workflows/flutter_integration_test.yml +++ /dev/null @@ -1,119 +0,0 @@ -name: flutter integration tests -on: - # Currently broken, enable after fixing - workflow_dispatch - # push: - # branches: - # - main - # - release/** - # pull_request: - # paths-ignore: -# - 'file/**' - -jobs: - cancel-previous-workflow: - runs-on: ubuntu-latest - steps: - - name: Cancel Previous Runs - uses: styfle/cancel-workflow-action@85880fa0301c86cca9da44039ee3bb12d3bedbfa # pin@0.12.1 - with: - access_token: ${{ github.token }} - - test-android: - runs-on: macos-latest - timeout-minutes: 30 - defaults: - run: - working-directory: ./flutter/example - strategy: - fail-fast: false - matrix: - sdk: [ "stable", "beta" ] - steps: - - name: checkout - uses: actions/checkout@v4 - - - uses: actions/setup-java@v4 - with: - distribution: "adopt" - java-version: "11" - - - uses: subosito/flutter-action@f2c4f6686ca8e8d6e6d0f28410eeef506ed66aff # pin@v2.18.0 - with: - channel: ${{ matrix.sdk }} - - - name: flutter upgrade - run: flutter upgrade - - - name: flutter pub get - run: flutter pub get - - - name: Gradle cache - uses: gradle/gradle-build-action@ac2d340dc04d9e1113182899e983b5400c17cda1 # pin@v3.5.0 - - - name: AVD cache - uses: actions/cache@v4 - id: avd-cache - with: - path: | - ~/.android/avd/* - ~/.android/adb* - key: avd-21 - - - name: create AVD and generate snapshot for caching - if: steps.avd-cache.outputs.cache-hit != 'true' - uses: reactivecircus/android-emulator-runner@62dbb605bba737720e10b196cb4220d374026a6d #pin@v2.33.0 - with: - working-directory: ./flutter/example - api-level: 21 - force-avd-creation: false - emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none - disable-animations: false - arch: x86_64 - profile: Nexus 6 - script: echo 'Generated AVD snapshot for caching.' - - - name: launch android emulator & run android integration test - uses: reactivecircus/android-emulator-runner@62dbb605bba737720e10b196cb4220d374026a6d #pin@v2.33.0 - with: - working-directory: ./flutter/example - api-level: 21 - force-avd-creation: false - emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none - disable-animations: true - arch: x86_64 - profile: Nexus 6 - script: flutter test integration_test/integration_test.dart --verbose - - test-ios: - runs-on: macos-13 - 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@v4 - - - uses: subosito/flutter-action@f2c4f6686ca8e8d6e6d0f28410eeef506ed66aff # pin@v2.18.0 - with: - channel: ${{ matrix.sdk }} - - - name: flutter upgrade - run: flutter upgrade - - - name: flutter pub get - run: flutter pub get - - - name: launch ios simulator - run: | - simulator_id=$(xcrun simctl create sentryPhone com.apple.CoreSimulator.SimDeviceType.iPhone-14 com.apple.CoreSimulator.SimRuntime.iOS-16-2) - xcrun simctl boot ${simulator_id} - - - name: run ios integration test - run: flutter test integration_test/integration_test.dart --verbose diff --git a/.github/workflows/flutter_test.yml b/.github/workflows/flutter_test.yml index 3771bfb9dc..18f01bbfcc 100644 --- a/.github/workflows/flutter_test.yml +++ b/.github/workflows/flutter_test.yml @@ -6,11 +6,11 @@ on: - release/** pull_request: paths: - - "!**/*.md" - - "!**/class-diagram.svg" - - ".github/workflows/flutter_test.yml" - - "dart/**" - - "flutter/**" + - '!**/*.md' + - '!**/class-diagram.svg' + - '.github/workflows/flutter_test.yml' + - 'dart/**' + - 'flutter/**' env: SENTRY_AUTH_TOKEN_E2E: ${{ secrets.SENTRY_AUTH_TOKEN_E2E }} @@ -33,7 +33,7 @@ jobs: strategy: fail-fast: false matrix: - sdk: ["stable", "beta"] + sdk: [stable, beta] steps: - name: checkout uses: actions/checkout@v4 @@ -46,18 +46,14 @@ jobs: - uses: actions/setup-java@v4 with: - distribution: "adopt" - java-version: "17" + distribution: 'adopt' + java-version: '17' - uses: subosito/flutter-action@f2c4f6686ca8e8d6e6d0f28410eeef506ed66aff # pin@v2.18.0 with: channel: ${{ matrix.sdk }} - - name: flutter upgrade - run: flutter upgrade - - - name: flutter pub get - run: flutter pub get + - run: flutter pub get - name: Gradle cache uses: gradle/gradle-build-action@ac2d340dc04d9e1113182899e983b5400c17cda1 # pin@v3.0.0 @@ -108,7 +104,7 @@ jobs: script: flutter drive --driver=integration_test/test_driver/driver.dart --target=integration_test/sentry_widgets_flutter_binding_test.dart --profile -d emulator-5554 cocoa: - name: "${{ matrix.target }} | ${{ matrix.sdk }}" + name: '${{ matrix.target }} | ${{ matrix.sdk }}' runs-on: macos-latest-xlarge timeout-minutes: 30 defaults: @@ -117,8 +113,8 @@ jobs: strategy: fail-fast: false matrix: - sdk: ["stable", "beta"] - target: ["ios", "macos"] + target: [ios, macos] + sdk: [stable, beta] steps: - name: checkout uses: actions/checkout@v4 @@ -127,15 +123,10 @@ jobs: with: channel: ${{ matrix.sdk }} - - name: flutter upgrade - run: flutter upgrade - - - name: flutter pub get - run: flutter pub get + - run: flutter pub get - - name: pod install + - run: pod install working-directory: ./flutter/example/${{ matrix.target }} - run: pod install - name: prepare test device id: device diff --git a/.github/workflows/hive.yml b/.github/workflows/hive.yml index 9200a4ab0a..9ca8828f82 100644 --- a/.github/workflows/hive.yml +++ b/.github/workflows/hive.yml @@ -9,6 +9,9 @@ on: - '!**/*.md' - '!**/class-diagram.svg' - '.github/workflows/hive.yml' + - '.github/workflows/analyze.yml' + - '.github/actions/dart-test/**' + - '.github/actions/coverage/**' - 'dart/**' - 'hive/**' @@ -22,19 +25,15 @@ jobs: access_token: ${{ github.token }} build: - name: Build ${{matrix.sdk}} on ${{matrix.os}} - runs-on: ${{ matrix.os }} + name: '${{ matrix.os }} | ${{ matrix.sdk }}' + runs-on: ${{ matrix.os }}-latest timeout-minutes: 30 strategy: fail-fast: false matrix: - os: [ubuntu-latest, windows-latest, macos-latest] + os: [macos, ubuntu, windows] sdk: [stable, beta] - exclude: - - os: windows-latest - sdk: beta - - os: macos-latest - sdk: beta + steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/isar.yml b/.github/workflows/isar.yml index 7f666c33e4..857aa7832c 100644 --- a/.github/workflows/isar.yml +++ b/.github/workflows/isar.yml @@ -6,11 +6,14 @@ on: - release/** pull_request: paths: - - "!**/*.md" - - "!**/class-diagram.svg" - - ".github/workflows/isar.yml" - - "dart/**" - - "isar/**" + - '!**/*.md' + - '!**/class-diagram.svg' + - '.github/workflows/isar.yml' + - '.github/workflows/analyze.yml' + - '.github/actions/flutter-test/**' + - '.github/actions/coverage/**' + - 'dart/**' + - 'isar/**' jobs: cancel-previous-workflow: @@ -22,93 +25,29 @@ jobs: access_token: ${{ github.token }} build: - name: ${{ matrix.target }} | ${{ matrix.os }} | ${{ matrix.sdk }} - runs-on: ${{ matrix.os }} + name: '${{ matrix.target }} | ${{ matrix.sdk }}' + runs-on: ${{ matrix.target == 'linux' && 'ubuntu' || matrix.target }}-latest timeout-minutes: 30 - defaults: - run: - shell: bash strategy: fail-fast: false matrix: - os: [ubuntu-latest, macos-latest, windows-latest] - target: ["ios", "android", "macos", "linux", "windows"] - sdk: ["stable", "beta"] - exclude: - - os: ubuntu-latest - target: ios - - os: ubuntu-latest - target: macos - - os: ubuntu-latest - 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: linux - - os: macos-latest - target: windows - # Bad CPU type in executable - - os: macos-latest - sdk: beta - # Exclude beta for windows for now until the flutter set up action does not fail anymore - - os: windows-latest - sdk: beta + target: [macos, linux, windows] + sdk: [stable, beta] steps: - uses: actions/checkout@v4 - - uses: actions/setup-java@v4 - if: ${{ matrix.target == 'android' }} + - uses: ./.github/actions/flutter-test with: - java-version: "11" - distribution: "adopt" + directory: isar - # Install required dependencies for Flutter on Linux on Ubuntu - - name: "Setup Linux" - run: | - sudo apt update - sudo apt install -y cmake dbus libblkid-dev libgtk-3-dev liblzma-dev ninja-build pkg-config xvfb - sudo apt install -y network-manager upower - if: matrix.os == 'ubuntu-latest' && matrix.target == 'linux' - - - uses: subosito/flutter-action@f2c4f6686ca8e8d6e6d0f28410eeef506ed66aff # pin@v2.18.0 - with: - channel: ${{ matrix.sdk }} - - - run: flutter upgrade - - - name: Pub Get - run: | - cd isar - flutter pub get - - - name: Test VM with coverage - run: | - cd isar - flutter test -j 1 --coverage --test-randomize-ordering-seed=random - - - uses: codecov/codecov-action@7f8b4b4bde536c465e797be725718b88c5d95e0e # pin@v3 - if: runner.os == 'Linux' && matrix.sdk == 'stable' && matrix.target == 'linux' + - uses: ./.github/actions/coverage + if: matrix.target == 'linux' && matrix.sdk == 'stable' with: - name: sentry_isar - file: ./isar/coverage/lcov.info - functionalities: "search" # remove after https://github.com/codecov/codecov-action/issues/600 token: ${{ secrets.CODECOV_TOKEN }} - - - uses: VeryGoodOpenSource/very_good_coverage@c953fca3e24a915e111cc6f55f03f756dcb3964c # pin@v3.0.0 - if: runner.os == 'Linux' && matrix.sdk == 'stable' && matrix.target == 'linux' - with: - path: "./isar/coverage/lcov.info" - min_coverage: 55 + directory: isar + coverage: sentry_isar + min-coverage: 55 analyze: uses: ./.github/workflows/analyze.yml diff --git a/.github/workflows/logging.yml b/.github/workflows/logging.yml index 803b205dd4..f5149043f2 100644 --- a/.github/workflows/logging.yml +++ b/.github/workflows/logging.yml @@ -9,6 +9,9 @@ on: - '!**/*.md' - '!**/class-diagram.svg' - '.github/workflows/logging.yml' + - '.github/workflows/analyze.yml' + - '.github/actions/dart-test/**' + - '.github/actions/coverage/**' - 'dart/**' - 'logging/**' @@ -22,19 +25,15 @@ jobs: access_token: ${{ github.token }} build: - name: Build ${{matrix.sdk}} on ${{matrix.os}} - runs-on: ${{ matrix.os }} + name: '${{ matrix.os }} | ${{ matrix.sdk }}' + runs-on: ${{ matrix.os }}-latest timeout-minutes: 30 strategy: fail-fast: false matrix: - os: [ubuntu-latest, windows-latest, macos-latest] + os: [macos, ubuntu, windows] sdk: [stable, beta] - exclude: - - os: windows-latest - sdk: beta - - os: macos-latest - sdk: beta + steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/sqflite.yml b/.github/workflows/sqflite.yml index c16335d3cd..e1b44d618f 100644 --- a/.github/workflows/sqflite.yml +++ b/.github/workflows/sqflite.yml @@ -6,11 +6,14 @@ on: - release/** pull_request: paths: - - "!**/*.md" - - "!**/class-diagram.svg" - - ".github/workflows/logging.yml" - - "dart/**" - - "sqflite/**" + - '!**/*.md' + - '!**/class-diagram.svg' + - '.github/workflows/logging.yml' + - '.github/workflows/analyze.yml' + - '.github/actions/flutter-test/**' + - '.github/actions/coverage/**' + - 'dart/**' + - 'sqflite/**' jobs: cancel-previous-workflow: @@ -22,93 +25,29 @@ jobs: access_token: ${{ github.token }} build: - name: ${{ matrix.target }} | ${{ matrix.os }} | ${{ matrix.sdk }} - runs-on: ${{ matrix.os }} + name: '${{ matrix.target }} | ${{ matrix.sdk }}' + runs-on: ${{ matrix.target == 'linux' && 'ubuntu' || matrix.target }}-latest timeout-minutes: 30 - defaults: - run: - shell: bash strategy: fail-fast: false matrix: - os: [ubuntu-latest, windows-latest, macos-latest] - target: ["ios", "android", "macos", "linux", "windows"] - sdk: ["stable", "beta"] - exclude: - - os: ubuntu-latest - target: ios - - os: ubuntu-latest - target: macos - - os: ubuntu-latest - 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: linux - - os: macos-latest - target: windows - # Bad CPU type in executable - - os: macos-latest - sdk: beta - # Exclude beta for windows for now until the flutter set up action does not fail anymore - - os: windows-latest - sdk: beta + target: [macos, linux, windows] + sdk: [stable, beta] steps: - uses: actions/checkout@v4 - - uses: actions/setup-java@v4 - if: ${{ matrix.target == 'android' }} + - uses: ./.github/actions/flutter-test with: - java-version: "11" - distribution: "adopt" + directory: sqflite - # Install required dependencies for Flutter on Linux on Ubuntu - - name: "Setup Linux" - run: | - sudo apt update - sudo apt install -y cmake dbus libblkid-dev libgtk-3-dev liblzma-dev ninja-build pkg-config xvfb - sudo apt install -y network-manager upower - if: matrix.os == 'ubuntu-latest' && matrix.target == 'linux' - - - uses: subosito/flutter-action@f2c4f6686ca8e8d6e6d0f28410eeef506ed66aff # pin@v2.18.0 - with: - channel: ${{ matrix.sdk }} - - - run: flutter upgrade - - - name: Pub Get - run: | - cd sqflite - flutter pub get - - - name: Test VM with coverage - run: | - cd sqflite - flutter test --coverage --test-randomize-ordering-seed=random - - - uses: codecov/codecov-action@7f8b4b4bde536c465e797be725718b88c5d95e0e # pin@v3 - if: runner.os == 'Linux' && matrix.sdk == 'stable' && matrix.target == 'linux' + - uses: ./.github/actions/coverage + if: matrix.target == 'linux' && matrix.sdk == 'stable' with: - name: sentry_sqflite - file: ./sqflite/coverage/lcov.info - functionalities: "search" # remove after https://github.com/codecov/codecov-action/issues/600 token: ${{ secrets.CODECOV_TOKEN }} - - - uses: VeryGoodOpenSource/very_good_coverage@c953fca3e24a915e111cc6f55f03f756dcb3964c # pin@v3.0.0 - if: runner.os == 'Linux' && matrix.sdk == 'stable' && matrix.target == 'linux' - with: - path: "./sqflite/coverage/lcov.info" - min_coverage: 80 + directory: sqflite + coverage: sentry_sqflite + min-coverage: 80 analyze: uses: ./.github/workflows/analyze.yml diff --git a/.github/workflows/testflight.yml b/.github/workflows/testflight.yml index a8e323b090..e0dab39cc0 100644 --- a/.github/workflows/testflight.yml +++ b/.github/workflows/testflight.yml @@ -24,7 +24,6 @@ jobs: - name: flutter working-directory: ./flutter/example run: | - flutter upgrade flutter pub get flutter build ios --no-codesign --obfuscate --split-debug-info=. @@ -54,4 +53,4 @@ jobs: working-directory: ./flutter/example env: SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} - run: flutter packages pub run sentry_dart_plugin \ No newline at end of file + run: flutter packages pub run sentry_dart_plugin diff --git a/isar/.gitignore b/isar/.gitignore index fdd96ceb43..603672ed89 100644 --- a/isar/.gitignore +++ b/isar/.gitignore @@ -15,3 +15,5 @@ pubspec.lock # Downloaded on demand by tests for correct architecture. libisar.dylib +libisar.so +isar.dll