Skip to content

Commit 61b819e

Browse files
author
Ahmed Hamouda
committed
Merge branch 'main' into feat/add-passkey-support
2 parents 8ba782c + e85df40 commit 61b819e

File tree

3 files changed

+108
-22
lines changed

3 files changed

+108
-22
lines changed

.codecov.yml

Lines changed: 19 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,19 @@
1-
codecov:
2-
notify:
3-
after_n_builds: 1
4-
5-
coverage:
6-
status:
7-
project:
8-
default:
9-
target: 65%
10-
if_not_found: success
11-
patch:
12-
default:
13-
target: 80%
14-
if_not_found: success
15-
16-
comment:
17-
layout: "diff, flags, files"
18-
behavior: default
19-
require_changes: false # if true: only post the comment if coverage changes
20-
require_base: no # [yes :: must have a base report to post]
21-
require_head: yes # [yes :: must have a head report to post]
1+
codecov:
2+
notify:
3+
after_n_builds: 1
4+
5+
coverage:
6+
status:
7+
project:
8+
default:
9+
target: auto
10+
threshold: 0.1%
11+
patch:
12+
default:
13+
target: auto
14+
threshold: 0%
15+
16+
comment:
17+
layout: diff
18+
behavior: default
19+
require_changes: false
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
name: Flutter Coverage
2+
on:
3+
push:
4+
branches:
5+
- main
6+
- stable
7+
pull_request:
8+
workflow_dispatch:
9+
10+
defaults:
11+
run:
12+
shell: bash
13+
14+
# These permissions are needed to interact with GitHub's OIDC Token endpoint.
15+
permissions:
16+
id-token: write
17+
contents: read
18+
19+
# Cancels in-progress job when there is another push to same ref.
20+
concurrency:
21+
group: ${{ github.workflow }}-${{ github.ref }}
22+
cancel-in-progress: true
23+
24+
jobs:
25+
flutter-coverage:
26+
runs-on: ubuntu-latest
27+
timeout-minutes: 90
28+
steps:
29+
- name: Git Checkout
30+
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # 4.0.0
31+
32+
- name: Git Submodules
33+
run: git submodule update --init
34+
35+
- name: Setup Flutter
36+
uses: subosito/flutter-action@fd55f4c5af5b953cc57a2be44cb082c8f6635e8e # 2.21.0
37+
with:
38+
cache: true
39+
channel: stable
40+
41+
- name: Flutter Version
42+
run: flutter --version
43+
44+
- name: Setup aft
45+
run: dart pub global activate -spath packages/aft
46+
47+
- name: Bootstrap
48+
id: bootstrap
49+
timeout-minutes: 20
50+
run: aft bootstrap --fail-fast --verbose
51+
52+
- name: Install lcov
53+
run: |
54+
sudo apt-get update
55+
sudo apt-get install -y lcov
56+
57+
- name: Run Flutter Tests with Coverage
58+
run: dart pub global run aft run test:unit:flutter
59+
continue-on-error: true
60+
61+
- name: Merge Coverage Files
62+
if: always()
63+
run: |
64+
mkdir -p coverage
65+
# Find all non-empty lcov.info files and merge them
66+
find packages -name "lcov.info" -type f ! -empty -exec echo "--add-tracefile {}" \; | \
67+
xargs lcov --branch-coverage --ignore-errors inconsistent --output-file coverage/merged_lcov.info || true
68+
69+
- name: Coverage Summary
70+
if: always()
71+
run: |
72+
if [ -f coverage/merged_lcov.info ]; then
73+
echo "## Flutter Coverage Summary" >> $GITHUB_STEP_SUMMARY
74+
echo '```' >> $GITHUB_STEP_SUMMARY
75+
lcov --summary coverage/merged_lcov.info 2>&1 | tee -a $GITHUB_STEP_SUMMARY
76+
echo '```' >> $GITHUB_STEP_SUMMARY
77+
else
78+
echo "No coverage data generated" >> $GITHUB_STEP_SUMMARY
79+
fi
80+
81+
- name: Upload to Codecov
82+
if: always()
83+
uses: codecov/codecov-action@v5
84+
with:
85+
name: flutter-dart-coverage
86+
flags: flutter-tests
87+
files: coverage/merged_lcov.info
88+
token: ${{ secrets.CODECOV_TOKEN }}

tool/test_all_plugins.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ case $KIND in
1919
if ! command -v tojunit >/dev/null; then
2020
dart pub global activate junitreport
2121
fi
22-
if flutter test --machine --coverage | tojunit --output "test-results/$PLUGIN-flutter-test.xml"; then
22+
if flutter test --machine --coverage --branch-coverage | tojunit --output "test-results/$PLUGIN-flutter-test.xml"; then
2323
echo "PASSED: Flutter unit tests for $PLUGIN passed."
2424
else
2525
echo "FAILED: Flutter unit tests for $PLUGIN failed." >&2

0 commit comments

Comments
 (0)