CI External Libraries Test - Results comment fix (#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
This commit is contained in:
parent
4cb596a5ff
commit
30ab1c3cb5
3 changed files with 54 additions and 18 deletions
1
.github/workflows/lib.json
vendored
1
.github/workflows/lib.json
vendored
|
|
@ -1,7 +1,6 @@
|
|||
[
|
||||
{
|
||||
"name": "Adafruit NeoPixel",
|
||||
"version": "1.10.6",
|
||||
"exclude_targets": [],
|
||||
"sketch_path": [
|
||||
"~/Arduino/libraries/Adafruit_NeoPixel/examples/strandtest/strandtest.ino"
|
||||
|
|
|
|||
30
.github/workflows/lib.yml
vendored
30
.github/workflows/lib.yml
vendored
|
|
@ -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}}
|
||||
|
|
|
|||
41
.github/workflows/publishlib.yml
vendored
Normal file
41
.github/workflows/publishlib.yml
vendored
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
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: artifacts/libraries-report
|
||||
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
|
||||
PR_EVENT_PATH: artifacts/Event File/event.json
|
||||
|
||||
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'
|
||||
|
||||
steps:
|
||||
- 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 }}
|
||||
Loading…
Reference in a new issue