Skip to content

Commit

Permalink
ci: integrate Codecov coverage (#345)
Browse files Browse the repository at this point in the history
  • Loading branch information
halildurmus committed Aug 5, 2023
1 parent 9f3b4f2 commit 410bfab
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 0 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/dart_package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ on:
required: false
type: string
default: ''
upload_coverage:
required: false
type: boolean
default: false
working_directory:
required: false
type: string
Expand Down Expand Up @@ -63,3 +67,19 @@ jobs:
- name: 📒 Check API Reference Documentation
if: ${{ inputs.runs_on == 'windows-2022' }}
run: dart doc --validate-links

- name: Install coverage
if: ${{ inputs.upload_coverage && inputs.runs_on == 'windows-2022' }}
run: dart pub global activate coverage

- name: 📊 Generate Code Coverage
if: ${{ inputs.upload_coverage && inputs.runs_on == 'windows-2022' }}
run: dart pub global run coverage:test_with_coverage

- name: Upload Code Coverage Reports to Codecov
if: ${{ inputs.upload_coverage && inputs.runs_on == 'windows-2022' }}
uses: codecov/codecov-action@v3
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
files: coverage/lcov.info
1 change: 1 addition & 0 deletions .github/workflows/windows_foundation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,5 @@ jobs:
analyze_directories: example lib test
dart_sdk: ${{ matrix.sdk }}
runs_on: ${{ matrix.os }}
upload_coverage: true
working_directory: packages/windows_foundation
1 change: 1 addition & 0 deletions .github/workflows/winrtgen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,5 @@ jobs:
analyze_directories: bin example lib test
dart_sdk: ${{ matrix.sdk }}
runs_on: ${{ matrix.os }}
upload_coverage: true
working_directory: packages/winrtgen
30 changes: 30 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
coverage:
status:
project:
windows_foundation:
paths: packages/windows_foundation
winrtgen:
paths: packages/winrtgen

# exclude generated files and examples from the coverage report
ignore:
- '**/example/'
- '**/*.g.dart'
- '**/*_part.dart'
- packages/windows_ai
- packages/windows_applicationmodel
- packages/windows_data
- packages/windows_devices
- packages/windows_gaming
- packages/windows_globalization
- packages/windows_graphics
- packages/windows_management
- packages/windows_media
- packages/windows_networking
- packages/windows_perception
- packages/windows_security
- packages/windows_services
- packages/windows_storage
- packages/windows_system
- packages/windows_ui
- packages/windows_web

0 comments on commit 410bfab

Please sign in to comment.