-
Notifications
You must be signed in to change notification settings - Fork 0
Add Workflows #8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
a1ad7a3
088b0b3
9629acb
9eb5e2b
c4659bb
85167df
08128dd
564d31a
2ef11a6
a640ae6
246cee2
b491a0c
dabc721
6579a64
396993a
ee3f8d3
760ae6e
5b2e4c9
b13a93a
363a031
1c190cc
e733570
f984c58
a4c1b7f
77cae0d
8390a71
d7aa669
bf44d03
3a6511d
fae73d7
af270a4
da0dcc7
ca77596
a238575
b303a95
45e8af7
40a917b
cd753b8
762e84d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
version: 2 | ||
enable-beta-ecosystems: true | ||
updates: | ||
- package-ecosystem: "pub" | ||
directory: "/" | ||
schedule: | ||
interval: "daily" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
name: Analyze | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Set up Repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Setup Dart SDK | ||
uses: dart-lang/setup-dart@v1.6.0 | ||
with: | ||
sdk: "stable" | ||
- name: Install Melos | ||
run: dart pub global activate melos | ||
|
||
- name: Install dependencies | ||
run: dart pub global run melos bootstrap | ||
|
||
- name: Analyze | ||
run: dart analyze . |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
name: Upload Coverage | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Set up Repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: List Files | ||
run: ls -R | ||
|
||
- name: Setup Dart SDK | ||
uses: dart-lang/setup-dart@v1.6.0 | ||
with: | ||
sdk: "stable" | ||
- name: Setup Flutter | ||
uses: subosito/flutter-action@v2 | ||
with: | ||
flutter-version: "3.16.0" | ||
|
||
- name: Install Melos | ||
run: dart pub global activate melos | ||
|
||
- name: Install dependencies | ||
run: melos bootstrap | ||
|
||
- name: Run unit tests | ||
run: melos run unit_test | ||
|
||
- name: Create coverage directory | ||
run: mkdir -p coverage | ||
|
||
- name: Run unit tests | ||
run: | | ||
melos exec rm -rf coverage | ||
melos run unit_test | ||
|
||
- name: Calculate and merge coverage | ||
if: success() | ||
run: | | ||
melos exec --dir-exists="coverage" -- bash -c 'dart pub global run coverde filter --input coverage/lcov.info --output coverage/filtered.lcov.info --filters .g.dart' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. please split running the tests and calculating the coverage into 2 different steps. the coverage step should check if the tests passed successfully to run. |
||
melos exec --dir-exists="coverage" -- bash -c 'dart pub global run coverde value -i coverage/filtered.lcov.info > coverage/result.txt' | ||
|
||
- name: Upload coverage to Codecov | ||
if: success() | ||
uses: codecov/codecov-action@v3 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this step should check if the coverage step is finished without errors |
||
with: | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
files: coverage/filtered.lcov.info |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,9 @@ | ||
coverage/ | ||
coverage.lcov | ||
|
||
.dart_tool | ||
/packages/*/.dart_tool | ||
/packages/*/build | ||
/packages/*/idea | ||
|
||
coverage/ | ||
*.iml | ||
.idea |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,7 @@ environment: | |
dev_dependencies: | ||
lints: ^3.0.0 | ||
test: ^1.24.0 | ||
|
||
dependencies: | ||
coverage: ^1.7.1 | ||
melos: ^3.2.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here add on pushing on the main branch.