Skip to content

Commit

Permalink
Merge branch 'main' into fix/runzoneguarded
Browse files Browse the repository at this point in the history
  • Loading branch information
buenaflor committed Jun 24, 2024
2 parents 34ea139 + 99b37a6 commit f6fa1ac
Show file tree
Hide file tree
Showing 88 changed files with 1,609 additions and 2,050 deletions.
41 changes: 41 additions & 0 deletions .github/actions/coverage/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Dart tests
description: Run Dart Tests and collect coverage
inputs:
directory:
description: The directory to run tests in
required: false
default: ''
coverage:
description: Codecov name
required: false
default: ''
min-coverage:
description: Minimum coverage percentage
required: false
default: '0'
token:
description: Codecov token
required: true

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:
name: ${{ inputs.coverage != '' }}
files: ./${{ inputs.directory }}/coverage/lcov.info
token: ${{ inputs.token }}

- uses: VeryGoodOpenSource/very_good_coverage@c953fca3e24a915e111cc6f55f03f756dcb3964c # pin@v3.0.0
if: ${{ inputs.coverage != '' }}
with:
path: './${{ inputs.directory }}/coverage/lcov.info'
min_coverage: ${{ inputs.min-coverage }}
34 changes: 34 additions & 0 deletions .github/actions/dart-test/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Dart tests
description: Run Dart tests
inputs:
directory:
description: The directory to run tests in
required: false
default: ''
web:
description: Whether to run tests for web
required: false
default: 'true'

runs:
using: composite

steps:
- uses: dart-lang/setup-dart@f0ead981b4d9a35b37f30d36160575d60931ec30 # pin@v1
with:
sdk: ${{ matrix.sdk }}

- run: dart pub get
shell: bash
working-directory: ${{ inputs.directory }}

- name: Test VM
run: dart test -p vm --coverage=coverage --test-randomize-ordering-seed=random --chain-stack-traces
shell: bash
working-directory: ${{ inputs.directory }}

- name: Test dart2js
if: ${{ inputs.web == 'true' }}
run: dart test -p chrome --test-randomize-ordering-seed=random --chain-stack-traces
shell: bash
working-directory: ${{ inputs.directory }}
48 changes: 17 additions & 31 deletions .github/workflows/dart.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ on:
- release/**
pull_request:
paths:
- "!**/*.md"
- "!**/class-diagram.svg"
- ".github/workflows/dart.yml"
- "dart/**"
- '!**/*.md'
- '!**/class-diagram.svg'
- '.github/workflows/dart.yml'
- 'dart/**'

jobs:
cancel-previous-workflow:
Expand All @@ -24,10 +24,6 @@ jobs:
name: Build ${{matrix.sdk}} on ${{matrix.os}}
runs-on: ${{ matrix.os }}
timeout-minutes: 30
defaults:
run:
shell: bash
working-directory: ./dart
strategy:
fail-fast: false
matrix:
Expand All @@ -39,47 +35,37 @@ jobs:
- os: macos-latest
sdk: beta
steps:
- uses: dart-lang/setup-dart@f0ead981b4d9a35b37f30d36160575d60931ec30 # pin@v1
with:
sdk: ${{ matrix.sdk }}
- uses: actions/checkout@v4

- name: Test (VM and browser)
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
- uses: ./.github/actions/dart-test
with:
directory: dart

- uses: ./.github/actions/coverage
if: runner.os == 'Linux' && matrix.sdk == 'stable'
with:
token: ${{ secrets.CODECOV_TOKEN }}
directory: dart
coverage: sentry
min-coverage: 85

- name: Install webdev
if: runner.os != 'Windows'
run: dart pub global activate webdev

- name: Build example
working-directory: dart/example
run: |
cd example
dart pub get
dart compile aot-snapshot bin/example.dart
- name: Build Web example
if: runner.os != 'Windows'
working-directory: dart/example_web
run: |
cd example_web
dart pub get
webdev build
- uses: codecov/codecov-action@125fc84a9a348dbcf27191600683ec096ec9021c # pin@v3
if: runner.os == 'Linux' && matrix.sdk == 'stable'
with:
name: sentry
files: ./dart/coverage/lcov.info

- uses: VeryGoodOpenSource/very_good_coverage@c953fca3e24a915e111cc6f55f03f756dcb3964c # pin@v3.0.0
if: runner.os == 'Linux' && matrix.sdk == 'stable'
with:
path: "./dart/coverage/lcov.info"
min_coverage: 85

analyze:
uses: ./.github/workflows/analyze.yml
with:
Expand Down
38 changes: 12 additions & 26 deletions .github/workflows/dio.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ on:
- release/**
pull_request:
paths:
- "!**/*.md"
- "!**/class-diagram.svg"
- ".github/workflows/dio.yml"
- "dart/**"
- "dio/**"
- '!**/*.md'
- '!**/class-diagram.svg'
- '.github/workflows/dio.yml'
- 'dart/**'
- 'dio/**'

jobs:
cancel-previous-workflow:
Expand All @@ -25,10 +25,6 @@ jobs:
name: Build ${{matrix.sdk}} on ${{matrix.os}}
runs-on: ${{ matrix.os }}
timeout-minutes: 30
defaults:
run:
shell: bash
working-directory: ./dio
strategy:
fail-fast: false
matrix:
Expand All @@ -40,29 +36,19 @@ jobs:
- os: macos-latest
sdk: beta
steps:
- uses: dart-lang/setup-dart@f0ead981b4d9a35b37f30d36160575d60931ec30 # pin@v1
with:
sdk: ${{ matrix.sdk }}
- uses: actions/checkout@v4

