Skip to content
This repository was archived by the owner on Mar 26, 2024. It is now read-only.

Commit cd00987

Browse files
authored
Merge pull request #7 from microsoft/add-threshold-support
Added support for metrics and thresholds
2 parents fc120dd + 9fe5655 commit cd00987

File tree

17 files changed

+1690
-1466
lines changed

17 files changed

+1690
-1466
lines changed

.github/workflows/ci-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
runs-on: ${{ matrix.os }}
99
strategy:
1010
matrix:
11-
os: [ubuntu-latest, macos-latest, windows-latest]
11+
os: [ubuntu-latest, macos-latest] # also include windows-latest once npm install is fixed
1212

1313
steps:
1414
- uses: actions/checkout@v1

.github/workflows/gh-action-test.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,13 @@ jobs:
1717
- name: Run App size diff
1818
uses: ./
1919
with:
20-
baseAppPath: 'test/assets/test.apk'
21-
targetAppPath: 'test/assets/test.apk'
20+
baseAppPath: test/assets/test.apk
21+
baseAppLabel: Base app
22+
targetAppPath: test/assets/test.apk
23+
targetAppLabel: Target app
2224
summaryOutputPath: summary.md
25+
metrics: apkSize, installSize, arscFile, nativeLibs, dexFiles
26+
thresholds: 10, 10, 10, 10, 10
2327

2428
- name: Print summary
2529
run: cat summary.md

README.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,32 @@ This is currently in very early stages so, features offered are very limited. Se
2828
summaryOutputPath: summary.md
2929
```
3030
31+
## Usage API
32+
The API to use the GitHub action or Azure DevOps task is similar
33+
34+
### Inputs
35+
36+
- `baseAppPath`: Path to base apk. This is the app before changes
37+
- required: true
38+
- default: 'base.apk'
39+
- `baseAppLabel`: Label to use for the base app in the report
40+
- required: false
41+
- default: 'Base APK'
42+
- `targetAppPath`: Path to target apk. This is the app after changes
43+
- required: true
44+
- default: 'target.apk'
45+
- `targetAppLabel`: Label to use for the base app in the report
46+
- required: false
47+
- default: 'Target APK'
48+
- `summaryOutputPath`: Output file where comparision summary should be written to
49+
- required: true
50+
- default: 'summary.md'
51+
- `metrics`: A comma seperated list of size metrics to include in the summary. Possible values are `apkSize`, `installSize`, `dexFiles`, `arscFile`, `nativeLibs`
52+
- required: false
53+
- default: 'apkSize, installSize, dexFiles, arscFile, nativeLibs'
54+
- `thresholds`: A comma seperated list of thresholds for each of the metrics in bytes. If this is empty, no thresholding will apply. When this is not empty, the task will fail when any of the given thresholds are crossed
55+
- required: false
56+
- default: ''
3157

3258
# Contributing
3359

action.yml

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,30 @@ inputs:
44
baseAppPath:
55
description: 'Path to base apk. This is the app before changes'
66
required: true
7-
default: ''
7+
default: 'base.apk'
8+
baseAppLabel:
9+
description: 'Label to use for the base app in the report'
10+
required: false
11+
default: 'Base APK'
812
targetAppPath:
913
description: 'Path to target apk. This is the app after changes'
1014
required: true
11-
default: ''
15+
default: 'target.apk'
16+
targetAppLabel:
17+
description: 'Label to use for the target app in the report'
18+
required: false
19+
default: 'Target APK'
1220
summaryOutputPath:
1321
description: 'Output file where comparision summary should be written to'
1422
required: true
23+
default: 'summary.md'
24+
metrics:
25+
description: 'A comma seperated list of size metrics to include in the summary. Possible values are `apkSize`, `installSize`, `dexFiles`, `arscFile`, `nativeLibs`'
26+
required: false
27+
default: 'apkSize, installSize, dexFiles, arscFile, nativeLibs'
28+
thresholds:
29+
description: 'A comma seperated list of thresholds for each of the metrics in bytes. If this is empty, no thresholding will apply. When this is not empty, the task will fail when any of the given thresholds are crossed'
30+
required: false
1531
default: ''
1632
runs:
1733
using: 'node12'

ado-extension.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"manifestVersion": 1,
33
"id": "android-app-size-diff-utils",
44
"name": "Android app size changes",
5-
"version": "0.0.25",
5+
"version": "0.0.27",
66
"publisher": "PraveenPendyala",
77
"targets": [
88
{

ado-task-test.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,12 @@ steps:
88
- task: android-app-size-diff@0
99
inputs:
1010
baseAppPath: test/assets/test.apk
11+
baseAppLabel: Base app
1112
targetAppPath: test/assets/test.apk
13+
targetAppLabel: Target app
1214
summaryOutputPath: summary.md
15+
metrics: apkSize, installSize, arscFile, nativeLibs, dexFiles
16+
thresholds: 10, 10, 10, 10, 10
1317
displayName: 'Run APK size comparision'
1418

1519
- script: cat summary.md

dist_gh_action/index.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)