From 81698959c978f6a4bac09e2c5e4ac8b701764cce Mon Sep 17 00:00:00 2001 From: per1234 Date: Tue, 12 Jan 2021 22:21:03 -0800 Subject: [PATCH] Report changes in memory usage that would result from merging a PR On creation or commit to a pull request, a report of the resulting change in memory usage of the examples will be commented to the PR thread. --- .github/workflows/compile-examples.yml | 11 +++++++++++ .github/workflows/report-size-deltas.yml | 21 +++++++++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 .github/workflows/report-size-deltas.yml diff --git a/.github/workflows/compile-examples.yml b/.github/workflows/compile-examples.yml index 9691a607..9a017a46 100644 --- a/.github/workflows/compile-examples.yml +++ b/.github/workflows/compile-examples.yml @@ -24,6 +24,9 @@ jobs: build: runs-on: ubuntu-latest + env: + SKETCHES_REPORTS_PATH: sketches-reports + strategy: fail-fast: false @@ -48,3 +51,11 @@ jobs: - name: VidorPeripherals sketch-paths: | - ./examples/ + enable-deltas-report: true + sketches-report-path: ${{ env.SKETCHES_REPORTS_PATH }} + + - name: Save memory usage change report as artifact + uses: actions/upload-artifact@v2 + with: + name: ${{ env.SKETCHES_REPORTS_PATH }} + path: ${{ env.SKETCHES_REPORTS_PATH }} diff --git a/.github/workflows/report-size-deltas.yml b/.github/workflows/report-size-deltas.yml new file mode 100644 index 00000000..c69650f2 --- /dev/null +++ b/.github/workflows/report-size-deltas.yml @@ -0,0 +1,21 @@ +name: Report Size Deltas + +on: + schedule: + - cron: '*/5 * * * *' + # See: https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows#workflow_dispatch + workflow_dispatch: + # See: https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows#repository_dispatch + repository_dispatch: + +jobs: + report: + runs-on: ubuntu-latest + + steps: + # See: https://github.com/arduino/actions/blob/master/libraries/report-size-deltas/README.md + - name: Comment size deltas reports to PRs + uses: arduino/report-size-deltas@main + with: + # The name of the workflow artifact created by the "Compile Examples" workflow + sketches-reports-source: sketches-reports