[ci] Report metrics on each PR

This commit is contained in:
Romain Goyet
2020-04-05 15:09:45 -04:00
committed by LeaNumworks
parent 02738ba06a
commit e34811ff18

33
.github/workflows/metrics-workflow.yml vendored Normal file
View File

@@ -0,0 +1,33 @@
name: Metrics
on: [pull_request]
jobs:
binary-size:
runs-on: ubuntu-latest
steps:
- name: Install dependencies
run: sudo apt-get install build-essential imagemagick libfreetype6-dev libjpeg-dev libpng-dev pkg-config
- name: Install ARM toolchain
uses: numworks/setup-arm-toolchain@v1
- name: Checkout PR base
uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.base.sha }}
path: base
- name: Build base
run: make -j2 -C base epsilon.elf
- name: Checkout PR head
uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.sha }}
path: head
- name: Build head
run: make -j2 -C head epsilon.elf
- name: Retrieve binary size analysis
run: echo "::set-env name=BINARY_SIZE::$(python3 head/build/metrics/binary_size.py base/output/release/device/n0110/epsilon.elf head/output/release/device/n0110/epsilon.elf --labels Base Head --escape)"
- name: Add comment
uses: actions/github@v1.0.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
args: comment ${{ env.BINARY_SIZE }}