Check engine size #1216
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Check engine size | |
on: | |
push: | |
schedule: | |
- cron: 0 2 * * * | |
jobs: | |
check_size: | |
runs-on: macOS-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Setup Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.10' | |
- name: Setup Java | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '21.0.5+11.0.LTS' | |
distribution: 'temurin' | |
- name: Install Python dependencies | |
run: | | |
python -m pip install -U pip | |
python -m pip install -U matplotlib | |
- name: Install bloaty (for analyze_builds.py) | |
run: | | |
# Install bloaty using Homebrew (macOS) | |
brew install bloaty | |
- name: Check size | |
run: | | |
python check_size.py | |
- name: Run detailed analysis | |
run: | | |
python analyze_builds.py | |
- name: Check github token | |
id: checktoken | |
shell: bash | |
env: | |
SERVICES_GITHUB_TOKEN: ${{ secrets.SERVICES_GITHUB_TOKEN }} | |
run: | | |
if [ "${SERVICES_GITHUB_TOKEN}" == "" ]; then | |
# echo "::set-output name=token_exists::false" | |
echo "token_exists=false" >> $GITHUB_OUTPUT | |
echo "token_exists::false" | |
else | |
# echo "::set-output name=token_exists::true" | |
echo "token_exists=true" >> $GITHUB_OUTPUT | |
echo "token_exists::true" | |
fi | |
- name: Commit changes | |
if: ${{ steps.checktoken.outputs.token_exists == 'true' }} | |
shell: bash | |
env: | |
SERVICES_GITHUB_TOKEN: ${{ secrets.SERVICES_GITHUB_TOKEN }} | |
run: | | |
git add -A | |
git commit -m "Generated new size report and graph [skip ci]" bundle_size.png engine_size.png engine_report.csv bob_size.png bob_report.csv editor_size.png editor_report.csv bundle_report.csv releases.json size-analyzer/ | |
git push "https://${SERVICES_GITHUB_TOKEN}@github.com/defold/build-size.git" HEAD |