Skip to content

Commit 11689f5

Browse files
authored
Merge branch 'master' into master
2 parents a25c379 + ead6c1c commit 11689f5

File tree

8 files changed

+78
-26
lines changed

8 files changed

+78
-26
lines changed

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
## Description of Change
1414
Please describe your proposed Pull Request and it's impact.
1515

16-
## Tests scenarios
16+
## Test Scenarios
1717
Please describe on what Hardware and Software combinations you have tested this Pull Request and how.
1818

1919
(*eg. I have tested my Pull Request on Arduino-esp32 core v2.0.2 with ESP32 and ESP32-S2 Board with this scenario*)

.github/workflows/tests.yml

Lines changed: 41 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ on:
2828
- "!*.md"
2929
- "!*.properties"
3030
schedule:
31-
- cron: "0 2 * * *"
31+
- cron: "0 0 * * *"
3232

3333
concurrency:
3434
group: tests-${{ github.event.pull_request.number || github.ref }}
@@ -45,9 +45,49 @@ jobs:
4545
name: event_file
4646
path: ${{ github.event_path }}
4747

48+
check-last-run:
49+
name: Check last run
50+
runs-on: ubuntu-latest
51+
outputs:
52+
run_tests: ${{ steps.last-run.outputs.run_tests }}
53+
steps:
54+
- name: Checkout
55+
if: github.event_name != 'pull_request'
56+
# if: github.event_name == 'schedule'
57+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
58+
with:
59+
ref: gh-pages
60+
61+
- name: Get last run commit and compare with current commit
62+
id: last-run
63+
run: |
64+
if [ ${{ github.event_name }} != 'pull_request' ]; then
65+
# if [ ${{ github.event_name }} == 'schedule' ]; then
66+
if [ -f ./runtime-test-results/test_results.json ]; then
67+
last_run_commit=$(jq -r '.commit_sha' ./runtime-test-results/test_results.json)
68+
last_run_failed=$(jq -r '.tests_failed' ./runtime-test-results/test_results.json)
69+
else
70+
last_run_commit="none"
71+
last_run_failed="true"
72+
fi
73+
current_commit=${{ github.sha }}
74+
if [ "$last_run_commit" == "$current_commit" ] && [ "$last_run_failed" == "false" ]; then
75+
echo "Last run commit and current commit are the same. Skipping tests..."
76+
echo "run_tests=false" >> $GITHUB_OUTPUT
77+
else
78+
echo "Last run commit and current commit are different or last run failed. Running tests..."
79+
echo "run_tests=true" >> $GITHUB_OUTPUT
80+
fi
81+
else
82+
echo "Not a schedule event. Continuing..."
83+
echo "run_tests=true" >> $GITHUB_OUTPUT
84+
fi
85+
4886
gen-matrix:
4987
name: Generate matrix
5088
runs-on: ubuntu-latest
89+
if: ${{ needs.check-last-run.outputs.run_tests }}
90+
needs: check-last-run
5191
outputs:
5292
build-types: ${{ steps.set-matrix.outputs.build-types }}
5393
hw-types: ${{ steps.set-matrix.outputs.hw-types }}

