Skip to content
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

chore: Generate coverage reports and upload them. #1110

Merged
merged 25 commits into from
Jan 30, 2025
Merged
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
3bc6134
chore: Update CI to generate coverage report.
dshukertjr Jan 16, 2025
412d5fb
chore: Upload coverage results
dshukertjr Jan 17, 2025
f997258
removed unneccessary code
dshukertjr Jan 17, 2025
e3e5681
update command name
dshukertjr Jan 17, 2025
5f86150
test command
dshukertjr Jan 17, 2025
f072634
verify melos path
dshukertjr Jan 18, 2025
95d7c06
Update workflow to format and upload the report
dshukertjr Jan 19, 2025
d972f09
fix functions ci
dshukertjr Jan 19, 2025
e294550
update path of functionc ci
dshukertjr Jan 19, 2025
f0963ea
fix path for all ci
dshukertjr Jan 19, 2025
f596d43
fix: Update type for customAccessToken
dshukertjr Jan 19, 2025
50448b4
set concurrency to 1 for realtime tests
dshukertjr Jan 19, 2025
8c823e1
fix: failing realtime tests
dshukertjr Jan 19, 2025
86e378e
add stub to realtime
dshukertjr Jan 19, 2025
74f3585
more stubs
dshukertjr Jan 19, 2025
114ca0f
update analyzer check in ci
dshukertjr Jan 19, 2025
166b0f6
Run tests on every PR for every packages and upload combined coverage…
dshukertjr Jan 20, 2025
305164d
Let the coverage workflow take care of everything about test coverage
dshukertjr Jan 21, 2025
13ed886
update coverage workflow to setup test infra
dshukertjr Jan 21, 2025
165f773
add sleep after docker compose up
dshukertjr Jan 24, 2025
51ecc69
move the sleep
dshukertjr Jan 27, 2025
45a8eeb
take down docker after testing
dshukertjr Jan 29, 2025
89c9ab5
go back to the infra directory for taking down docker
dshukertjr Jan 29, 2025
00b6fce
revert changes on the individual CI files
dshukertjr Jan 29, 2025
3d044ee
Properly upload code coverage to coverall
dshukertjr Jan 30, 2025
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
Prev Previous commit
Next Next commit
Run tests on every PR for every packages and upload combined coverage…
… report
dshukertjr committed Jan 20, 2025

Verified

This commit was signed with the committer’s verified signature.
commit 166b0f6caab5a8375f1860089bb91df194a87096
52 changes: 52 additions & 0 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Combined Coverage Report

on:
workflow_run:
workflows:
- 'functions_client'
- 'gotrue'
- 'postgrest'
- 'realtime_client'
- 'storage_client'
- 'supabase'
- 'supabase_flutter'
- 'yet_another_json_isolate'
types:
- completed

jobs:
combine-coverage:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup Dart
uses: dart-lang/setup-dart@v1
with:
sdk: stable

- name: Install coverage tool
run: dart pub global activate coverage

- name: Create coverage directory
run: mkdir -p coverage

- name: Download coverage artifacts
uses: actions/download-artifact@v4
with:
pattern: coverage-flutter-*
github-token: ${{ secrets.GITHUB_TOKEN }}
run-id: ${{ github.event.workflow_run.id }}

- name: Combine coverage reports
run: |
find coverage -name "lcov.info" -exec cat {} + > coverage/combined_lcov.info

- name: Upload combined coverage to Coveralls
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: coverage/combined_lcov.info
19 changes: 6 additions & 13 deletions .github/workflows/functions_client.yml
Original file line number Diff line number Diff line change
@@ -4,16 +4,7 @@ on:
push:
branches:
- main
paths:
- 'packages/functions_client/**'
- '.github/workflows/functions_client.yml'
- 'packages/yet_another_json_isolate/**'

pull_request:
paths:
- 'packages/functions_client/**'
- '.github/workflows/functions_client.yml'
- 'packages/yet_another_json_isolate/**'

jobs:
test:
@@ -62,12 +53,14 @@ jobs:
run: dart test --coverage=./coverage

- name: Format coverage
if: ${{ matrix.sdk == 'stable'}}
run: |
dart pub global activate coverage
dart pub global run coverage:format_coverage --lcov --in="./coverage/test" --out="./coverage/lcov.info" --report-on="./lib"

