diff --git a/{{ cookiecutter.__dirname }}/.github/workflows/build.yml b/{{ cookiecutter.__dirname }}/.github/workflows/build.yml index 5812bcd..3f9128c 100644 --- a/{{ cookiecutter.__dirname }}/.github/workflows/build.yml +++ b/{{ cookiecutter.__dirname }}/.github/workflows/build.yml @@ -54,6 +54,35 @@ jobs: pre-commit run --all-files - name: Build assets run: circuitpython-build-bundles --filename_prefix {% raw %}${{ steps.repo-name.outputs.repo-name }}{% endraw -%} {% if cookiecutter.target_bundle == 'Community' %} --package_folder_prefix {% if cookiecutter.library_prefix -%} {{ cookiecutter.library_prefix | lower | replace(' ', '_') }}_ {%- else %}""{%- endif -%}{%- endif %} --library_location . + - name: Clone Size Tools + uses: actions/checkout@v3 + with: + repository: 'circuitpython/CircuitPython_Org_size_tools' + path: 'CircuitPython_Org_size_tools' + - name: Clone Main Branch + uses: actions/checkout@v3 + with: + path: 'main_branch_repo' + ref: 'main' + - name: Build main + run: | + cd main_branch_repo + circuitpython-build-bundles --filename_prefix {% raw %}${{ steps.repo-name.outputs.repo-name }}{% endraw -%} --library_location . + - name: Measure Sizes + run: | + python CircuitPython_Org_size_tools/size_tools.py + - name: Check sizes.txt file existence + id: check_sizes_file + uses: andstor/file-existence-action@v1 + with: + files: "sizes.txt" + - name: Size Measurement Comment + if: github.event_name == 'pull_request' && steps.check_sizes_file.outputs.files_exists == 'true' + uses: machine-learning-apps/pr-comment@master + env: + GITHUB_TOKEN: {% raw %}${{ secrets.GITHUB_TOKEN }}{% endraw %} + with: + path: sizes.txt - name: Archive bundles uses: actions/upload-artifact@v2 with: