Skip to content

Commit 31bac33

Browse files
committed
Merge branch 'main' into package-web
2 parents 99391f4 + f3c5f6b commit 31bac33

File tree

7 files changed

+135
-134
lines changed

7 files changed

+135
-134
lines changed
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
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+
17+
runs:
18+
using: composite
19+
20+
steps:
21+
- name: Format coverage info
22+
if: ${{ inputs.coverage != '' }}
23+
run: dart pub run coverage:format_coverage --lcov --in=coverage --out=coverage/lcov.info --packages=.dart_tool/package_config.json --report-on=lib
24+
shell: bash
25+
working-directory: ${{ inputs.directory }}
26+
27+
- uses: codecov/codecov-action@e28ff129e5465c2c0dcc6f003fc735cb6ae0c673 # pin@v3
28+
if: ${{ inputs.coverage != '' }}
29+
with:
30+
name: ${{ inputs.coverage != '' }}
31+
files: ./${{ inputs.directory }}/coverage/lcov.info
32+
33+
- uses: VeryGoodOpenSource/very_good_coverage@c953fca3e24a915e111cc6f55f03f756dcb3964c # [email protected]
34+
if: ${{ inputs.coverage != '' }}
35+
with:
36+
path: './${{ inputs.directory }}/coverage/lcov.info'
37+
min_coverage: ${{ inputs.min-coverage }}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
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 --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 }}

.github/workflows/dart.yml

Lines changed: 16 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ on:
66
- release/**
77
pull_request:
88
paths:
9-
- "!**/*.md"
10-
- "!**/class-diagram.svg"
11-
- ".github/workflows/dart.yml"
12-
- "dart/**"
9+
- '!**/*.md'
10+
- '!**/class-diagram.svg'
11+
- '.github/workflows/dart.yml'
12+
- 'dart/**'
1313

1414
jobs:
1515
cancel-previous-workflow:
@@ -24,10 +24,6 @@ jobs:
2424
name: Build ${{matrix.sdk}} on ${{matrix.os}}
2525
runs-on: ${{ matrix.os }}
2626
timeout-minutes: 30
27-
defaults:
28-
run:
29-
shell: bash
30-
working-directory: ./dart
3127
strategy:
3228
fail-fast: false
3329
matrix:
@@ -39,47 +35,36 @@ jobs:
3935
- os: macos-latest
4036
sdk: beta
4137
steps:
42-
- uses: dart-lang/setup-dart@f0ead981b4d9a35b37f30d36160575d60931ec30 # pin@v1
43-
with:
44-
sdk: ${{ matrix.sdk }}
4538
- uses: actions/checkout@v4
4639

47-
- name: Test (VM and browser)
48-
run: |
49-
dart pub get
50-
dart test -p chrome --test-randomize-ordering-seed=random --chain-stack-traces
51-
dart test -p vm --coverage=coverage --test-randomize-ordering-seed=random --chain-stack-traces
52-
dart pub run coverage:format_coverage --lcov --in=coverage --out=coverage/lcov.info --packages=.dart_tool/package_config.json --report-on=lib
40+
- uses: ./.github/actions/dart-test
41+
with:
42+
directory: dart
43+
44+
- uses: ./.github/actions/coverage
45+
if: runner.os == 'Linux' && matrix.sdk == 'stable'
46+
with:
47+
directory: dart
48+
coverage: sentry
49+
min-coverage: 85
5350

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

