2022-03-15 22:15:17 +01:00
|
|
|
name: Check Size
|
2022-03-15 21:56:51 +01:00
|
|
|
|
|
|
|
on:
|
2022-03-18 00:42:18 +01:00
|
|
|
pull_request:
|
2022-03-15 21:56:51 +01:00
|
|
|
|
|
|
|
jobs:
|
2022-03-15 22:15:17 +01:00
|
|
|
check-size:
|
|
|
|
name: Check Size
|
2022-03-15 21:56:51 +01:00
|
|
|
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'
|
|
|
|
|
2022-03-15 22:15:17 +01:00
|
|
|
- name: Fetch bundletool
|
|
|
|
run: |
|
2022-03-15 22:56:14 +01:00
|
|
|
curl -s -L https://github.com/google/bundletool/releases/download/1.9.0/bundletool-all-1.9.0.jar --create-dirs -o bin/bundletool.jar
|
|
|
|
chmod +x bin/bundletool.jar
|
|
|
|
echo "#!/bin/bash" >> bin/bundletool
|
|
|
|
echo 'java -jar $(dirname "$0")/bundletool.jar "$@"' >> bin/bundletool
|
2022-03-15 22:15:17 +01:00
|
|
|
chmod +x bin/bundletool
|
|
|
|
echo "$(pwd)/bin" >> $GITHUB_PATH
|
|
|
|
|
2022-03-18 00:42:18 +01:00
|
|
|
- name: Save Size
|
2022-03-18 21:03:38 +01:00
|
|
|
env:
|
|
|
|
PULL_REQUEST_NUMBER: ${{ github.event.pull_request.number }}
|
2022-03-15 21:56:51 +01:00
|
|
|
run: |
|
2022-03-18 00:42:18 +01:00
|
|
|
mkdir -p ./apk_size
|
|
|
|
echo $(./tools/check-size.sh | tail -1 | cut -d ',' -f2-) > ./apk_size/size.txt
|
2022-03-18 21:03:38 +01:00
|
|
|
echo $PULL_REQUEST_NUMBER > ./apk_size/pr_number.txt
|
2022-03-18 00:42:18 +01:00
|
|
|
- uses: actions/upload-artifact@v3
|
2022-03-15 21:56:51 +01:00
|
|
|
with:
|
2022-03-18 00:42:18 +01:00
|
|
|
name: apk-size
|
2022-03-18 21:03:38 +01:00
|
|
|
path: |
|
|
|
|
apk_size/size.txt
|
|
|
|
apk_size/pr_number.txt
|
2022-03-18 00:42:18 +01:00
|
|
|
retention-days: 5
|