- name: Upload coverage results to Coveralls
uses: coverallsapp/github-action@master
- name: Upload coverage artifact
if: ${{ matrix.sdk == 'stable'}}
uses: actions/upload-artifact@v4
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: ./packages/functions_client/coverage/lcov.info
name: coverage-flutter-functions-client
path: ./packages/functions_client/coverage/lcov.info
16 changes: 5 additions & 11 deletions .github/workflows/gotrue.yml
Original file line number Diff line number Diff line change
@@ -4,14 +4,7 @@ on:
push:
branches:
- main
paths:
- 'packages/gotrue/**'
- '.github/workflows/gotrue.yml'

pull_request:
paths:
- 'packages/gotrue/**'
- '.github/workflows/gotrue.yml'

jobs:
test:
@@ -74,8 +67,9 @@ jobs:
dart pub global activate coverage
dart pub global run coverage:format_coverage --lcov --in="./coverage/test" --out="./coverage/lcov.info" --report-on="./lib"

- name: Upload coverage results to Coveralls
uses: coverallsapp/github-action@master
- name: Upload coverage artifact
if: ${{ matrix.sdk == 'stable'}}
uses: actions/upload-artifact@v4
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: ./packages/gotrue/coverage/lcov.info
name: coverage-flutter-gotrue
path: ./packages/gotrue/coverage/lcov.info
18 changes: 5 additions & 13 deletions .github/workflows/postgrest.yml
Original file line number Diff line number Diff line change
@@ -4,16 +4,7 @@ on:
push:
branches:
- main
paths:
- 'packages/postgrest/**'
- '.github/workflows/postgrest.yml'
- 'packages/yet_another_json_isolate/**'

pull_request:
paths:
- 'packages/postgrest/**'
- '.github/workflows/postgrest.yml'
- 'packages/yet_another_json_isolate/**'

jobs:
test:
@@ -76,8 +67,9 @@ jobs:
dart pub global activate coverage
dart pub global run coverage:format_coverage --lcov --in="./coverage/test" --out="./coverage/lcov.info" --report-on="./lib"

- name: Upload coverage results to Coveralls
uses: coverallsapp/github-action@master
- name: Upload coverage artifact
if: ${{ matrix.sdk == 'stable'}}
uses: actions/upload-artifact@v4
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: ./packages/postgrest/coverage/lcov.info
name: coverage-flutter-postgrest
path: ./packages/postgrest/coverage/lcov.info
16 changes: 5 additions & 11 deletions .github/workflows/realtime_client.yml
Original file line number Diff line number Diff line change
@@ -4,14 +4,7 @@ on:
push:
branches:
- main
paths:
- 'packages/realtime_client/**'
- '.github/workflows/realtime_client.yml'

pull_request:
paths:
- 'packages/realtime_client/**'
- '.github/workflows/realtime_client.yml'

jobs:
test:
@@ -63,8 +56,9 @@ jobs:
dart pub global activate coverage
dart pub global run coverage:format_coverage --lcov --in="./coverage/test" --out="./coverage/lcov.info" --report-on="./lib"

- name: Upload coverage results to Coveralls
uses: coverallsapp/github-action@master
- name: Upload coverage artifact
if: ${{ matrix.sdk == 'stable'}}
uses: actions/upload-artifact@v4
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: ./packages/realtime_client/coverage/lcov.info
name: coverage-flutter-realtime-client
path: ./packages/realtime_client/coverage/lcov.info
15 changes: 5 additions & 10 deletions .github/workflows/storage_client.yml
Original file line number Diff line number Diff line change
@@ -4,13 +4,7 @@ on:
push:
branches:
- main
paths:
- 'packages/storage_client/**'
- '.github/workflows/storage_client.yml'
pull_request:
paths:
- 'packages/storage_client/**'
- '.github/workflows/storage_client.yml'

jobs:
test:
@@ -73,8 +67,9 @@ jobs:
dart pub global activate coverage
dart pub global run coverage:format_coverage --lcov --in="./coverage/test" --out="./coverage/lcov.info" --report-on="./lib"

- name: Upload coverage results to Coveralls
uses: coverallsapp/github-action@master
- name: Upload coverage artifact
if: ${{ matrix.sdk == 'stable'}}
uses: actions/upload-artifact@v4
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: ./packages/storage_client/coverage/lcov.info
name: coverage-flutter-storage-client
path: ./packages/storage_client/coverage/lcov.info
26 changes: 5 additions & 21 deletions .github/workflows/supabase.yml
Original file line number Diff line number Diff line change
@@ -4,24 +4,7 @@ on:
push:
branches:
- main
paths:
- 'packages/supabase/**'
- '.github/workflows/supabase.yml'
- 'packages/functions_client/**'
- 'packages/gotrue/**'
- 'packages/postgrest/**'
- 'packages/realtime_client/**'
- 'packages/storage_client/**'

pull_request:
paths:
- 'packages/supabase/**'
- '.github/workflows/supabase.yml'
- 'packages/functions_client/**'
- 'packages/gotrue/**'
- 'packages/postgrest/**'
- 'packages/realtime_client/**'
- 'packages/storage_client/**'

jobs:
test:
@@ -73,8 +56,9 @@ jobs:
dart pub global activate coverage
dart pub global run coverage:format_coverage --lcov --in="./coverage/test" --out="./coverage/lcov.info" --report-on="./lib"

- name: Upload coverage results to Coveralls
uses: coverallsapp/github-action@master
- name: Upload coverage artifact
if: ${{ matrix.sdk == 'stable'}}
uses: actions/upload-artifact@v4
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: ./packages/supabase/coverage/lcov.info
name: coverage-flutter-supabase
path: ./packages/supabase/coverage/lcov.info
30 changes: 5 additions & 25 deletions .github/workflows/supabase_flutter.yml
Original file line number Diff line number Diff line change
@@ -4,28 +4,7 @@ on:
push:
branches:
- main
paths:
- 'packages/supabase_flutter/**'
- '.github/workflows/supabase_flutter.yml'
- 'packages/functions_client/**'
- 'packages/gotrue/**'
- 'packages/postgrest/**'
- 'packages/realtime_client/**'
- 'packages/storage_client/**'
- 'packages/supabase/**'
- 'packages/yet_another_json_isolate/**'

pull_request:
paths:
- 'packages/supabase_flutter/**'
- '.github/workflows/supabase_flutter.yml'
- 'packages/functions_client/**'
- 'packages/gotrue/**'
- 'packages/postgrest/**'
- 'packages/realtime_client/**'
- 'packages/storage_client/**'
- 'packages/supabase/**'
- 'packages/yet_another_json_isolate/**'

jobs:
test:
@@ -80,8 +59,9 @@ jobs:
cd example
flutter build web

- name: Upload coverage results to Coveralls
uses: coverallsapp/github-action@master
- name: Upload coverage artifact
if: ${{ matrix.sdk == 'stable'}}
uses: actions/upload-artifact@v4
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: ./packages/supabase_flutter/coverage/lcov.info
name: coverage-flutter-supabase-flutter
path: ./packages/supabase_flutter/coverage/lcov.info
16 changes: 5 additions & 11 deletions .github/workflows/yet_another_json_isolate.yml
Original file line number Diff line number Diff line change
@@ -4,14 +4,7 @@ on:
push:
branches:
- main
paths:
- 'packages/yet_another_json_isolate/**'
- '.github/workflows/yet_another_json_isolate.yml'

pull_request:
paths:
- 'packages/yet_another_json_isolate/**'
- '.github/workflows/yet_another_json_isolate.yml'

jobs:
test:
@@ -63,8 +56,9 @@ jobs:
dart pub global activate coverage
dart pub global run coverage:format_coverage --lcov --in="./coverage/test" --out="./coverage/lcov.info" --report-on="./lib"

- name: Upload coverage results to Coveralls
uses: coverallsapp/github-action@master
- name: Upload coverage artifact
if: ${{ matrix.sdk == 'stable'}}
uses: actions/upload-artifact@v4
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: ./packages/yet_another_json_isolate/coverage/lcov.info
name: coverage-flutter-yet-another-json-isolate
path: ./packages/yet_another_json_isolate/coverage/lcov.info
3 changes: 2 additions & 1 deletion melos.yaml
Original file line number Diff line number Diff line change
@@ -39,6 +39,7 @@ scripts:
exec: dart pub outdated

update-version:
description: Updates the version.dart file for each packages except yet_another_json_isolate
run: |
# Loop through the packages directory
for d in packages/*/ ; do
@@ -53,4 +54,4 @@ scripts:
rm packages/yet_another_json_isolate/lib/src/version.dart
# Stage the version.dart file change
git add packages/*/lib/src/version.dart
description: Updates the version.dart file for each packages except yet_another_json_isolate