Skip to content

Switch to contributor-friendly approach to size deltas CI report #23

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 30, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ name: Compile Examples
on:
push:
paths:
- ".github/workflows/compile-examples-private.ya?ml"
- ".github/workflows/compile-examples.ya?ml"
- "library.properties"
- "examples/**"
- "src/**"
pull_request:
paths:
- ".github/workflows/compile-examples-private.ya?ml"
- ".github/workflows/compile-examples.ya?ml"
- "library.properties"
- "examples/**"
- "src/**"
Expand All @@ -20,15 +20,14 @@ on:
workflow_dispatch:
repository_dispatch:

env:
SKETCHES_REPORTS_PATH: sketches-reports
SKETCHES_REPORTS_ARTIFACT_NAME: sketches-reports

jobs:
build:
name: ${{ matrix.board.fqbn }}
runs-on: ubuntu-latest

env:
SKETCHES_REPORTS_PATH: sketches-reports

strategy:
fail-fast: false

Expand Down Expand Up @@ -63,26 +62,4 @@ jobs:
with:
if-no-files-found: error
path: ${{ env.SKETCHES_REPORTS_PATH }}
name: ${{ env.SKETCHES_REPORTS_ARTIFACT_NAME }}

report-size-deltas:
needs: build
# Run even if some compilations failed. Only run when there are write permissions.
if: always() && github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository
runs-on: ubuntu-latest

steps:
- name: Download sketches reports artifact
id: download-artifact
continue-on-error: true # If compilation failed for all boards then there are no artifacts
uses: actions/download-artifact@v2
with:
name: ${{ env.SKETCHES_REPORTS_ARTIFACT_NAME }}
path: ${{ env.SKETCHES_REPORTS_PATH }}

- name: Comment size deltas report to PR
uses: arduino/report-size-deltas@v1
# If actions/download-artifact failed, there are no artifacts to report from.
if: steps.download-artifact.outcome == 'success'
with:
sketches-reports-source: ${{ env.SKETCHES_REPORTS_PATH }}
name: ${{ env.SKETCHES_REPORTS_PATH }}
24 changes: 24 additions & 0 deletions .github/workflows/report-size-deltas.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Report Size Deltas

# See: https://docs.github.com/en/actions/reference/events-that-trigger-workflows
on:
push:
paths:
- ".github/workflows/report-size-deltas.ya?ml"
schedule:
# Run at the minimum interval allowed by GitHub Actions.
# Note: GitHub Actions periodically has outages which result in workflow failures.
# In this event, the workflows will start passing again once the service recovers.
- cron: "*/5 * * * *"
workflow_dispatch:
repository_dispatch:

jobs:
report:
runs-on: ubuntu-latest
steps:
- name: Comment size deltas reports to PRs
uses: arduino/report-size-deltas@v1
with:
# The name of the workflow artifact created by the sketch compilation workflow
sketches-reports-source: sketches-reports
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Portenta Breakout Carrier Library for Arduino

[![Check Arduino status](https://github.com/arduino-libraries/Arduino_PortentaBreakoutLibrary/actions/workflows/check-arduino.yml/badge.svg)](https://github.com/arduino-libraries/Arduino_PortentaBreakoutLibrary/actions/workflows/check-arduino.yml)
[![Compile Examples status](https://github.com/arduino-libraries/Arduino_PortentaBreakoutLibrary/actions/workflows/compile-examples-private.yml/badge.svg)](https://github.com/arduino-libraries/Arduino_PortentaBreakoutLibrary/actions/workflows/compile-examples-private.yml)
[![Compile Examples status](https://github.com/arduino-libraries/Arduino_PortentaBreakoutLibrary/actions/workflows/compile-examples.yml/badge.svg)](https://github.com/arduino-libraries/Arduino_PortentaBreakoutLibrary/actions/workflows/compile-examples.yml)
[![Spell Check status](https://github.com/arduino-libraries/Arduino_PortentaBreakoutLibrary/actions/workflows/spell-check.yml/badge.svg)](https://github.com/arduino-libraries/Arduino_PortentaBreakoutLibrary/actions/workflows/spell-check.yml)

Arduino Library for the Arduino Portenta Breakout Carrier
Expand Down