2020-11-29 02:05:45 -05:00
|
|
|
name: Check code size
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
pull_request:
|
|
|
|
paths:
|
|
|
|
- '.github/workflows/*.yml'
|
|
|
|
- 'tools/**'
|
|
|
|
- 'py/**'
|
|
|
|
- 'extmod/**'
|
|
|
|
- 'lib/**'
|
|
|
|
- 'ports/bare-arm/**'
|
|
|
|
- 'ports/minimal/**'
|
|
|
|
|
2022-12-13 13:57:34 -05:00
|
|
|
concurrency:
|
|
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
|
|
cancel-in-progress: true
|
|
|
|
|
2020-11-29 02:05:45 -05:00
|
|
|
jobs:
|
|
|
|
build:
|
2021-01-23 01:15:18 -05:00
|
|
|
runs-on: ubuntu-20.04
|
2020-11-29 02:05:45 -05:00
|
|
|
steps:
|
2023-09-04 15:42:14 -04:00
|
|
|
- uses: actions/checkout@v4
|
2021-01-23 01:15:18 -05:00
|
|
|
with:
|
|
|
|
fetch-depth: 100
|
2020-11-29 02:05:45 -05:00
|
|
|
- name: Install packages
|
|
|
|
run: source tools/ci.sh && ci_code_size_setup
|
|
|
|
- name: Build
|
|
|
|
run: source tools/ci.sh && ci_code_size_build
|
|
|
|
- name: Compute code size difference
|
2023-01-13 12:07:47 -05:00
|
|
|
run: tools/metrics.py diff ~/size0 ~/size1 | tee diff
|
2022-03-30 12:32:04 -04:00
|
|
|
- name: Save PR number
|
|
|
|
if: github.event_name == 'pull_request'
|
|
|
|
env:
|
|
|
|
PR_NUMBER: ${{ github.event.number }}
|
|
|
|
run: echo $PR_NUMBER > pr_number
|
|
|
|
- name: Upload diff
|
|
|
|
if: github.event_name == 'pull_request'
|
|
|
|
uses: actions/upload-artifact@v3
|
|
|
|
with:
|
|
|
|
name: code-size-report
|
|
|
|
path: |
|
|
|
|
diff
|
|
|
|
pr_number
|
|
|
|
retention-days: 1
|