Skip to content

Commit efb44c3

Browse files
committed
Merge branch 'main' into enha/flutter-min-version-test
# Conflicts: # flutter/example/lib/main.dart
2 parents 33af637 + 25e9b59 commit efb44c3

File tree

74 files changed

+986
-294
lines changed

Some content is hidden

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

74 files changed

+986
-294
lines changed

.github/workflows/analyze.yml

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
on:
2+
workflow_call:
3+
inputs:
4+
package:
5+
required: true
6+
type: string
7+
sdk:
8+
required: false
9+
type: string
10+
default: dart
11+
panaThreshold:
12+
description: Minumum percentage of Dart Package Analyzer score that must be achieved.
13+
required: false
14+
type: number
15+
default: 100
16+
17+
jobs:
18+
cancel-previous-workflow:
19+
runs-on: ubuntu-latest
20+
steps:
21+
- name: Cancel Previous Runs
22+
uses: styfle/cancel-workflow-action@b173b6ec0100793626c2d9e6b90435061f4fc3e5 # [email protected]
23+
with:
24+
access_token: ${{ github.token }}
25+
26+
analyze:
27+
runs-on: ubuntu-latest
28+
timeout-minutes: 20
29+
defaults:
30+
run:
31+
working-directory: ${{ inputs.package }}
32+
steps:
33+
- uses: actions/checkout@v3
34+
- uses: dart-lang/setup-dart@6a218f2413a3e78e9087f638a238f6b40893203d # pin@v1
35+
if: ${{ inputs.sdk == 'dart' }}
36+
- uses: subosito/flutter-action@dbf1fa04f4d2e52c33185153d06cdb5443aa189d # pin@v2
37+
if: ${{ inputs.sdk == 'flutter' }}
38+
- run: ${{ inputs.sdk }} pub get
39+
- run: ${{ inputs.sdk }} format --set-exit-if-changed ./
40+
41+
- name: dart analyze
42+
uses: invertase/github-action-dart-analyzer@cdd8652b05bf7ed08ffce30f425436780f869f13 # pin@v1
43+
with:
44+
annotate: true
45+
fatal-infos: true
46+
fatal-warnings: true
47+
annotate-only: false
48+
working-directory: ${{ inputs.package }}
49+
50+
package-analysis:
51+
# `axel-op/dart-package-analyzer` is using `flutter pub upgrade` instead of `get`,
52+
# which ignores pubspec.yaml `dependency_overrides`. Because of that, all `release/*` branches are failing,
53+
# because the package cannot find the "about to be released" version of our sentry-dart package that it depends on.
54+
if: ${{ !startsWith(github.ref, 'refs/heads/release/') && inputs.panaThreshold > 0 }}
55+
runs-on: ubuntu-latest
56+
timeout-minutes: 20
57+
steps:
58+
- uses: actions/checkout@v3
59+
- uses: axel-op/dart-package-analyzer@7a6c3c66bce78d82b729a1ffef2d9458fde6c8d2 # pin@v3
60+
id: analysis
61+
with:
62+
githubToken: ${{ secrets.GITHUB_TOKEN }}
63+
relativePath: ${{ inputs.package }}
64+
- name: Check scores
65+
env:
66+
TOTAL: ${{ steps.analysis.outputs.total }}
67+
TOTAL_MAX: ${{ steps.analysis.outputs.total_max }}
68+
run: |
69+
PERCENTAGE=$(( $TOTAL * 100 / $TOTAL_MAX ))
70+
if (( $PERCENTAGE < ${{ inputs.panaThreshold }} ))
71+
then
72+
echo Score too low!
73+
exit 1
74+
fi

.github/workflows/dart.yml

Lines changed: 11 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,14 @@ on:
1010
- 'dio/**'
1111

