-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added a workflow for running flutter tests and uploading code coverage
- Loading branch information
1 parent
134feb4
commit 827b7d0
Showing
3 changed files
with
101 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
name: CODECOV coverage upload | ||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
test: | ||
runs-on: ubunutu-latest | ||
|
||
steps: | ||
- name: Clone repository | ||
uses: actions/checkout@v4 | ||
- name: Set up Flutter | ||
uses: subosito/flutter-action@v2 | ||
with: | ||
channel: stable | ||
flutter-version-file: pubspec.yaml | ||
|
||
- name: Cache Flutter dependancies | ||
uses: actions/cache@v3 | ||
with: | ||
path: | | ||
~./.pub-cache | ||
~./.flutter | ||
keys: ${{ runner.os }}-pub-${{ hashFiles('**/pubspec.yaml') }} | ||
restore-keys: | | ||
${{ runner.os }}-pub- | ||
- name: Install Flutter dependecies | ||
run: flutter pub get | ||
|
||
- name: Run Flutter tests | ||
run: flutter test --coverage | ||
|
||
- name: Upload coverage artifact | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: flutter-coverage-report | ||
path: coverage/lcov.info | ||
|
||
codecov: | ||
needs: test | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Download coverage artifact | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: flutter-coverage-report | ||
path: coverage | ||
|
||
- name: Upload Flutter Coverage to Codecov | ||
uses: codecov/codecov-action@v3 | ||
with: | ||
files: coverage/lcov.info | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
fail_ci_if_error: true | ||
verbose: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters