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

Open
wants to merge 17 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all 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
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
29 changes: 19 additions & 10 deletions .github/workflows/functions_client.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -51,7 +42,25 @@ jobs:
run: dart format lib test -l 80 --set-exit-if-changed

- name: analyzer
if: ${{ matrix.sdk == 'stable'}}
run: dart analyze --fatal-warnings --fatal-infos .

- name: analyzer
if: ${{ matrix.sdk == 'beta' || matrix.sdk == 'dev' }}
run: dart analyze

- name: Run tests
run: dart test
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 artifact
if: ${{ matrix.sdk == 'stable'}}
uses: actions/upload-artifact@v4
with:
name: coverage-flutter-functions-client
path: ./packages/functions_client/coverage/lcov.info
26 changes: 18 additions & 8 deletions .github/workflows/gotrue.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -48,8 +41,13 @@ jobs:
run: dart format lib test -l 80 --set-exit-if-changed

- name: analyzer
if: ${{ matrix.sdk == 'stable'}}
run: dart analyze --fatal-warnings --fatal-infos .

- name: analyzer
if: ${{ matrix.sdk == 'beta' || matrix.sdk == 'dev' }}
run: dart analyze

- name: Build Docker image
run: |
cd ../../infra/gotrue
Expand All @@ -62,4 +60,16 @@ jobs:
time: '5s'

- name: Run tests
run: dart test --concurrency=1
run: dart test --concurrency=1 --coverage=./coverage

- name: Format coverage
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 artifact
if: ${{ matrix.sdk == 'stable'}}
uses: actions/upload-artifact@v4
with:
name: coverage-flutter-gotrue
path: ./packages/gotrue/coverage/lcov.info
28 changes: 18 additions & 10 deletions .github/workflows/postgrest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -50,8 +41,13 @@ jobs:
run: dart format lib test -l 80 --set-exit-if-changed

- name: analyzer
if: ${{ matrix.sdk == 'stable'}}
run: dart analyze --fatal-warnings --fatal-infos .

- name: analyzer
if: ${{ matrix.sdk == 'beta' || matrix.sdk == 'dev' }}
run: dart analyze

- name: Build Docker image
run: |
cd ../../infra/postgrest
Expand All @@ -64,4 +60,16 @@ jobs:
time: '5s'

- name: Run tests
run: dart test --concurrency=1
run: dart test --concurrency=1 --coverage=./coverage

- name: Format coverage
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 artifact
if: ${{ matrix.sdk == 'stable'}}
uses: actions/upload-artifact@v4
with:
name: coverage-flutter-postgrest
path: ./packages/postgrest/coverage/lcov.info
26 changes: 18 additions & 8 deletions .github/workflows/realtime_client.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -48,7 +41,24 @@ jobs:
run: dart format lib test -l 80 --set-exit-if-changed

- name: analyzer
if: ${{ matrix.sdk == 'stable'}}
run: dart analyze --fatal-warnings --fatal-infos .

- name: analyzer
if: ${{ matrix.sdk == 'beta' || matrix.sdk == 'dev' }}
run: dart analyze

- name: Run tests
run: dart test
run: dart test --concurrency=1 --coverage=./coverage

- name: Format coverage
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 artifact
if: ${{ matrix.sdk == 'stable'}}
uses: actions/upload-artifact@v4
with:
name: coverage-flutter-realtime-client
path: ./packages/realtime_client/coverage/lcov.info
25 changes: 18 additions & 7 deletions .github/workflows/storage_client.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -47,8 +41,13 @@ jobs:
run: dart format lib test -l 80 --set-exit-if-changed

- name: analyzer
if: ${{ matrix.sdk == 'stable'}}
run: dart analyze --fatal-warnings --fatal-infos .

- name: analyzer
if: ${{ matrix.sdk == 'beta' || matrix.sdk == 'dev' }}
run: dart analyze

- name: Build Docker image
run: |
cd ../../infra/storage_client
Expand All @@ -61,4 +60,16 @@ jobs:
time: '5s'

- name: Run tests
run: dart test
run: dart test --coverage=./coverage

- name: Format coverage
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 artifact
if: ${{ matrix.sdk == 'stable'}}
uses: actions/upload-artifact@v4
with:
name: coverage-flutter-storage-client
path: ./packages/storage_client/coverage/lcov.info
36 changes: 18 additions & 18 deletions .github/workflows/supabase.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -58,7 +41,24 @@ jobs:
run: dart format lib test -l 80 --set-exit-if-changed

- name: analyzer
if: ${{ matrix.sdk == 'stable'}}
run: dart analyze --fatal-warnings --fatal-infos .

- name: analyzer
if: ${{ matrix.sdk == 'beta' || matrix.sdk == 'dev' }}
run: dart analyze

- name: Run tests
run: dart test --concurrency=1
run: dart test --concurrency=1 --coverage=./coverage

- name: Format coverage
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 artifact
if: ${{ matrix.sdk == 'stable'}}
uses: actions/upload-artifact@v4
with:
name: coverage-flutter-supabase
path: ./packages/supabase/coverage/lcov.info
30 changes: 8 additions & 22 deletions .github/workflows/supabase_flutter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -68,7 +47,7 @@ jobs:
run: flutter analyze --fatal-warnings --fatal-infos .

- name: Run tests
run: flutter test --concurrency=1
run: flutter test --concurrency=1 --coverage

- name: Run tests with downgraded app_links
run: |
Expand All @@ -79,3 +58,10 @@ jobs:
run: |
cd example
flutter build web

- name: Upload coverage artifact
if: ${{ matrix.sdk == 'stable'}}
uses: actions/upload-artifact@v4
with:
name: coverage-flutter-supabase-flutter
path: ./packages/supabase_flutter/coverage/lcov.info
Loading
Loading