From 58f8db9f9655e773d7da8de6f5b79420b09107af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Procha=CC=81zka?= <90197375+P-R-O-C-H-Y@users.noreply.github.com> Date: Wed, 5 Apr 2023 12:16:28 +0200 Subject: [PATCH 01/10] add new workflow --- .github/workflows/lib.json | 47 -------------------------------- .github/workflows/publishlib.yml | 40 +++++++++++++++++++++++++++ 2 files changed, 40 insertions(+), 47 deletions(-) create mode 100644 .github/workflows/publishlib.yml diff --git a/.github/workflows/lib.json b/.github/workflows/lib.json index 064d4967f3c..088e8c1c5ab 100644 --- a/.github/workflows/lib.json +++ b/.github/workflows/lib.json @@ -1,56 +1,9 @@ [ { "name": "Adafruit NeoPixel", - "version": "1.10.6", "exclude_targets": [], "sketch_path": [ "~/Arduino/libraries/Adafruit_NeoPixel/examples/strandtest/strandtest.ino" ] - }, - { - "name": "ArduinoBLE", - "exclude_targets": [ - "esp32s2" - ], - "sketch_path": [ - "~/Arduino/libraries/ArduinoBLE/examples/Central/Scan/Scan.ino" - ] - }, - { - "name": "ESP32Servo", - "exclude_targets": [], - "sketch_path": [ - "~/Arduino/libraries/ESP32Servo/examples/Knob/Knob.ino", - "~/Arduino/libraries/ESP32Servo/examples/Sweep/Sweep.ino", - "~/Arduino/libraries/ESP32Servo/examples/PWMExample/PWMExample.ino", - "~/Arduino/libraries/ESP32Servo/examples/Multiple-Servo-Example-Arduino/Multiple-Servo-Example-Arduino.ino" - ] - }, - { - "source-url": "https://github.com/me-no-dev/ESPAsyncWebServer.git", - "required-libs": [ - {"source-url": "https://github.com/me-no-dev/AsyncTCP.git"} - ], - "exclude_targets": [], - "sketch_path": [ - "~/Arduino/libraries/ESPAsyncWebServer/examples/CaptivePortal/CaptivePortal.ino", - "~/Arduino/libraries/ESPAsyncWebServer/examples/ESP_AsyncFSBrowser/ESP_AsyncFSBrowser.ino", - "~/Arduino/libraries/ESPAsyncWebServer/examples/regex_patterns/regex_patterns.ino", - "~/Arduino/libraries/ESPAsyncWebServer/examples/simple_server/simple_server.ino" - ] - }, - { - "name": "FastLED", - "exclude_targets": [], - "sketch_path": [ - "~/Arduino/libraries/FastLED/examples/Blink/Blink.ino" - ] - }, - { - "name": "IRremote", - "exclude_targets": [], - "sketch_path": [ - "~/Arduino/libraries/IRremote/examples/SendDemo/SendDemo.ino" - ] } ] \ No newline at end of file diff --git a/.github/workflows/publishlib.yml b/.github/workflows/publishlib.yml new file mode 100644 index 00000000000..b3da146cb62 --- /dev/null +++ b/.github/workflows/publishlib.yml @@ -0,0 +1,40 @@ +name: External Libraries Test Results + +on: + workflow_run: + workflows: [External Libraries Test] + + types: + - completed + +env: + # It's convenient to set variables for values used multiple times in the workflow + SKETCHES_REPORTS_PATH: libraries-report + SKETCHES_REPORTS_ARTIFACT_NAME: libraries-report + RESULT_LIBRARY_TEST_FILE: LIBRARIES_TEST.md + JSON_LIBRARY_LIST_FILE: .github/workflows/lib.json + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} + +jobs: + lib-test-results: + name: External Libraries Test Results + runs-on: ubuntu-latest + if: | + github.event.workflow_run.event == 'pull_request' && + (github.event.workflow_run.conclusion == 'success' || + github.event.workflow_run.conclusion == 'failure') + + steps: + # This step is needed to get the size data produced by the compile jobs + - name: Download sketches reports artifact + uses: actions/download-artifact@v3 + with: + name: ${{ env.SKETCHES_REPORTS_ARTIFACT_NAME }} + path: ${{ env.SKETCHES_REPORTS_PATH }} + + - name: Report results + uses: P-R-O-C-H-Y/report-size-deltas@main + with: + sketches-reports-source: ${{ env.SKETCHES_REPORTS_PATH }} + github-token: ${{ env.GITHUB_TOKEN }} + From e6782648e8cccbb5d4ceb0fbaa6ec160d10ff3cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Procha=CC=81zka?= <90197375+P-R-O-C-H-Y@users.noreply.github.com> Date: Wed, 5 Apr 2023 12:29:39 +0200 Subject: [PATCH 02/10] Update lib.yml --- .github/workflows/lib.yml | 30 +++++++++++++----------------- 1 file changed, 13 insertions(+), 17 deletions(-) diff --git a/.github/workflows/lib.yml b/.github/workflows/lib.yml index 8f7756abaf3..8f4c9565b4d 100644 --- a/.github/workflows/lib.yml +++ b/.github/workflows/lib.yml @@ -72,23 +72,6 @@ jobs: name: ${{ env.SKETCHES_REPORTS_ARTIFACT_NAME }} path: ${{ env.SKETCHES_REPORTS_PATH }} - report-comment: - needs: compile-sketch # Wait for the compile job to finish to get the data for the report - if: github.event_name == 'pull_request' # Only run the job when the workflow is triggered by a pull request - runs-on: ubuntu-latest - steps: - # This step is needed to get the size data produced by the compile jobs - - name: Download sketches reports artifact - uses: actions/download-artifact@v3 - with: - name: ${{ env.SKETCHES_REPORTS_ARTIFACT_NAME }} - path: ${{ env.SKETCHES_REPORTS_PATH }} - - - name: Report results - uses: P-R-O-C-H-Y/report-size-deltas@main - with: - sketches-reports-source: ${{ env.SKETCHES_REPORTS_PATH }} - report-to-file: needs: compile-sketch # Wait for the compile job to finish to get the data for the report if: github.event_name == 'schedule' # Only run the job when the workflow is triggered by a schedule @@ -126,3 +109,16 @@ jobs: git add ${{ env.RESULT_LIBRARY_TEST_FILE }} git commit -m "Generated External Libraries Test Results" git push + + event_file: + name: "Event File" + if: | + contains(github.event.pull_request.labels.*.name, 'lib_test') + needs: compile-sketch + runs-on: ubuntu-latest + steps: + - name: Upload + uses: actions/upload-artifact@v2 + with: + name: Event File + path: ${{github.event_path}} \ No newline at end of file From fb32aeca17da4e3d979fe68803242d4dca80423f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Procha=CC=81zka?= <90197375+P-R-O-C-H-Y@users.noreply.github.com> Date: Wed, 5 Apr 2023 13:13:08 +0200 Subject: [PATCH 03/10] Update publishlib.yml --- .github/workflows/publishlib.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/publishlib.yml b/.github/workflows/publishlib.yml index b3da146cb62..86a8268949a 100644 --- a/.github/workflows/publishlib.yml +++ b/.github/workflows/publishlib.yml @@ -1,12 +1,12 @@ -name: External Libraries Test Results +name: External Libraries Results on: workflow_run: workflows: [External Libraries Test] - types: - completed + workflow_dispatch: env: # It's convenient to set variables for values used multiple times in the workflow SKETCHES_REPORTS_PATH: libraries-report From fcedbae830558491b79bcc4c79e4dbd7cc2038a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Procha=CC=81zka?= <90197375+P-R-O-C-H-Y@users.noreply.github.com> Date: Wed, 5 Apr 2023 13:16:20 +0200 Subject: [PATCH 04/10] Update lib.yml --- .github/workflows/lib.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/lib.yml b/.github/workflows/lib.yml index 8f4c9565b4d..1979440408a 100644 --- a/.github/workflows/lib.yml +++ b/.github/workflows/lib.yml @@ -1,5 +1,6 @@ name: External Libraries Test +#add comment DBG # The workflow will run on schedule and labeled pull requests on: pull_request: @@ -109,7 +110,7 @@ jobs: git add ${{ env.RESULT_LIBRARY_TEST_FILE }} git commit -m "Generated External Libraries Test Results" git push - + event_file: name: "Event File" if: | From 81a1914eb6f3c1c173a46c3befb16ac8ae4e6aea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Procha=CC=81zka?= <90197375+P-R-O-C-H-Y@users.noreply.github.com> Date: Wed, 5 Apr 2023 13:20:49 +0200 Subject: [PATCH 05/10] Create TESTFILE.txt --- TESTFILE.txt | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 TESTFILE.txt diff --git a/TESTFILE.txt b/TESTFILE.txt new file mode 100644 index 00000000000..e69de29bb2d From d76467e23ca6180d38f3ddcfb335f8942a34d5c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Procha=CC=81zka?= <90197375+P-R-O-C-H-Y@users.noreply.github.com> Date: Wed, 5 Apr 2023 13:44:05 +0200 Subject: [PATCH 06/10] Update TESTFILE.txt --- TESTFILE.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/TESTFILE.txt b/TESTFILE.txt index e69de29bb2d..3b12464976a 100644 --- a/TESTFILE.txt +++ b/TESTFILE.txt @@ -0,0 +1 @@ +TEST \ No newline at end of file From 276ab0c43e9d982dca5ce7e5cfd0ceb438bff158 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Procha=CC=81zka?= <90197375+P-R-O-C-H-Y@users.noreply.github.com> Date: Thu, 6 Apr 2023 11:32:51 +0200 Subject: [PATCH 07/10] Update publishlib.yml --- .github/workflows/publishlib.yml | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/.github/workflows/publishlib.yml b/.github/workflows/publishlib.yml index 86a8268949a..e4c75aefe34 100644 --- a/.github/workflows/publishlib.yml +++ b/.github/workflows/publishlib.yml @@ -9,11 +9,9 @@ on: workflow_dispatch: env: # It's convenient to set variables for values used multiple times in the workflow - SKETCHES_REPORTS_PATH: libraries-report - SKETCHES_REPORTS_ARTIFACT_NAME: libraries-report - RESULT_LIBRARY_TEST_FILE: LIBRARIES_TEST.md - JSON_LIBRARY_LIST_FILE: .github/workflows/lib.json + SKETCHES_REPORTS_PATH: artifacts/libraries-report GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} + PR_EVENT_PATH: artifacts/Event File/event.json jobs: lib-test-results: @@ -21,20 +19,23 @@ jobs: runs-on: ubuntu-latest if: | github.event.workflow_run.event == 'pull_request' && - (github.event.workflow_run.conclusion == 'success' || - github.event.workflow_run.conclusion == 'failure') + github.event.workflow_run.conclusion == 'success' steps: - # This step is needed to get the size data produced by the compile jobs - - name: Download sketches reports artifact - uses: actions/download-artifact@v3 - with: - name: ${{ env.SKETCHES_REPORTS_ARTIFACT_NAME }} - path: ${{ env.SKETCHES_REPORTS_PATH }} - + - name: Download and Extract Artifacts + run: | + mkdir -p artifacts && cd artifacts + artifacts_url=${{ github.event.workflow_run.artifacts_url }} + gh api "$artifacts_url" -q '.artifacts[] | [.name, .archive_download_url] | @tsv' | while read artifact + do + IFS=$'\t' read name url <<< "$artifact" + gh api $url > "$name.zip" + unzip -d "$name" "$name.zip" + done + - name: Report results uses: P-R-O-C-H-Y/report-size-deltas@main with: sketches-reports-source: ${{ env.SKETCHES_REPORTS_PATH }} github-token: ${{ env.GITHUB_TOKEN }} - + pr-event-path: ${{ env.PR_EVENT_PATH }} From 1ef020a87d62d2033e1a70bef8b10b67075ff1aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Procha=CC=81zka?= <90197375+P-R-O-C-H-Y@users.noreply.github.com> Date: Thu, 6 Apr 2023 11:34:24 +0200 Subject: [PATCH 08/10] Return original lib.json --- .github/workflows/lib.json | 46 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/.github/workflows/lib.json b/.github/workflows/lib.json index 088e8c1c5ab..c237537bd38 100644 --- a/.github/workflows/lib.json +++ b/.github/workflows/lib.json @@ -5,5 +5,51 @@ "sketch_path": [ "~/Arduino/libraries/Adafruit_NeoPixel/examples/strandtest/strandtest.ino" ] + }, + { + "name": "ArduinoBLE", + "exclude_targets": [ + "esp32s2" + ], + "sketch_path": [ + "~/Arduino/libraries/ArduinoBLE/examples/Central/Scan/Scan.ino" + ] + }, + { + "name": "ESP32Servo", + "exclude_targets": [], + "sketch_path": [ + "~/Arduino/libraries/ESP32Servo/examples/Knob/Knob.ino", + "~/Arduino/libraries/ESP32Servo/examples/Sweep/Sweep.ino", + "~/Arduino/libraries/ESP32Servo/examples/PWMExample/PWMExample.ino", + "~/Arduino/libraries/ESP32Servo/examples/Multiple-Servo-Example-Arduino/Multiple-Servo-Example-Arduino.ino" + ] + }, + { + "source-url": "https://github.com/me-no-dev/ESPAsyncWebServer.git", + "required-libs": [ + {"source-url": "https://github.com/me-no-dev/AsyncTCP.git"} + ], + "exclude_targets": [], + "sketch_path": [ + "~/Arduino/libraries/ESPAsyncWebServer/examples/CaptivePortal/CaptivePortal.ino", + "~/Arduino/libraries/ESPAsyncWebServer/examples/ESP_AsyncFSBrowser/ESP_AsyncFSBrowser.ino", + "~/Arduino/libraries/ESPAsyncWebServer/examples/regex_patterns/regex_patterns.ino", + "~/Arduino/libraries/ESPAsyncWebServer/examples/simple_server/simple_server.ino" + ] + }, + { + "name": "FastLED", + "exclude_targets": [], + "sketch_path": [ + "~/Arduino/libraries/FastLED/examples/Blink/Blink.ino" + ] + }, + { + "name": "IRremote", + "exclude_targets": [], + "sketch_path": [ + "~/Arduino/libraries/IRremote/examples/SendDemo/SendDemo.ino" + ] } ] \ No newline at end of file From 49a09c38b3198533128f31c0e5e2d6471ed36d51 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Procha=CC=81zka?= <90197375+P-R-O-C-H-Y@users.noreply.github.com> Date: Thu, 6 Apr 2023 11:35:19 +0200 Subject: [PATCH 09/10] remove comment --- .github/workflows/lib.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/lib.yml b/.github/workflows/lib.yml index 1979440408a..a2b5cfc0a36 100644 --- a/.github/workflows/lib.yml +++ b/.github/workflows/lib.yml @@ -1,6 +1,5 @@ name: External Libraries Test -#add comment DBG # The workflow will run on schedule and labeled pull requests on: pull_request: From 6c52191ccfe062b8ce238f19bf0e0ef943903d5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Procha=CC=81zka?= <90197375+P-R-O-C-H-Y@users.noreply.github.com> Date: Thu, 6 Apr 2023 11:39:14 +0200 Subject: [PATCH 10/10] remove file --- .github/workflows/lib.yml | 2 +- TESTFILE.txt | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) delete mode 100644 TESTFILE.txt diff --git a/.github/workflows/lib.yml b/.github/workflows/lib.yml index a2b5cfc0a36..94e09c64d51 100644 --- a/.github/workflows/lib.yml +++ b/.github/workflows/lib.yml @@ -121,4 +121,4 @@ jobs: uses: actions/upload-artifact@v2 with: name: Event File - path: ${{github.event_path}} \ No newline at end of file + path: ${{github.event_path}} diff --git a/TESTFILE.txt b/TESTFILE.txt deleted file mode 100644 index 3b12464976a..00000000000 --- a/TESTFILE.txt +++ /dev/null @@ -1 +0,0 @@ -TEST \ No newline at end of file