Check engine size #861
This file contains 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: '17.0.5+8' | |
distribution: 'temurin' | |
- name: Setup matplotlib | |
run: | | |
python -m pip install -U pip | |
python -m pip install -U matplotlib | |
- name: Check size | |
run: | | |
python check_size.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 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 | |
git push "https://${SERVICES_GITHUB_TOKEN}@github.com/defold/build-size.git" HEAD:master |