Skip to content
This repository was archived by the owner on Apr 11, 2025. It is now read-only.

Commit 6329898

Browse files
committed
Merge remote-tracking branch 'origin/ICPFLUTTER-1065' into 8.3.0-mod
2 parents 67a0238 + d72d349 commit 6329898

File tree

333 files changed

+21058
-6727
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

333 files changed

+21058
-6727
lines changed

.craft.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
1-
minVersion: 0.29.2
1+
minVersion: 1.21.0
22
changelogPolicy: auto
33
artifactProvider:
44
name: none
55
targets:
66
- name: pub-dev
7+
# This is temporarily needed because we keep the package:web dependency implicit
8+
# See https://github.com/getsentry/sentry-dart/pull/2113 for more context
9+
skipValidation: true
710
packages:
811
dart:
912
flutter:
@@ -13,6 +16,7 @@ targets:
1316
sqflite:
1417
hive:
1518
drift:
19+
isar:
1620
- name: github
1721
- name: registry
1822
sdks:
@@ -24,3 +28,4 @@ targets:
2428
pub:sentry_sqflite:
2529
pub:sentry_drift:
2630
pub:sentry_hive:
31+
pub:sentry_isar:

.github/actions/coverage/action.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Dart tests
2+
description: Run Dart Tests and collect coverage
3+
inputs:
4+
directory:
5+
description: The directory to run tests in
6+
required: false
7+
default: ''
8+
coverage:
9+
description: Codecov name
10+
required: false
11+
default: ''
12+
min-coverage:
13+
description: Minimum coverage percentage
14+
required: false
15+
default: '0'
16+
token:
17+
description: Codecov token
18+
required: true
19+
20+
runs:
21+
using: composite
22+
23+
steps:
24+
- name: Format coverage info
25+
if: ${{ inputs.coverage != '' }}
26+
run: dart pub run coverage:format_coverage --lcov --in=coverage --out=coverage/lcov.info --packages=.dart_tool/package_config.json --report-on=lib
27+
shell: bash
28+
working-directory: ${{ inputs.directory }}
29+
30+
- uses: codecov/codecov-action@e28ff129e5465c2c0dcc6f003fc735cb6ae0c673 # pin@v3
31+
if: ${{ inputs.coverage != '' }}
32+
with:
33+
name: ${{ inputs.coverage != '' }}
34+
files: ./${{ inputs.directory }}/coverage/lcov.info
35+
token: ${{ inputs.token }}
36+
37+
- uses: VeryGoodOpenSource/very_good_coverage@c953fca3e24a915e111cc6f55f03f756dcb3964c # [email protected]
38+
if: ${{ inputs.coverage != '' }}
39+
with:
40+
path: './${{ inputs.directory }}/coverage/lcov.info'
41+
min_coverage: ${{ inputs.min-coverage }}

.github/actions/dart-test/action.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Dart tests
2+
description: Run Dart tests
3+
inputs:
4+
directory:
5+
description: The directory to run tests in
6+
required: false
7+
default: ''
8+
web:
9+
description: Whether to run tests for web
10+
required: false
11+
default: 'true'
12+
13+
runs:
14+
using: composite
15+
16+
steps:
17+
- uses: dart-lang/setup-dart@f0ead981b4d9a35b37f30d36160575d60931ec30 # pin@v1
18+
with:
19+
sdk: ${{ matrix.sdk }}
20+
21+
- run: dart pub get
22+
shell: bash
23+
working-directory: ${{ inputs.directory }}
24+
25+
- name: Test VM
26+
run: dart test -p vm ${{ (runner.os == 'Linux' && matrix.sdk == 'stable' && '--coverage=coverage') || '' }} --test-randomize-ordering-seed=random --chain-stack-traces
27+
shell: bash
28+
working-directory: ${{ inputs.directory }}
29+
30+
- name: Test dart2js
31+
if: ${{ inputs.web == 'true' }}
32+
run: dart test -p chrome --test-randomize-ordering-seed=random --chain-stack-traces
33+
shell: bash
34+
working-directory: ${{ inputs.directory }}
35+
36+
- name: Test dart2wasm
37+
if: ${{ inputs.web == 'true' && (matrix.sdk == 'stable' || matrix.sdk == 'beta') && runner.os != 'Windows' }}
38+
run: dart test -p chrome --compiler dart2wasm --test-randomize-ordering-seed=random --chain-stack-traces
39+
shell: bash
40+
working-directory: ${{ inputs.directory }}

.github/workflows/analyze.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
runs-on: ubuntu-latest
2020
steps:
2121
- name: Cancel Previous Runs
22-
uses: styfle/cancel-workflow-action@01ce38bf961b4e243a6342cbade0dbc8ba3f0432 # [email protected].0
22+
uses: styfle/cancel-workflow-action@85880fa0301c86cca9da44039ee3bb12d3bedbfa # [email protected].1
2323
with:
2424
access_token: ${{ github.token }}
2525

@@ -32,16 +32,16 @@ jobs:
3232
working-directory: ${{ inputs.package }}
3333
steps:
3434
- uses: actions/checkout@v4
35-
- uses: dart-lang/setup-dart@b64355ae6ca0b5d484f0106a033dd1388965d06d # pin@v1
35+
- uses: dart-lang/setup-dart@0a8a0fc875eb934c15d08629302413c671d3f672 # pin@v1
3636
if: ${{ inputs.sdk == 'dart' }}
37-
- uses: subosito/flutter-action@2783a3f08e1baf891508463f8c6653c258246225 # pin@v2.12.0
37+
- uses: subosito/flutter-action@44ac965b96f18d999802d4b807e3256d5a3f9fa1 # pin@v2.16.0
3838
if: ${{ inputs.sdk == 'flutter' }}
3939

4040
- run: ${{ inputs.sdk }} pub get
4141
- run: dart format --set-exit-if-changed ./
42-
42+
4343
- name: dart analyze
44-
uses: invertase/github-action-dart-analyzer@1cda5922c6369263b1c7e2fbe281f69704f4d63e # pin@v2.0.0
44+
uses: invertase/github-action-dart-analyzer@e981b01a458d0bab71ee5da182e5b26687b7101b # pin@v3.0.0
4545
with:
4646
annotate: true
4747
fatal-infos: true
@@ -56,7 +56,7 @@ jobs:
5656
# which ignores pubspec.yaml `dependency_overrides`. Because of that, all `release/*` branches are failing,
5757
# because the package cannot find the "about to be released" version of our sentry-dart package that it depends on.
5858
if: ${{ !startsWith(github.ref, 'refs/heads/release/') && inputs.panaThreshold > 0 }}
59-
runs-on: ubuntu-latest
59+
runs-on: ubuntu-20.04
6060
timeout-minutes: 20
6161
steps:
6262
- uses: actions/checkout@v4
@@ -65,7 +65,7 @@ jobs:
6565
working-directory: ${{ inputs.package }}
6666
run: |
6767
sed -i.bak 's|sentry:.*|sentry:\n path: /github/workspace/dart|g' pubspec.yaml
68-
- uses: axel-op/dart-package-analyzer@7a6c3c66bce78d82b729a1ffef2d9458fde6c8d2 # pin@v3
68+
- uses: axel-op/dart-package-analyzer@56afb7e6737bd2b7cee05382ae7f0e8111138080 # pin@v3
6969
id: analysis
7070
with:
7171
githubToken: ${{ secrets.GITHUB_TOKEN }}
@@ -78,6 +78,6 @@ jobs:
7878
PERCENTAGE=$(( $TOTAL * 100 / $TOTAL_MAX ))
7979
if (( $PERCENTAGE < ${{ inputs.panaThreshold }} ))
8080
then
81-
echo Score too low!
81+
echo "Score too low ($PERCENTAGE % is less than the expected ${{ inputs.panaThreshold }} %)!"
8282
exit 1
8383
fi

.github/workflows/dart.yml

Lines changed: 36 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -5,85 +5,67 @@ on:
55
- main
66
- release/**
77
pull_request:
8-
paths-ignore:
9-
- "**/*.md"
10-
- "logging/**"
11-
- "dio/**"
12-
- "file/**"
13-
- "sqflite/**"
14-
- "hive/**"
15-
- "drift/**"
8+
paths:
9+
- '!**/*.md'
10+
- '!**/class-diagram.svg'
11+
- '.github/workflows/dart.yml'
12+
- 'dart/**'
1613

