From 5a583923f44289480ae668e35217936e8aa999d2 Mon Sep 17 00:00:00 2001 From: Adam Brown Date: Tue, 15 Mar 2022 20:56:51 +0000 Subject: [PATCH] adding job to checksize and print the output to the PR --- .github/workflows/check_size.yml | 50 ++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 .github/workflows/check_size.yml diff --git a/.github/workflows/check_size.yml b/.github/workflows/check_size.yml new file mode 100644 index 0000000..e7d04a6 --- /dev/null +++ b/.github/workflows/check_size.yml @@ -0,0 +1,50 @@ +name: Assemble + +on: + pull_request: + +jobs: + assemble-debug: + name: Assemble debug variant + runs-on: ubuntu-latest + + concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + + steps: + - uses: actions/checkout@v2 + - uses: actions/cache@v2 + with: + path: | + ~/.gradle/caches + ~/.gradle/wrapper + key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} + restore-keys: | + ${{ runner.os }}-gradle- + + - uses: actions/setup-java@v2 + with: + distribution: 'adopt' + java-version: '11' + + - name: Check release size + run: | + echo "::set-output name=APK_SIZE::$(./tools/check-size.sh | tail -1 | cut -d ',' -f2-)" + id: size + + - name: Find Comment + uses: peter-evans/find-comment@v1 + id: fc + with: + issue-number: ${{ github.event.pull_request.number }} + comment-author: 'github-actions[bot]' + body-includes: APK Size + - name: Publish size to PR + uses: peter-evans/create-or-update-comment@v1 + with: + comment-id: ${{ steps.fc.outputs.comment-id }} + issue-number: ${{ github.event.pull_request.number }} + body: | + APK Size: ${{ steps.size.outputs.APK_SIZE }} + edit-mode: replace \ No newline at end of file