1212
jobs:
13+
cancel-previous-workflow:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Cancel Previous Runs
17+
uses: styfle/cancel-workflow-action@b173b6ec0100793626c2d9e6b90435061f4fc3e5 # [email protected]
18+
with:
19+
access_token: ${{ github.token }}
20+
1321
build:
1422
name: Build ${{matrix.sdk}} on ${{matrix.os}}
1523
runs-on: ${{ matrix.os }}
@@ -70,39 +78,6 @@ jobs:
7078
min_coverage: 85
7179

7280
analyze:
73-
runs-on: ubuntu-latest
74-
timeout-minutes: 20
75-
defaults:
76-
run:
77-
working-directory: ./dart
78-
steps:
79-
- uses: dart-lang/setup-dart@6a218f2413a3e78e9087f638a238f6b40893203d # pin@v1
80-
with:
81-
sdk: stable
82-
- uses: actions/checkout@v3
83-
- run: |
84-
dart pub get
85-
dart analyze --fatal-infos
86-
dart format --set-exit-if-changed ./
87-
88-
package-analysis:
89-
runs-on: ubuntu-latest
90-
timeout-minutes: 20
91-
steps:
92-
- uses: actions/checkout@v3
93-
- uses: axel-op/dart-package-analyzer@7a6c3c66bce78d82b729a1ffef2d9458fde6c8d2 # pin@v3
94-
id: analysis
95-
with:
96-
githubToken: ${{ secrets.GITHUB_TOKEN }}
97-
relativePath: dart/
98-
- name: Check scores
99-
env:
100-
TOTAL: ${{ steps.analysis.outputs.total }}
101-
TOTAL_MAX: ${{ steps.analysis.outputs.total_max }}
102-
run: |
103-
PERCENTAGE=$(( $TOTAL * 100 / $TOTAL_MAX ))
104-
if (( $PERCENTAGE < 90 ))
105-
then
106-
echo Score too low!
107-
exit 1
108-
fi
81+
uses: ./.github/workflows/analyze.yml
82+
with:
83+
package: dart

.github/workflows/dio.yml

Lines changed: 11 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,14 @@ on:
1010
- 'flutter/**'
1111

1212
jobs:
13+
cancel-previous-workflow:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Cancel Previous Runs
17+
uses: styfle/cancel-workflow-action@b173b6ec0100793626c2d9e6b90435061f4fc3e5 # [email protected]
18+
with:
19+
access_token: ${{ github.token }}
20+
1321
build:
1422
name: Build ${{matrix.sdk}} on ${{matrix.os}}
1523
runs-on: ${{ matrix.os }}
@@ -52,43 +60,6 @@ jobs:
5260
min_coverage: 81
5361

5462
analyze:
55-
runs-on: ubuntu-latest
56-
timeout-minutes: 20
57-
defaults:
58-
run:
59-
working-directory: ./dio
60-
steps:
61-
- uses: dart-lang/setup-dart@6a218f2413a3e78e9087f638a238f6b40893203d # pin@v1
62-
with:
63-
sdk: stable
64-
- uses: actions/checkout@v3
65-
- run: |
66-
dart pub get
67-
dart analyze --fatal-infos
68-
dart format --set-exit-if-changed ./
69-
70-
package-analysis:
71-
# `axel-op/dart-package-analyzer` is using `flutter pub upgrade` instead of `get`,
72-
# which ignores pubspec.yaml `dependency_overrides`. Because of that, all `release/*` branches are failing,
73-
# because the package cannot find the "about to be released" version of our sentry-dart package that it depends on.
74-
if: ${{ !startsWith(github.ref, 'refs/heads/release/') }}
75-
runs-on: ubuntu-latest
76-
timeout-minutes: 20
77-
steps:
78-
- uses: actions/checkout@v3
79-
- uses: axel-op/dart-package-analyzer@7a6c3c66bce78d82b729a1ffef2d9458fde6c8d2 # pin@v3
80-
id: analysis
81-
with:
82-
githubToken: ${{ secrets.GITHUB_TOKEN }}
83-
relativePath: dio/
84-
- name: Check scores
85-
env:
86-
TOTAL: ${{ steps.analysis.outputs.total }}
87-
TOTAL_MAX: ${{ steps.analysis.outputs.total_max }}
88-
run: |
89-
PERCENTAGE=$(( $TOTAL * 100 / $TOTAL_MAX ))
90-
if (( $PERCENTAGE < 75 ))
91-
then
92-
echo Score too low!
93-
exit 1
94-
fi
63+
uses: ./.github/workflows/analyze.yml
64+
with:
65+
package: dio

