From cee34c7c25c52746647c49688c0be0ce866a187b Mon Sep 17 00:00:00 2001 From: forntoh Date: Sun, 15 Sep 2024 07:07:34 +0200 Subject: [PATCH] Updates --- .github/workflows/arduino-size-report.yml | 14 +++++++++++ .github/workflows/compile-arduino.yml | 16 ------------- .scripts/metrics.py | 29 ----------------------- 3 files changed, 14 insertions(+), 45 deletions(-) create mode 100644 .github/workflows/arduino-size-report.yml delete mode 100644 .scripts/metrics.py diff --git a/.github/workflows/arduino-size-report.yml b/.github/workflows/arduino-size-report.yml new file mode 100644 index 00000000..bdcf1f67 --- /dev/null +++ b/.github/workflows/arduino-size-report.yml @@ -0,0 +1,14 @@ +name: Arduino Size Report +on: + schedule: + - cron: "*/10 * * * *" + +jobs: + report: + runs-on: ubuntu-latest + + steps: + - name: Report size deltas + uses: arduino/report-size-deltas@v1 + with: + sketches-reports-source: ${{ vars.SKETCHES_REPORTS_PATH }} diff --git a/.github/workflows/compile-arduino.yml b/.github/workflows/compile-arduino.yml index f00aeae9..67dcdb1f 100644 --- a/.github/workflows/compile-arduino.yml +++ b/.github/workflows/compile-arduino.yml @@ -35,19 +35,3 @@ jobs: with: name: sketches-report-${{ matrix.board.artifact-name-suffix }} path: ${{ vars.SKETCHES_REPORTS_PATH }} - - report: - needs: compile - if: github.event_name == 'pull_request' - runs-on: ubuntu-latest - - steps: - - name: Download sketches reports artifacts - uses: actions/download-artifact@v4 - with: - path: ${{ vars.SKETCHES_REPORTS_PATH }} - - - name: Report size deltas - uses: arduino/report-size-deltas@v1 - with: - sketches-reports-source: ${{ vars.SKETCHES_REPORTS_PATH }} diff --git a/.scripts/metrics.py b/.scripts/metrics.py deleted file mode 100644 index 5521f983..00000000 --- a/.scripts/metrics.py +++ /dev/null @@ -1,29 +0,0 @@ -import re - -import click - - -def parse_output(output): - # Extract RAM percentage - ram_percentage = re.search(r"RAM:\s+\[+.*\]\s+(\d+\.*\d*)%", output).group(1) - - # Extract Flash percentage - flash_percentage = re.search(r"Flash:\s+\[+.*\]\s+(\d+\.*\d*)%", output).group(1) - - result = { - "ram": float(ram_percentage), - "flash": float(flash_percentage) - } - - return result - -@click.command() -@click.argument("filename", required=False, type=click.File("r"), default="-") -def main(filename): - output = filename.read() - - result = parse_output(output) - click.echo(result) - -if __name__ == "__main__": - main()