- name: Test (VM and browser)
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
- uses: codecov/codecov-action@125fc84a9a348dbcf27191600683ec096ec9021c # pin@v3
if: runner.os == 'Linux' && matrix.sdk == 'stable'
- uses: ./.github/actions/dart-test
with:
name: sentry_dio
files: ./dio/coverage/lcov.info
directory: dio

- uses: VeryGoodOpenSource/very_good_coverage@c953fca3e24a915e111cc6f55f03f756dcb3964c # pin@v3.0.0
- uses: ./.github/actions/coverage
if: runner.os == 'Linux' && matrix.sdk == 'stable'
with:
path: "./dio/coverage/lcov.info"
min_coverage: 81
token: ${{ secrets.CODECOV_TOKEN }}
directory: dio
coverage: sentry_dio
min-coverage: 81

analyze:
uses: ./.github/workflows/analyze.yml
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/drift.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ jobs:
# 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

steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -93,12 +96,13 @@ jobs:
cd drift
flutter test --coverage --test-randomize-ordering-seed=random
- uses: codecov/codecov-action@125fc84a9a348dbcf27191600683ec096ec9021c # pin@v3
- uses: codecov/codecov-action@e28ff129e5465c2c0dcc6f003fc735cb6ae0c673 # pin@v3
if: runner.os == 'Linux' && matrix.sdk == 'stable' && matrix.target == 'linux'
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'
Expand Down
40 changes: 14 additions & 26 deletions .github/workflows/file.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ on:
- release/**
pull_request:
paths:
- "!**/*.md"
- "!**/class-diagram.svg"
- ".github/workflows/file.yml"
- "dart/**"
- "flutter/**"
- "file/**"
- '!**/*.md'
- '!**/class-diagram.svg'
- '.github/workflows/file.yml'
- 'dart/**'
- 'flutter/**'
- 'file/**'

jobs:
cancel-previous-workflow:
Expand All @@ -26,10 +26,6 @@ jobs:
name: Build ${{matrix.sdk}} on ${{matrix.os}}
runs-on: ${{ matrix.os }}
timeout-minutes: 30
defaults:
run:
shell: bash
working-directory: ./file
strategy:
fail-fast: false
matrix:
Expand All @@ -41,28 +37,20 @@ jobs:
- os: macos-latest
sdk: beta
steps:
- uses: dart-lang/setup-dart@f0ead981b4d9a35b37f30d36160575d60931ec30 # pin@v1
with:
sdk: ${{ matrix.sdk }}
- uses: actions/checkout@v4

- name: Test VM
run: |
dart pub get
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
- uses: codecov/codecov-action@125fc84a9a348dbcf27191600683ec096ec9021c # pin@v3
if: runner.os == 'Linux' && matrix.sdk == 'stable'
- uses: ./.github/actions/dart-test
with:
name: sentry_file
files: ./file/coverage/lcov.info
directory: file
web: false

- uses: VeryGoodOpenSource/very_good_coverage@c953fca3e24a915e111cc6f55f03f756dcb3964c # pin@v3.0.0
- uses: ./.github/actions/coverage
if: runner.os == 'Linux' && matrix.sdk == 'stable'
with:
path: "./file/coverage/lcov.info"
min_coverage: 55
token: ${{ secrets.CODECOV_TOKEN }}
directory: file
coverage: sentry_file
min-coverage: 55

analyze:
uses: ./.github/workflows/analyze.yml
Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/flutter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ jobs:
os: windows
- target: web
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
Expand Down Expand Up @@ -91,7 +95,7 @@ jobs:
flutter test --coverage --test-randomize-ordering-seed=random
dart run remove_from_coverage -f coverage/lcov.info -r 'binding.dart'
- uses: codecov/codecov-action@125fc84a9a348dbcf27191600683ec096ec9021c # pin@v3
- uses: codecov/codecov-action@e28ff129e5465c2c0dcc6f003fc735cb6ae0c673 # pin@v3
if: matrix.sdk == 'stable' && matrix.target == 'linux'
with:
name: sentry_flutter
Expand Down Expand Up @@ -174,7 +178,7 @@ jobs:
- uses: actions/checkout@v4

- name: ktlint
uses: ScaCap/action-ktlint@5fdeb923cb8de70cb3ef2cfd853799d430946a5d # pin@1.8.2
uses: ScaCap/action-ktlint@7bfa4928cf705b83700c91fecc0e1a3a4c0e99ad # pin@1.8.3
with:
github_token: ${{ secrets.github_token }}
reporter: github-pr-review
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/flutter_integration_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ jobs:
run: flutter pub get

- name: Gradle cache
uses: gradle/gradle-build-action@4c39dd82cd5e1ec7c6fa0173bb41b4b6bb3b86ff # pin@v3.3.2
uses: gradle/gradle-build-action@04b20c065cf1ab708c96e64a8811018d0a1fbc88 # pin@v3.4.1

- name: AVD cache
uses: actions/cache@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/flutter_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ jobs:
run: flutter pub get

- name: Gradle cache
uses: gradle/gradle-build-action@4c39dd82cd5e1ec7c6fa0173bb41b4b6bb3b86ff # pin@v3.0.0
uses: gradle/gradle-build-action@04b20c065cf1ab708c96e64a8811018d0a1fbc88 # pin@v3.0.0

- name: AVD cache
uses: actions/cache@v4
Expand Down
Loading

0 comments on commit f6fa1ac

Please sign in to comment.