GithubHelp home page GithubHelp logo

android-app-size-diff's Introduction

Introduction

This repository contains an Azure DevOps Task and a GitHub Workflow Action. See below usage examples to start using this in your CI.

These are the minimal checks we run on our own PRs for SwiftKey, however we're happy to accept contributions. See contributing section below if you would like to expand this action's features.

Usage examples

  • In a Azure DevOps Pipeline

     - task: android-app-size-diff@1
       inputs:
         baseAppPath: test/assets/test.apk
         targetAppPath: test/assets/test.apk
         summaryOutputPath: summary.md
       displayName: Run APK size comparision
  • In a GitHub Workflow

      - uses: microsoft/android-app-size-diff@v1
        name: Run APK size comparision
        with:
         baseAppPath: test/assets/test.apk
         targetAppPath: test/assets/test.apk
         summaryOutputPath: summary.md

Usage API

The API to use the GitHub action or Azure DevOps task is similar

Inputs

  • baseAppPath: Path to base apk. This is the app before changes
    • required: true
    • default: 'base.apk'
  • baseAppLabel: Label to use for the base app in the report
    • required: false
    • default: 'Base APK'
  • targetAppPath: Path to target apk. This is the app after changes
    • required: true
    • default: 'target.apk'
  • targetAppLabel: Label to use for the base app in the report
    • required: false
    • default: 'Target APK'
  • summaryOutputPath: Output file where comparision summary should be written to
    • required: true
    • default: 'summary.md'
  • metrics: A comma seperated list of size metrics to include in the summary. Possible values are apkSize, installSize, dexFiles, arscFile, nativeLibs
    • required: false
    • default: 'apkSize, installSize, dexFiles, arscFile, nativeLibs'
  • 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
    • required: false
    • default: ''
  • telemetryEnabled: Set to false to disable telemetry
    • required: false
    • default: 'true'

Data Collection

The software may collect information about you and your use of the software and send it to Microsoft. Microsoft may use this information to provide services and improve our products and services. You may turn off the telemetry as described in the repository. There are also some features in the software that may enable you and Microsoft to collect data from users of your applications. If you use these features, you must comply with applicable law, including providing appropriate notices to users of your applications together with a copy of Microsoft's privacy statement. Our privacy statement is located at https://go.microsoft.com/fwlink/?LinkID=824704. You can learn more about data collection and use in the help documentation and our privacy statement. Your use of the software operates as your consent to these practices.

To disable data collection when using this extension, set the telemetryEnabled input to false

Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com.

When you submit a pull request, a CLA bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

Setting up development

Starting by cloning the repository. If your changes are small, feel free to open a PR with changes and the CI will take care of testing that everything still works with your changes. For something more long term or local testing, read on.

Installations

  • Install all global dependencies
    npm install -g typescript
    npm install -g ts-node
    npm install -g mocha
    
    # Only if you are compiling the GitHub plugin
    npm install -g @zeit/ncc
    
    # Only if you are publishing to ADO. Not required for most scenarios
    npm install -g tfx-cli
  • Install all project dependencies npm install

Running

See package.json for full list of npm tasks. The below should be sufficient to get you started

  • Build code npm run build
  • Run ADO plugin locally npm run adoTask
  • Run all tests npm run test
    • Likely a better way to test your changes
  • Bundle all plugins npm run bundle

android-app-size-diff's People

Contributors

dependabot[bot] avatar microsoftopensource avatar ojj11 avatar pkpio avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

android-app-size-diff's Issues

GitHub Actions gives deprecation warning

The GitHub Actions workflow gives the following deprecation warning:

Node.js 12 actions are deprecated. For more information see: github.blog/changelog/2022-09-22-github-actions-all-actions-will-begin-running-on-node16-instead-of-node12.

Need capability to report AAR sizes for SDK

I'm from Beacon team, and we have a 'Beacon SDK' which is a collection of AARs that different partners integrate to get user location. So, if with each check-in we start to get size impact on these AARs , then it could be quite useful to us. We'll be happy to get just the total size of AARs to start with.. You already seem to have a system in place to check and report the APK file size, the same would work for AAR to start with. You can search for .AAR files built in the build directory and report the sizes of all or of just those that are in the release folder. I'm sure this would be useful for many other size conscious teams as well, including my previous team where we started a process of including AAR size as part of daily manual testing report to get a feel of how our SDK size was getting impacted each day.

Planning to upgrade logo on GitHub Marketplace to Microsoft logo by end of May 2021

Provide a Unit of measurement for size difference

The github action should take unit of measurement as an optional parameter. Right now everything is bytes .Suggesting to measure the difference in Kb. This will have more impact during pull request review rather than seeing a bunch of values always changing.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.