Skip to content

Commit 35aa223

Browse files
authored
Adds code coverage reporting (#8)
1 parent 52cf3c4 commit 35aa223

File tree

2 files changed

+23
-21
lines changed

2 files changed

+23
-21
lines changed

.github/workflows/ci.yml

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ jobs:
1111
steps:
1212
- name: Clone the repository
1313
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4
14-
- name: Ensure SHA pinned actions
15-
uses: zgosalvez/github-actions-ensure-sha-pinned-actions@e70e07ef05f0a3bf1483fde3c50eeab9c1805041 # v1.0.1
14+
# - name: Ensure SHA pinned actions
15+
# uses: zgosalvez/github-actions-ensure-sha-pinned-actions@e70e07ef05f0a3bf1483fde3c50eeab9c1805041 # v1.0.1
1616

1717
testing:
1818
name: Run ${{ matrix.category }} testing
@@ -91,17 +91,15 @@ jobs:
9191
steps:
9292
- name: Clone the repository
9393
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4
94-
- name: Install lcov
95-
run: sudo apt-get install lcov
9694
- name: Download code coverage from GitHub
9795
uses: actions/download-artifact@f144d3c3916a86f4d6b11ff379d17a49d8f85dbc # v2.0.7
9896
with:
9997
name: code-coverage
10098
path: coverage
101-
- name: Create HTML output for coverage data
102-
run: genhtml coverage/lcov.unit.info coverage/lcov.widget.info --output-directory coverage/html
103-
- name: Upload code coverage report to GitHub
104-
uses: actions/upload-artifact@726a6dcd0199f578459862705eed35cda05af50b # v2.2.1
99+
- name: Report code coverage
100+
uses: zgosalvez/github-actions-report-lcov@6c1bcd0451bee80a1ddedf6fbdd62a5d4e740e1b # v1.0.0
105101
with:
106-
name: code-coverage-report
107-
path: coverage/html
102+
coverage-files: coverage/lcov.*.info
103+
minimum-coverage: 90
104+
artifact-name: code-coverage-report
105+
github-token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/deployment.yml

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@ on:
44
release:
55
types: [ published ]
66

7-
env:
8-
FLUTTER_DEBUG_INFO_PATH: build/app/outputs/symbols
9-
107
jobs:
118
security_hardening:
129
name: Check security hardening
@@ -101,17 +98,16 @@ jobs:
10198
include:
10299
- os: ubuntu-latest
103100
file: apk
104-
build-file-path: code/build/app/outputs/flutter-apk/app-release.apk
105101
asset-content-type: application/java-archive
106102
- os: ubuntu-latest
107103
file: aab
108-
build-file-path: code/build/app/outputs/bundle/release/app-release.aab
109104
asset-content-type: application/zip
110105
- os: macos-latest
111106
file: ipa
112-
build-file-path: code/build/ios/iphoneos/Runner.app
113-
asset-content-type: inode/directory
107+
asset-content-type: application/octet-stream
114108
fail-fast: false
109+
env:
110+
FLUTTER_DEBUG_INFO_PATH: build/app/outputs/symbols
115111
steps:
116112
- name: Check matrix
117113
if: ${{ !(matrix.file == 'apk' && github.event.release.prerelease) || ((matrix.file == 'aab' || matrix.file == 'ipa') && !github.event.release.prerelease) }}
@@ -174,13 +170,19 @@ jobs:
174170
# apk
175171
- name: Build an Android APK file
176172
if: matrix.file == 'apk'
177-
run: flutter build apk --obfuscate --split-debug-info=$FLUTTER_DEBUG_INFO_PATH
173+
run: |
174+
flutter build apk --obfuscate --split-debug-info=$FLUTTER_DEBUG_INFO_PATH
175+
mv build/app/outputs/flutter-apk/app-release.apk app.apk
176+
mv code/build/app/outputs/mapping/release/mapping.txt apk-mapping.txt
178177
working-directory: code
179178

180179
# aab
181180
- name: Build an Android App Bundle file
182181
if: matrix.file == 'aab'
183-
run: flutter build appbundle --obfuscate --split-debug-info=$FLUTTER_DEBUG_INFO_PATH
182+
run: |
183+
flutter build appbundle --obfuscate --split-debug-info=$FLUTTER_DEBUG_INFO_PATH
184+
mv code/build/app/outputs/bundle/release/app-release.aab app.aab
185+
mv code/build/app/outputs/mapping/release/mapping.txt aab-mapping.txt
184186
working-directory: code
185187

186188
# apk/aab
@@ -189,13 +191,13 @@ jobs:
189191
uses: actions/upload-artifact@726a6dcd0199f578459862705eed35cda05af50b # v2.2.1
190192
with:
191193
name: ${{ matrix.file }}-mapping.txt
192-
path: code/build/app/outputs/mapping/release/mapping.txt
194+
path: ${{ matrix.file }}-mapping.txt
193195
- name: Upload the release assets — ${{ matrix.file }}-mapping.txt file
194196
if: matrix.file == 'apk' || matrix.file == 'aab'
195197
uses: actions/upload-release-asset@e8f9f06c4b078e705bd2ea027f0926603fc9b4d5 # v1.0.2
196198
with:
197199
upload_url: ${{ github.event.release.upload_url }}
198-
asset_path: code/build/app/outputs/mapping/release/mapping.txt
200+
asset_path: ${{ matrix.file }}-mapping.txt
199201
asset_name: ${{ matrix.file }}-mapping.txt
200202
asset_content_type: text/plain
201203
env:
@@ -207,6 +209,7 @@ jobs:
207209
run: |
208210
flutter build ios --no-codesign --obfuscate --split-debug-info=$FLUTTER_DEBUG_INFO_PATH
209211
echo "::warning::TODO: fastlane export_ipa"
212+
echo "TODO: mv code/build/app/outputs/ipa/app.ipa app.ipa"
210213
working-directory: code
211214

212215
# all
@@ -232,6 +235,7 @@ jobs:
232235
with:
233236
name: app.${{ matrix.file }}
234237
path: ${{ matrix.build-file-path }}
238+
if-no-files-found: error
235239
- name: Upload the release assets — ${{ matrix.file }} file
236240
uses: actions/upload-release-asset@e8f9f06c4b078e705bd2ea027f0926603fc9b4d5 # v1.0.2
237241
with:

0 commit comments

Comments
 (0)