.github/workflows/e2e_dart.yml

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,14 @@ env:
1515
SENTRY_DIST: 1
1616

1717
jobs:
18+
cancel-previous-workflow:
19+
runs-on: ubuntu-latest
20+
steps:
21+
- name: Cancel Previous Runs
22+
uses: styfle/cancel-workflow-action@b173b6ec0100793626c2d9e6b90435061f4fc3e5 # [email protected]
23+
with:
24+
access_token: ${{ github.token }}
25+
1826
build:
1927
name: E2E
2028
runs-on: 'ubuntu-latest'
@@ -37,17 +45,7 @@ jobs:
3745
dart run --define=SENTRY_ENVIRONMENT=e2e
3846
3947
analyze:
40-
runs-on: ubuntu-latest
41-
timeout-minutes: 20
42-
defaults:
43-
run:
44-
working-directory: ./e2e_test
45-
steps:
46-
- uses: dart-lang/setup-dart@6a218f2413a3e78e9087f638a238f6b40893203d # pin@v1
47-
with:
48-
sdk: stable
49-
- uses: actions/checkout@v3
50-
- run: |
51-
dart pub get
52-
dart analyze --fatal-infos
53-
dart format --set-exit-if-changed ./
48+
uses: ./.github/workflows/analyze.yml
49+
with:
50+
package: e2e_test
51+
panaThreshold: 0

.github/workflows/flutter.yml

Lines changed: 15 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,14 @@ on:
1010
- 'dio/**'
1111

1212
jobs:
13+
cancel-previous-workflow:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Cancel Previous Runs
17+
uses: styfle/cancel-workflow-action@b173b6ec0100793626c2d9e6b90435061f4fc3e5 # [email protected]
18+
with:
19+
access_token: ${{ github.token }}
20+
1321
build:
1422
name: ${{ matrix.target }} | ${{ matrix.os }} | ${{ matrix.sdk }}
1523
runs-on: ${{ matrix.os }}
@@ -66,7 +74,7 @@ jobs:
6674
sudo apt install -y network-manager upower
6775
if: matrix.os == 'ubuntu-latest'
6876

69-
- uses: subosito/flutter-action@1e6ee87cb840500837bcd50a667fb28815d8e310 # pin@v2
77+
- uses: subosito/flutter-action@dbf1fa04f4d2e52c33185153d06cdb5443aa189d # pin@v2
7078
with:
7179
channel: ${{ matrix.sdk }}
7280

