Skip to content

Commit 30ab1c3

Browse files
authored
CI External Libraries Test - Results comment fix (espressif#8035)
* add new workflow * Update lib.yml * Update publishlib.yml * Update lib.yml * Create TESTFILE.txt * Update TESTFILE.txt * Update publishlib.yml * Return original lib.json * remove comment * remove file
1 parent 4cb596a commit 30ab1c3

File tree

3 files changed

+54
-18
lines changed

3 files changed

+54
-18
lines changed

Diff for: .github/workflows/lib.json

-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
[
22
{
33
"name": "Adafruit NeoPixel",
4-
"version": "1.10.6",
54
"exclude_targets": [],
65
"sketch_path": [
76
"~/Arduino/libraries/Adafruit_NeoPixel/examples/strandtest/strandtest.ino"

Diff for: .github/workflows/lib.yml

+13-17
Original file line numberDiff line numberDiff line change
@@ -72,23 +72,6 @@ jobs:
7272
name: ${{ env.SKETCHES_REPORTS_ARTIFACT_NAME }}
7373
path: ${{ env.SKETCHES_REPORTS_PATH }}
7474

75-
report-comment:
76-
needs: compile-sketch # Wait for the compile job to finish to get the data for the report
77-
if: github.event_name == 'pull_request' # Only run the job when the workflow is triggered by a pull request
78-
runs-on: ubuntu-latest
79-
steps:
80-
# This step is needed to get the size data produced by the compile jobs
81-
- name: Download sketches reports artifact
82-
uses: actions/download-artifact@v3
83-
with:
84-
name: ${{ env.SKETCHES_REPORTS_ARTIFACT_NAME }}
85-
path: ${{ env.SKETCHES_REPORTS_PATH }}
86-
87-
- name: Report results
88-
uses: P-R-O-C-H-Y/report-size-deltas@main
89-
with:
90-
sketches-reports-source: ${{ env.SKETCHES_REPORTS_PATH }}
91-
9275
report-to-file:
9376
needs: compile-sketch # Wait for the compile job to finish to get the data for the report
9477
if: github.event_name == 'schedule' # Only run the job when the workflow is triggered by a schedule
@@ -126,3 +109,16 @@ jobs:
126109
git add ${{ env.RESULT_LIBRARY_TEST_FILE }}
127110
git commit -m "Generated External Libraries Test Results"
128111
git push
112+
113+
event_file:
114+
name: "Event File"
115+
if: |
116+
contains(github.event.pull_request.labels.*.name, 'lib_test')
117+
needs: compile-sketch
118+
runs-on: ubuntu-latest
119+
steps:
120+
- name: Upload
121+
uses: actions/upload-artifact@v2
122+
with:
123+
name: Event File
124+
path: ${{github.event_path}}

Diff for: .github/workflows/publishlib.yml

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: External Libraries Results
2+
3+
on:
4+
workflow_run:
5+
workflows: [External Libraries Test]
6+
types:
7+
- completed
8+
9+
workflow_dispatch:
10+
env:
11+
# It's convenient to set variables for values used multiple times in the workflow
12+
SKETCHES_REPORTS_PATH: artifacts/libraries-report
13+
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
14+
PR_EVENT_PATH: artifacts/Event File/event.json
15+
16+
jobs:
17+
lib-test-results:
18+
name: External Libraries Test Results
19+
runs-on: ubuntu-latest
20+
if: |
21+
github.event.workflow_run.event == 'pull_request' &&
22+
github.event.workflow_run.conclusion == 'success'
23+
24+
steps:
25+
- name: Download and Extract Artifacts
26+
run: |
27+
mkdir -p artifacts && cd artifacts
28+
artifacts_url=${{ github.event.workflow_run.artifacts_url }}
29+
gh api "$artifacts_url" -q '.artifacts[] | [.name, .archive_download_url] | @tsv' | while read artifact
30+
do
31+
IFS=$'\t' read name url <<< "$artifact"
32+
gh api $url > "$name.zip"
33+
unzip -d "$name" "$name.zip"
34+
done
35+
36+
- name: Report results
37+
uses: P-R-O-C-H-Y/report-size-deltas@main
38+
with:
39+
sketches-reports-source: ${{ env.SKETCHES_REPORTS_PATH }}
40+
github-token: ${{ env.GITHUB_TOKEN }}
41+
pr-event-path: ${{ env.PR_EVENT_PATH }}

0 commit comments

Comments
 (0)