1714
jobs:
1815
cancel-previous-workflow:
1916
runs-on: ubuntu-latest
2017
steps:
2118
- name: Cancel Previous Runs
22-
uses: styfle/cancel-workflow-action@01ce38bf961b4e243a6342cbade0dbc8ba3f0432 # [email protected].0
19+
uses: styfle/cancel-workflow-action@85880fa0301c86cca9da44039ee3bb12d3bedbfa # [email protected].1
2320
with:
2421
access_token: ${{ github.token }}
2522

2623
build:
27-
name: Build ${{matrix.sdk}} on ${{matrix.os}}
28-
runs-on: ${{ matrix.os }}
24+
name: Dart ${{matrix.sdk}} on ${{matrix.os}}
25+
runs-on: ${{ matrix.os }}-latest
2926
timeout-minutes: 30
30-
defaults:
31-
run:
32-
shell: bash
33-
working-directory: ./dart
3427
strategy:
3528
fail-fast: false
3629
matrix:
37-
os: [ubuntu-latest, windows-latest, macos-latest]
38-
sdk: [stable, beta]
39-
exclude:
40-
- os: windows-latest
41-
sdk: beta
42-
- os: macos-latest
43-
sdk: beta
30+
os: [ubuntu]
31+
sdk:
32+
- '2.18'
33+
- '2.19'
34+
- '3.0'
35+
- '3.1'
36+
- '3.2'
37+
- '3.3'
38+
- '3.4'
39+
- stable
40+
- beta
41+
include:
42+
- os: windows
43+
sdk: stable
44+
- os: macos
45+
sdk: stable
4446
steps:
45-
- uses: dart-lang/setup-dart@b64355ae6ca0b5d484f0106a033dd1388965d06d # pin@v1
46-
with:
47-
sdk: ${{ matrix.sdk }}
4847
- uses: actions/checkout@v4
4948

50-
- name: Test (VM and browser)
51-
run: |
52-
dart pub get
53-
dart test -p chrome --test-randomize-ordering-seed=random --chain-stack-traces
54-
dart test -p vm --coverage=coverage --test-randomize-ordering-seed=random --chain-stack-traces
55-
dart pub run coverage:format_coverage --lcov --in=coverage --out=coverage/lcov.info --packages=.dart_tool/package_config.json --report-on=lib
49+
- uses: ./.github/actions/dart-test
50+
with:
51+
directory: dart
5652

57-
- name: Install webdev
58-
if: runner.os != 'Windows'
59-
run: dart pub global activate webdev
53+
- uses: ./.github/actions/coverage
54+
if: runner.os == 'Linux' && matrix.sdk == 'stable'
55+
with:
56+
token: ${{ secrets.CODECOV_TOKEN }}
57+
directory: dart
58+
coverage: sentry
59+
min-coverage: 85
6060

6161
- name: Build example
62+
working-directory: dart/example
6263
run: |
63-
cd example
6464
dart pub get
6565
dart compile aot-snapshot bin/example.dart
6666
67-
- name: Build Web example
68-
if: runner.os != 'Windows'
69-
run: |
70-
cd example_web
71-
dart pub get
72-
webdev build
73-
74-
- uses: codecov/codecov-action@eaaf4bedf32dbdc6b720b63067d99c4d77d6047d # pin@v3
75-
if: runner.os == 'Linux' && matrix.sdk == 'stable'
76-
with:
77-
name: sentry
78-
files: ./dart/coverage/lcov.info
79-
80-
- uses: VeryGoodOpenSource/very_good_coverage@e5c91bc7ce9843e87c800b3bcafdfb86fbe28491 # [email protected]
81-
if: runner.os == 'Linux' && matrix.sdk == 'stable'
82-
with:
83-
path: "./dart/coverage/lcov.info"
84-
min_coverage: 85
85-
8667
analyze:
8768
uses: ./.github/workflows/analyze.yml
8869
with:
8970
package: dart
71+
panaThreshold: 87