.github/workflows/tests_build.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
if: github.event.pull_request.number != null
2525
uses: actions/cache/restore@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
2626
with:
27-
key: tests-${{ env.id }}-bin
27+
key: test-${{ env.id }}-bin
2828
path: |
2929
~/.arduino/tests/${{ inputs.chip }}/**/build*.tmp/*.bin
3030
~/.arduino/tests/${{ inputs.chip }}/**/build*.tmp/*.elf
@@ -71,7 +71,7 @@ jobs:
7171
uses: actions/cache/save@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
7272
if: steps.check-build.outputs.enabled == 'true' && github.event.pull_request.number != null
7373
with:
74-
key: tests-${{ env.id }}-bin
74+
key: test-${{ env.id }}-bin
7575
path: |
7676
~/.arduino/tests/${{ inputs.chip }}/**/build*.tmp/*.bin
7777
~/.arduino/tests/${{ inputs.chip }}/**/build*.tmp/*.elf
@@ -81,7 +81,7 @@ jobs:
8181
- name: Upload ${{ inputs.chip }} ${{ inputs.type }} binaries as artifacts
8282
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
8383
with:
84-
name: tests-bin-${{ inputs.chip }}-${{ inputs.type }}
84+
name: test-bin-${{ inputs.chip }}-${{ inputs.type }}
8585
overwrite: true
8686
path: |
8787
~/.arduino/tests/${{ inputs.chip }}/**/build*.tmp/*.bin

.github/workflows/tests_hw.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939
if: github.event.pull_request.number != null
4040
uses: actions/cache/restore@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
4141
with:
42-
key: tests-${{ env.id }}-results-hw
42+
key: test-${{ env.id }}-results-hw
4343
path: |
4444
tests/**/*.xml
4545
tests/**/result_*.json
@@ -61,6 +61,7 @@ jobs:
6161
if: ${{ steps.check-tests.outputs.enabled == 'true' }}
6262
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
6363
with:
64+
# Workaround for missing files in checkout
6465
sparse-checkout: |
6566
*
6667
@@ -84,7 +85,7 @@ jobs:
8485
if: ${{ steps.check-tests.outputs.enabled == 'true' }}
8586
uses: actions/download-artifact@95815c38cf2ff2164869cbab79da8d1f422bc89e # v4.2.1
8687
with:
87-
name: tests-bin-${{ inputs.chip }}-${{ inputs.type }}
88+
name: test-bin-${{ inputs.chip }}-${{ inputs.type }}
8889
path: |
8990
~/.arduino/tests/${{ inputs.chip }}
9091
@@ -102,7 +103,7 @@ jobs:
102103
uses: actions/cache/save@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
103104
if: steps.check-tests.outputs.enabled == 'true' && github.event.pull_request.number != null
104105
with:
105-
key: tests-${{ env.id }}-results-hw
106+
key: test-${{ env.id }}-results-hw
106107
path: |
107108
tests/**/*.xml
108109
tests/**/result_*.json
@@ -111,7 +112,7 @@ jobs:
111112
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
112113
if: always()
113114
with:
114-
name: tests-results-hw-${{ inputs.chip }}-${{ inputs.type }}
115+
name: test-results-hw-${{ inputs.chip }}-${{ inputs.type }}
115116
overwrite: true
116117
path: |
117118
tests/**/*.xml

.github/workflows/tests_qemu.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
if: github.event.pull_request.number != null
2424
uses: actions/cache/restore@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
2525
with:
26-
key: tests-${{ env.id }}-results-qemu
26+
key: test-${{ env.id }}-results-qemu
2727
path: |
2828
tests/**/*.xml
2929
tests/**/result_*.json
@@ -115,7 +115,7 @@ jobs:
115115
if: ${{ steps.check-tests.outputs.enabled == 'true' }}
116116
uses: actions/download-artifact@95815c38cf2ff2164869cbab79da8d1f422bc89e # v4.2.1
117117
with:
118-
name: tests-bin-${{ inputs.chip }}-${{ inputs.type }}
118+
name: test-bin-${{ inputs.chip }}-${{ inputs.type }}
119119
path: |
120120
~/.arduino/tests/${{ inputs.chip }}
121121
@@ -127,7 +127,7 @@ jobs:
127127
uses: actions/cache/save@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
128128
if: steps.check-tests.outputs.enabled == 'true' && github.event.pull_request.number != null
129129
with:
130-
key: tests-${{ env.id }}-results-qemu
130+
key: test-${{ env.id }}-results-qemu
131131
path: |
132132
tests/**/*.xml
133133
tests/**/result_*.json
@@ -136,7 +136,7 @@ jobs:
136136
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
137137
if: always()
138138
with:
139-
name: tests-results-qemu-${{ inputs.chip }}-${{ inputs.type }}
139+
name: test-results-qemu-${{ inputs.chip }}-${{ inputs.type }}
140140
overwrite: true
141141
path: |
142142
tests/**/*.xml