@@ -81,7 +89,8 @@ jobs:
8189
if: runner.os == 'Linux'
8290
run: |
8391
cd flutter
84-
flutter test --platform chrome --test-randomize-ordering-seed=random
92+
flutter test --platform chrome --test-randomize-ordering-seed=random --exclude-tags canvasKit
93+
flutter test --platform chrome --test-randomize-ordering-seed=random --tags canvasKit --web-renderer canvaskit
8594
8695
- name: Test VM with coverage
8796
if: runner.os != 'macOS'
@@ -132,42 +141,10 @@ jobs:
132141
esac
133142
134143
analyze:
135-
runs-on: ubuntu-latest
136-
timeout-minutes: 20
137-
steps:
138-
- uses: actions/checkout@v3
139-
- uses: subosito/flutter-action@1e6ee87cb840500837bcd50a667fb28815d8e310 # pin@v2
140-
- run: |
141-
cd flutter
142-
flutter pub get
143-
flutter format -n --set-exit-if-changed ./
144-
flutter analyze
145-
146-
package-analysis:
147-
# `axel-op/dart-package-analyzer` is using `flutter pub upgrade` instead of `get`,
148-
# which ignores pubspec.yaml `dependency_overrides`. Because of that, all `release/*` branches are failing,
149-
# because the package cannot find the "about to be released" version of our sentry-dart package that it depends on.
150-
if: ${{ !startsWith(github.ref, 'refs/heads/release/') }}
151-
runs-on: ubuntu-latest
152-
timeout-minutes: 20
153-
steps:
154-
- uses: actions/checkout@v3
155-
- uses: axel-op/dart-package-analyzer@7a6c3c66bce78d82b729a1ffef2d9458fde6c8d2 # pin@v3
156-
id: analysis
157-
with:
158-
githubToken: ${{ secrets.GITHUB_TOKEN }}
159-
relativePath: flutter/
160-
- name: Check scores
161-
env:
162-
TOTAL: ${{ steps.analysis.outputs.total }}
163-
TOTAL_MAX: ${{ steps.analysis.outputs.total_max }}
164-
run: |
165-
PERCENTAGE=$(( $TOTAL * 100 / $TOTAL_MAX ))
166-
if (( $PERCENTAGE < 90 ))
167-
then
168-
echo Score too low!
169-
exit 1
170-
fi
144+
uses: ./.github/workflows/analyze.yml
145+
with:
146+
package: flutter
147+
sdk: flutter
171148

172149
pod-lint:
173150
runs-on: macos-latest

.github/workflows/logging.yml

Lines changed: 11 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,14 @@ on:
1010
- 'flutter/**'
1111

1212
jobs:
13+
cancel-previous-workflow:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Cancel Previous Runs
17+
uses: styfle/cancel-workflow-action@b173b6ec0100793626c2d9e6b90435061f4fc3e5 # [email protected]
18+
with:
19+
access_token: ${{ github.token }}
20+
1321
build:
1422
name: Build ${{matrix.sdk}} on ${{matrix.os}}
1523
runs-on: ${{ matrix.os }}
@@ -51,43 +59,6 @@ jobs:
5159
min_coverage: 90
5260

5361
analyze:
54-
runs-on: ubuntu-latest
55-
timeout-minutes: 20
56-
defaults:
57-
run:
58-
working-directory: ./logging
59-
steps:
60-
- uses: dart-lang/setup-dart@6a218f2413a3e78e9087f638a238f6b40893203d # pin@v1
61-
with:
62-
sdk: stable
63-
- uses: actions/checkout@v3
64-
- run: |
65-
dart pub get
66-
dart analyze --fatal-infos
67-
dart format --set-exit-if-changed ./
68-
69-
package-analysis:
70-
# `axel-op/dart-package-analyzer` is using `flutter pub upgrade` instead of `get`,
71-
# which ignores pubspec.yaml `dependency_overrides`. Because of that, all `release/*` branches are failing,
72-
# because the package cannot find the "about to be released" version of our sentry-dart package that it depends on.
73-
if: ${{ !startsWith(github.ref, 'refs/heads/release/') }}
74-
runs-on: ubuntu-latest
75-
timeout-minutes: 20
76-
steps:
77-
- uses: actions/checkout@v3
78-
- uses: axel-op/dart-package-analyzer@7a6c3c66bce78d82b729a1ffef2d9458fde6c8d2 # pin@v3
79-
id: analysis
80-
with:
81-
githubToken: ${{ secrets.GITHUB_TOKEN }}
82-
relativePath: logging/
83-
- name: Check scores
84-
env:
85-
TOTAL: ${{ steps.analysis.outputs.total }}
86-
TOTAL_MAX: ${{ steps.analysis.outputs.total_max }}
87-
run: |
88-
PERCENTAGE=$(( $TOTAL * 100 / $TOTAL_MAX ))
89-
if (( $PERCENTAGE < 100 ))
90-
then
91-
echo Score too low!
92-
exit 1
93-
fi
62+
uses: ./.github/workflows/analyze.yml
63+
with:
64+
package: logging

0 commit comments

Comments
 (0)