5855
- name: Build example
56+
working-directory: dart/example
5957
run: |
60-
cd example
6158
dart pub get
6259
dart compile aot-snapshot bin/example.dart
6360
6461
- name: Build Web example
6562
if: runner.os != 'Windows'
63+
working-directory: dart/example_web
6664
run: |
67-
cd example_web
6865
dart pub get
6966
webdev build
7067
71-
- uses: codecov/codecov-action@e28ff129e5465c2c0dcc6f003fc735cb6ae0c673 # pin@v3
72-
if: runner.os == 'Linux' && matrix.sdk == 'stable'
73-
with:
74-
name: sentry
75-
files: ./dart/coverage/lcov.info
76-
77-
- uses: VeryGoodOpenSource/very_good_coverage@c953fca3e24a915e111cc6f55f03f756dcb3964c # [email protected]
78-
if: runner.os == 'Linux' && matrix.sdk == 'stable'
79-
with:
80-
path: "./dart/coverage/lcov.info"
81-
min_coverage: 85
82-
8368
analyze:
8469
uses: ./.github/workflows/analyze.yml
8570
with:

.github/workflows/dio.yml

Lines changed: 11 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ on:
66
- release/**
77
pull_request:
88
paths:
9-
- "!**/*.md"
10-
- "!**/class-diagram.svg"
11-
- ".github/workflows/dio.yml"
12-
- "dart/**"
13-
- "dio/**"
9+
- '!**/*.md'
10+
- '!**/class-diagram.svg'
11+
- '.github/workflows/dio.yml'
12+
- 'dart/**'
13+
- 'dio/**'
1414

1515
jobs:
1616
cancel-previous-workflow:
@@ -25,10 +25,6 @@ jobs:
2525
name: Build ${{matrix.sdk}} on ${{matrix.os}}
2626
runs-on: ${{ matrix.os }}
2727
timeout-minutes: 30
28-
defaults:
29-
run:
30-
shell: bash
31-
working-directory: ./dio
3228
strategy:
3329
fail-fast: false
3430
matrix:
@@ -40,29 +36,18 @@ jobs:
4036
- os: macos-latest
4137
sdk: beta
4238
steps:
43-
- uses: dart-lang/setup-dart@f0ead981b4d9a35b37f30d36160575d60931ec30 # pin@v1
44-
with:
45-
sdk: ${{ matrix.sdk }}
4639
- uses: actions/checkout@v4
4740

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

61-
- uses: VeryGoodOpenSource/very_good_coverage@c953fca3e24a915e111cc6f55f03f756dcb3964c # [email protected]
45+
- uses: ./.github/actions/coverage
6246
if: runner.os == 'Linux' && matrix.sdk == 'stable'
6347
with:
64-
path: "./dio/coverage/lcov.info"
65-
min_coverage: 81
48+
directory: dio
49+
coverage: sentry_dio
50+
min-coverage: 81
6651

6752
analyze:
6853
uses: ./.github/workflows/analyze.yml

.github/workflows/file.yml

Lines changed: 13 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ on:
66
- release/**
77
pull_request:
88
paths:
9-
- "!**/*.md"
10-
- "!**/class-diagram.svg"
11-
- ".github/workflows/file.yml"
12-
- "dart/**"
13-
- "flutter/**"
14-
- "file/**"
9+
- '!**/*.md'
10+
- '!**/class-diagram.svg'
11+
- '.github/workflows/file.yml'
12+
- 'dart/**'
13+
- 'flutter/**'
14+
- 'file/**'
1515

1616
jobs:
1717
cancel-previous-workflow:
@@ -26,10 +26,6 @@ jobs:
2626
name: Build ${{matrix.sdk}} on ${{matrix.os}}
2727
runs-on: ${{ matrix.os }}
2828
timeout-minutes: 30
29-
defaults:
30-
run:
31-
shell: bash
32-
working-directory: ./file
3329
strategy:
3430
fail-fast: false
3531
matrix:
@@ -41,28 +37,19 @@ jobs:
4137
- os: macos-latest
4238
sdk: beta
4339
steps:
44-
- uses: dart-lang/setup-dart@f0ead981b4d9a35b37f30d36160575d60931ec30 # pin@v1
45-
with:
46-
sdk: ${{ matrix.sdk }}
4740
- uses: actions/checkout@v4
4841