.github/workflows/diagrams.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ jobs:
77
runs-on: ubuntu-latest
88
name: "Create class diagrams of all packages"
99
steps:
10-
- uses: dart-lang/setup-dart@b64355ae6ca0b5d484f0106a033dd1388965d06d # pin@v1
10+
- uses: dart-lang/setup-dart@0a8a0fc875eb934c15d08629302413c671d3f672 # pin@v1
1111
with:
1212
sdk: stable
1313

@@ -47,6 +47,10 @@ jobs:
4747
working-directory: ./hive
4848
run: lakos . -i "{test/**,example/**}" | dot -Tsvg -o class-diagram.svg
4949

50+
- name: isar
51+
working-directory: ./isar
52+
run: lakos . -i "{test/**,example/**}" | dot -Tsvg -o class-diagram.svg
53+
5054
# Source: https://stackoverflow.com/a/58035262
5155
- name: Extract branch name
5256
shell: bash

.github/workflows/dio.yml

Lines changed: 14 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -5,32 +5,26 @@ on:
55
- main
66
- release/**
77
pull_request:
8-
paths-ignore:
9-
- "**/*.md"
10-
- "logging/**"
11-
- "flutter/**"
12-
- "file/**"
13-
- "sqflite/**"
14-
- "hive/**"
15-
- "drift/**"
8+
paths:
9+
- '!**/*.md'
10+
- '!**/class-diagram.svg'
11+
- '.github/workflows/dio.yml'
12+
- 'dart/**'
13+
- 'dio/**'
1614

1715
jobs:
1816
cancel-previous-workflow:
1917
runs-on: ubuntu-latest
2018
steps:
2119
- name: Cancel Previous Runs
22-
uses: styfle/cancel-workflow-action@01ce38bf961b4e243a6342cbade0dbc8ba3f0432 # [email protected].0
20+
uses: styfle/cancel-workflow-action@85880fa0301c86cca9da44039ee3bb12d3bedbfa # [email protected].1
2321
with:
2422
access_token: ${{ github.token }}
2523

2624
build:
2725
name: Build ${{matrix.sdk}} on ${{matrix.os}}
2826
runs-on: ${{ matrix.os }}
2927
timeout-minutes: 30
30-
defaults:
31-
run:
32-
shell: bash
33-
working-directory: ./dio
3428
strategy:
3529
fail-fast: false
3630
matrix:
@@ -42,29 +36,19 @@ jobs:
4236
- os: macos-latest
4337
sdk: beta
4438
steps:
45-
- uses: dart-lang/setup-dart@b64355ae6ca0b5d484f0106a033dd1388965d06d # pin@v1
46-
with:
47-
sdk: ${{ matrix.sdk }}
4839
- uses: actions/checkout@v4
4940

50-
- name: Test (VM and browser)
51-
run: |
52-
dart pub get
53-
dart test -p chrome --test-randomize-ordering-seed=random --chain-stack-traces
54-
dart test -p vm --coverage=coverage --test-randomize-ordering-seed=random --chain-stack-traces
55-
dart pub run coverage:format_coverage --lcov --in=coverage --out=coverage/lcov.info --packages=.dart_tool/package_config.json --report-on=lib
56-
57-
- uses: codecov/codecov-action@eaaf4bedf32dbdc6b720b63067d99c4d77d6047d # pin@v3
58-
if: runner.os == 'Linux' && matrix.sdk == 'stable'
41+
- uses: ./.github/actions/dart-test
5942
with:
60-
name: sentry_dio
61-
files: ./dio/coverage/lcov.info
43+
directory: dio
6244

63-
- uses: VeryGoodOpenSource/very_good_coverage@e5c91bc7ce9843e87c800b3bcafdfb86fbe28491 # [email protected]
45+
- uses: ./.github/actions/coverage
6446
if: runner.os == 'Linux' && matrix.sdk == 'stable'
6547
with:
66-
path: "./dio/coverage/lcov.info"
67-
min_coverage: 81
48+
token: ${{ secrets.CODECOV_TOKEN }}
49+
directory: dio
50+
coverage: sentry_dio
51+
min-coverage: 81
6852

6953
analyze:
7054
uses: ./.github/workflows/analyze.yml

0 commit comments

Comments
 (0)