Skip to content

Commit 2fe778b

Browse files
committed
See if I can collect coverage from each step
1 parent 155dbef commit 2fe778b

File tree

2 files changed

+26
-1
lines changed

2 files changed

+26
-1
lines changed

.github/actions/flutter_analysis_and_tests/action.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,15 @@ runs:
3232

3333
- name: Run unit tests
3434
shell: bash
35-
run: flutter test
35+
run: flutter test --coverage
3636
working-directory: ${{ inputs.working-directory }}
3737

38+
- name: Upload coverage artifact
39+
uses: actions/upload-artifact@v4
40+
with:
41+
name: coverage-lcov-$(basename "${{ inputs.working-directory }}").info
42+
path: ${{ inputs.working-directory }}/coverage/lcov.info
43+
3844
- name: Run linux integration tests
3945
if: ${{ inputs.run-integration-tests != 'false' }}
4046
shell: bash

.github/workflows/static_analysis_and_tests.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,22 @@ jobs:
4242
uses: ./.github/actions/flutter_analysis_and_tests
4343
with:
4444
working-directory: ./inherited_widget
45+
read_coverage:
46+
name: Read Combined Coverage Files
47+
runs-on: ubuntu-latest
48+
needs: [todos_repository_local_storage, vanilla, inherited_widget]
49+
steps:
50+
- name: Checkout repository
51+
uses: actions/checkout@v4
52+
- name: Download coverage artifacts
53+
uses: actions/download-artifact@v4
54+
with:
55+
path: .
56+
- name: List coverage files
57+
run: ls -l coverage-lcov-*.info || echo "No coverage files found"
58+
- name: Show coverage files content
59+
run: |
60+
for f in coverage-lcov-*.info; do
61+
echo "\n==== $f ===="
62+
cat "$f"
63+
done || echo "No coverage files to show"

0 commit comments

Comments
 (0)