49-
- name: Test VM
50-
run: |
51-
dart pub get
52-
dart test -p vm --coverage=coverage --test-randomize-ordering-seed=random --chain-stack-traces
53-
dart pub run coverage:format_coverage --lcov --in=coverage --out=coverage/lcov.info --packages=.dart_tool/package_config.json --report-on=lib
54-
55-
- uses: codecov/codecov-action@e28ff129e5465c2c0dcc6f003fc735cb6ae0c673 # pin@v3
56-
if: runner.os == 'Linux' && matrix.sdk == 'stable'
42+
- uses: ./.github/actions/dart-test
5743
with:
58-
name: sentry_file
59-
files: ./file/coverage/lcov.info
44+
directory: file
45+
web: false
6046

61-
- uses: VeryGoodOpenSource/very_good_coverage@c953fca3e24a915e111cc6f55f03f756dcb3964c # [email protected]
47+
- uses: ./.github/actions/coverage
6248
if: runner.os == 'Linux' && matrix.sdk == 'stable'
6349
with:
64-
path: "./file/coverage/lcov.info"
65-
min_coverage: 55
50+
directory: file
51+
coverage: sentry_file
52+
min-coverage: 55
6653

6754
analyze:
6855
uses: ./.github/workflows/analyze.yml

.github/workflows/hive.yml

Lines changed: 12 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ on:
66
- release/**
77
pull_request:
88
paths:
9-
- "!**/*.md"
10-
- "!**/class-diagram.svg"
11-
- ".github/workflows/hive.yml"
12-
- "dart/**"
13-
- "hive/**"
9+
- '!**/*.md'
10+
- '!**/class-diagram.svg'
11+
- '.github/workflows/hive.yml'
12+
- 'dart/**'
13+
- 'hive/**'
1414

1515
jobs:
1616
cancel-previous-workflow:
@@ -25,10 +25,6 @@ jobs:
2525
name: Build ${{matrix.sdk}} on ${{matrix.os}}
2626
runs-on: ${{ matrix.os }}
2727
timeout-minutes: 30
28-
defaults:
29-
run:
30-
shell: bash
31-
working-directory: ./hive
3228
strategy:
3329
fail-fast: false
3430
matrix:
@@ -40,28 +36,19 @@ jobs:
4036
- os: macos-latest
4137
sdk: beta
4238
steps:
43-
- uses: dart-lang/setup-dart@f0ead981b4d9a35b37f30d36160575d60931ec30 # pin@v1
44-
with:
45-
sdk: ${{ matrix.sdk }}
4639
- uses: actions/checkout@v4
4740

48-
- name: Test VM
49-
run: |
50-
dart pub get
51-
dart test -p vm --coverage=coverage --test-randomize-ordering-seed=random --chain-stack-traces
52-
dart pub run coverage:format_coverage --lcov --in=coverage --out=coverage/lcov.info --packages=.dart_tool/package_config.json --report-on=lib
53-
54-
- uses: codecov/codecov-action@e28ff129e5465c2c0dcc6f003fc735cb6ae0c673 # pin@v3
55-
if: runner.os == 'Linux' && matrix.sdk == 'stable'
41+
- uses: ./.github/actions/dart-test
5642
with:
57-
name: sentry_hive
58-
files: ./hive/coverage/lcov.info
43+
directory: hive
44+
web: false
5945

60-
- uses: VeryGoodOpenSource/very_good_coverage@c953fca3e24a915e111cc6f55f03f756dcb3964c # [email protected]
46+
- uses: ./.github/actions/coverage
6147
if: runner.os == 'Linux' && matrix.sdk == 'stable'
6248
with:
63-
path: "./hive/coverage/lcov.info"
64-
min_coverage: 55
49+
directory: hive
50+
coverage: sentry_hive
51+
min-coverage: 55
6552

6653
analyze:
6754
uses: ./.github/workflows/analyze.yml

0 commit comments

Comments
 (0)