.github/workflows/tests_results.yml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ jobs:
113113
with:
114114
script: |
115115
const ref = process.env.original_ref;
116-
const key_prefix = 'tests-' + ref + '-';
116+
const key_prefix = 'test-' + ref + '-';
117117
118118
if (process.env.original_event == 'pull_request' && process.env.original_action != 'closed') {
119119
console.log('Skipping cache cleanup for open PR');
@@ -163,23 +163,24 @@ jobs:
163163
- name: Generate report
164164
if: ${{ !cancelled() && (env.original_event == 'schedule' || env.original_event == 'workflow_dispatch') }} # codespell:ignore cancelled
165165
env:
166-
REPORT_FILE: ./runtime-tests-results/RUNTIME_TESTS_REPORT.md
166+
REPORT_FILE: ./runtime-test-results/RUNTIME_TESTS_REPORT.md
167167
WOKWI_RUN_ID: ${{ github.event.workflow_run.id }}
168168
BUILD_RUN_ID: ${{ env.original_run_id }}
169169
IS_FAILING: ${{ env.original_conclusion == 'failure' || env.original_conclusion == 'timed_out' || github.event.workflow_run.conclusion == 'failure' || github.event.workflow_run.conclusion == 'timed_out' || job.status == 'failure' }}
170170
run: |
171171
rm -rf artifacts $REPORT_FILE
172-
mv -f ./unity_results.json ./runtime-tests-results/unity_results.json
172+
mv -f ./unity_results.json ./runtime-test-results/unity_results.json
173173
touch $REPORT_FILE
174-
python3 ./runtime-tests-results/table_generator.py ./runtime-tests-results/unity_results.json >> $REPORT_FILE
174+
python3 ./runtime-test-results/table_generator.py ./runtime-test-results/unity_results.json >> $REPORT_FILE
175+
mv -f ./test_results.json ./runtime-test-results/test_results.json
175176
176177
- name: Generate badge
177178
if: ${{ !cancelled() && (env.original_event == 'schedule' || env.original_event == 'workflow_dispatch') }} # codespell:ignore cancelled
178179
uses: jaywcjlove/generated-badges@0e078ae4d4bab3777ea4f137de496ab44688f5ad # v1.0.13
179180
with:
180181
label: Runtime Tests
181182
status: ${{ job.status == 'success' && 'passing' || 'failing' }}
182-
output: runtime-tests-results/badge.svg
183+
output: runtime-test-results/badge.svg
183184
color: ${{ job.status == 'success' && 'green' || 'red' }}
184185
style: flat
185186

@@ -190,6 +191,6 @@ jobs:
190191
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
191192
if [[ `git status --porcelain` ]]; then
192193
git add --all
193-
git commit -m "Updated runtime tests report"
194+
git commit -m "Updated runtime test results"
194195
git push origin HEAD:gh-pages
195196
fi

.github/workflows/tests_wokwi.yml

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -135,17 +135,27 @@ jobs:
135135
with:
136136
github-token: ${{ secrets.GITHUB_TOKEN }}
137137
run-id: ${{ github.event.workflow_run.id }}
138-
pattern: tests-results-hw-*
138+
pattern: test-results-hw-*
139139
merge-multiple: true
140140
path: artifacts/results/hw
141141

142+
- name: Download and extract parent GitLab results
143+
uses: actions/download-artifact@95815c38cf2ff2164869cbab79da8d1f422bc89e # v4.2.1
144+
continue-on-error: true
145+
with:
146+
github-token: ${{ secrets.GITHUB_TOKEN }}
147+
run-id: ${{ github.event.workflow_run.id }}
148+
pattern: test-results-gitlab
149+
merge-multiple: true
150+
path: artifacts/results/gitlab
151+
142152
- name: Download and extract parent QEMU results
143153
uses: actions/download-artifact@95815c38cf2ff2164869cbab79da8d1f422bc89e # v4.2.1
144154
continue-on-error: true
145155
with:
146156
github-token: ${{ secrets.GITHUB_TOKEN }}
147157
run-id: ${{ github.event.workflow_run.id }}
148-
pattern: tests-results-qemu-*
158+
pattern: test-results-qemu-*
149159
merge-multiple: true
150160
path: artifacts/results/qemu
151161

@@ -221,7 +231,7 @@ jobs:
221231
if: needs.get-artifacts.outputs.pr_num
222232
uses: actions/cache/restore@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
223233
with:
224-
key: tests-${{ env.id }}-results-wokwi
234+
key: test-${{ env.id }}-results-wokwi
225235
path: |
226236
tests/**/*.xml
227237
tests/**/result_*.json
@@ -274,7 +284,7 @@ jobs:
274284
with:
275285
github-token: ${{ secrets.GITHUB_TOKEN }}
276286
run-id: ${{ github.event.workflow_run.id }}
277-
name: tests-bin-${{ matrix.chip }}-${{ matrix.type }}
287+
name: test-bin-${{ matrix.chip }}-${{ matrix.type }}
278288
path: |
279289
~/.arduino/tests/${{ matrix.chip }}
280290
@@ -289,7 +299,7 @@ jobs:
289299
uses: actions/cache/save@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
290300
if: steps.check-tests.outputs.enabled == 'true' && needs.get-artifacts.outputs.pr_num
291301
with:
292-
key: tests-${{ env.id }}-results-wokwi
302+
key: test-${{ env.id }}-results-wokwi
293303
path: |
294304
tests/**/*.xml
295305
tests/**/result_*.json
@@ -298,7 +308,7 @@ jobs:
298308
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
299309
if: always()
300310
with:
301-
name: tests-results-wokwi-${{ matrix.chip }}-${{ matrix.type }}
311+
name: test-results-wokwi-${{ matrix.chip }}-${{ matrix.type }}
302312
overwrite: true
303313
path: |
304314
tests/**/*.xml

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
[![Build Status](https://img.shields.io/github/actions/workflow/status/espressif/arduino-esp32/push.yml?branch=master&event=push&label=Compilation%20Tests)](https://github.com/espressif/arduino-esp32/actions/workflows/push.yml?query=branch%3Amaster+event%3Apush)
44
[![Verbose Build Status](https://img.shields.io/github/actions/workflow/status/espressif/arduino-esp32/push.yml?branch=master&event=schedule&label=Compilation%20Tests%20(Verbose))](https://github.com/espressif/arduino-esp32/actions/workflows/push.yml?query=branch%3Amaster+event%3Aschedule)
55
[![External Libraries Test](https://img.shields.io/github/actions/workflow/status/espressif/arduino-esp32/lib.yml?branch=master&event=schedule&label=External%20Libraries%20Test)](https://github.com/espressif/arduino-esp32/blob/gh-pages/LIBRARIES_TEST.md)
6-
[![Runtime Tests](https://github.com/espressif/arduino-esp32/blob/gh-pages/runtime-tests-results/badge.svg)](https://github.com/espressif/arduino-esp32/blob/gh-pages/runtime-tests-results/RUNTIME_TESTS_REPORT.md)
6+
[![Runtime Tests](https://github.com/espressif/arduino-esp32/blob/gh-pages/runtime-test-results/badge.svg)](https://github.com/espressif/arduino-esp32/blob/gh-pages/runtime-test-results/RUNTIME_TEST_RESULTS.md)
77

88
### Need help or have a question? Join the chat at [Discord](https://discord.gg/8xY6e9crwv) or [open a new Discussion](https://github.com/espressif/arduino-esp32/discussions)
99

0 commit comments

Comments
 (0)