forked from espressif/arduino-esp32
-
Notifications
You must be signed in to change notification settings - Fork 2
128 lines (111 loc) · 4.24 KB
/
lib.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
name: External Libraries Test
# The workflow will run on schedule and labeled pull requests
on:
pull_request:
types: [opened, reopened, synchronize, labeled]
# Schedule weekly builds on every Sunday at 4 am
schedule:
- cron: '0 4 * * SUN'
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
jobs:
compile-sketch:
if: |
contains(github.event.pull_request.labels.*.name, 'lib_test') ||
(github.event_name == 'schedule' && github.repository == 'espressif/arduino-esp32')
runs-on: ubuntu-latest
env:
REPOSITORY: |
- source-path: '.'
name: "espressif:esp32"
strategy:
matrix:
target:
- esp32
- esp32s2
- esp32c3
- esp32s3
include:
- target: esp32
fqbn: espressif:esp32:esp32
- target: esp32s2
fqbn: espressif:esp32:esp32s2
- target: esp32c3
fqbn: espressif:esp32:esp32c3
- target: esp32s3
fqbn: espressif:esp32:esp32s3
steps:
# This step makes the contents of the repository available to the workflow
- name: Checkout repository
uses: actions/checkout@v3
- name: Compile sketch
uses: P-R-O-C-H-Y/compile-sketches@main
with:
platforms: |
${{ env.REPOSITORY }}
target: ${{ matrix.target }}
fqbn: ${{ matrix.fqbn }}
use-json-file: true
json-path: ${{ env.JSON_LIBRARY_LIST_FILE }}
enable-deltas-report: true
sketches-report-path: ${{ env.SKETCHES_REPORTS_PATH }}
enable-warnings-report: true
cli-compile-flags: |
- --warnings="all"
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
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
runs-on: ubuntu-latest
steps:
# Check out repository
- name: Checkout repository
uses: actions/checkout@v3
# 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 }}
destination-file: ${{ env.RESULT_LIBRARY_TEST_FILE }}
- name: Append file with action URL
uses: DamianReeves/write-file-action@master
with:
path: ${{ env.RESULT_LIBRARY_TEST_FILE }}
contents: |
/ [GitHub Action Link](https://github.com/${{github.repository}}/actions/runs/${{github.run_id}})
write-mode: append
- name: Push to github repo
run: |
git config user.name github-actions
git config user.email [email protected]
git add ${{ env.RESULT_LIBRARY_TEST_FILE }}
git commit -m "Generated External Libraries Test Results"
git push