smalltalk-matrix/.github/workflows/check_size.yml

46 lines
1.3 KiB
YAML
Raw Normal View History

2022-03-15 22:15:17 +01:00
name: Check Size
on:
pull_request:
jobs:
2022-03-15 22:15:17 +01:00
check-size:
name: Check Size
runs-on: ubuntu-latest
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v2
with:
distribution: 'adopt'
java-version: '11'
- uses: gradle/gradle-build-action@v2
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
- name: Save Size
env:
PULL_REQUEST_NUMBER: ${{ github.event.pull_request.number }}
run: |
mkdir -p ./apk_size
echo $(./tools/check-size.sh | tail -1 | cut -d ',' -f2-) > ./apk_size/size.txt
echo $PULL_REQUEST_NUMBER > ./apk_size/pr_number.txt
- uses: actions/upload-artifact@v3
with:
name: apk-size
path: |
apk_size/size.txt
apk_size/pr_number.txt
retention-days: 5