Skip to content
Merged
Show file tree
Hide file tree
Changes from 11 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
73 changes: 73 additions & 0 deletions .github/workflows/dart.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: Dart
on:
push:
branches:
- main
pull_request:
defaults:
run:
shell: bash
jobs:
build:
name: Build ${{matrix.sdk}} on ${{matrix.os}}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
# TODO: cedx/setup-dart@v2 doesn't work on Windows (doesn't add pub to the PATH?)
# os: [ubuntu-latest, windows-latest, macos-latest]
os: [ubuntu-latest, macos-latest]
sdk: [beta, dev, stable]
exclude:
# Bad state: Could not run tests with Observatory enabled. Try setting a different port with --port option.
- os: ubuntu-latest
sdk: beta
# hanging often
- os: ubuntu-latest
sdk: dev
- os: macos-latest
sdk: beta
steps:
- uses: cedx/setup-dart@v2
with:
release-channel: ${{ matrix.sdk }}
- uses: actions/checkout@v2
- run: |
cd dart
pub get
- name: Test on Dart VM and collect code coverage
run: |
cd dart
pub run test_coverage
- uses: codecov/codecov-action@v1
- name: Test on Chrome
run: |
cd dart
pub run test -p vm test/*
- run: |
cd dart
dartanalyzer --fatal-warnings ./
- run: |
cd dart
dartfmt -n --set-exit-if-changed ./
package-analysis:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: axel-op/dart-package-analyzer@v3
id: analysis
with:
githubToken: ${{ secrets.GITHUB_TOKEN }}
relativePath: dart/
- name: Check scores
env:
TOTAL: ${{ steps.analysis.outputs.total }}
TOTAL_MAX: ${{ steps.analysis.outputs.total_max }}
# TODO: Once 4.0.0 lands, change to 100
run: |
PERCENTAGE=$(( $TOTAL * 100 / $TOTAL_MAX ))
if (( $PERCENTAGE < 90 ))
then
echo Score too low!
exit 1
fi
5 changes: 2 additions & 3 deletions .github/workflows/flutter.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Flutter
name: sentry-flutter
on:
push:
branches:
Expand Down Expand Up @@ -75,10 +75,9 @@ jobs:
env:
TOTAL: ${{ steps.analysis.outputs.total }}
TOTAL_MAX: ${{ steps.analysis.outputs.total_max }}
# TODO: Once 1.0.0 lands, change to 100
run: |
PERCENTAGE=$(( $TOTAL * 100 / $TOTAL_MAX ))
if (( $PERCENTAGE < 95 ))
if (( $PERCENTAGE < 90 ))
then
echo Score too low!
exit 1
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,5 @@ android/
ios/
build/
.cxx/

.test_coverage.dart
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
- remove the `package:args` dependency #94
- move the `package:pedantic` to dev depencies #94
- Added GH Action Changelog verifier #95
- Added GH Action (CI) for Dart
- new Dart code file structure #96
- Base the sdk name on the platform (`sentry.dart` for io & flutter, `sentry.dart.browser` in a browser context) #103

Expand Down
1 change: 1 addition & 0 deletions dart/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,4 @@ dev_dependencies:
pedantic: ^1.9.2
test: ^1.15.4
yaml: ^2.2.1
test_coverage: ^0.4.2