Skip to content

Commit 784b78d

Browse files
authored
Merge branch 'master' into ci/Update-wokwi-run-test-script
2 parents 373d2fe + f5be003 commit 784b78d

File tree

154 files changed

+5628
-905
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

154 files changed

+5628
-905
lines changed

Diff for: .github/ISSUE_TEMPLATE/Issue-report.yml

+2
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ body:
4141
options:
4242
- latest master (checkout manually)
4343
- latest development Release Candidate (RC-X)
44+
- v3.0.3
45+
- v3.0.2
4446
- v3.0.1
4547
- v3.0.0
4648
- v2.0.17

Diff for: .github/scripts/install-arduino-cli.sh

+7-1
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,12 @@ fi
4141
if [ ! -d "$ARDUINO_IDE_PATH" ] || [ ! -f "$ARDUINO_IDE_PATH/arduino-cli" ]; then
4242
echo "Installing Arduino CLI on $OS_NAME ..."
4343
mkdir -p "$ARDUINO_IDE_PATH"
44-
curl -fsSL https://raw.githubusercontent.com/arduino/arduino-cli/master/install.sh | BINDIR="$ARDUINO_IDE_PATH" sh
44+
if [ "$OS_IS_WINDOWS" == "1" ]; then
45+
curl -fsSL https://downloads.arduino.cc/arduino-cli/arduino-cli_latest_Windows_64bit.zip -o arduino-cli.zip
46+
unzip -q arduino-cli.zip -d "$ARDUINO_IDE_PATH"
47+
rm arduino-cli.zip
48+
else
49+
curl -fsSL https://raw.githubusercontent.com/arduino/arduino-cli/master/install.sh | BINDIR="$ARDUINO_IDE_PATH" sh
50+
fi
4551
fi
4652

Diff for: .github/scripts/install-arduino-core-esp32.sh

+5-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,11 @@ if [ ! -d "$ARDUINO_ESP32_PATH" ]; then
2828
#git submodule update --init --recursive > /dev/null 2>&1
2929

3030
echo "Installing Platform Tools ..."
31-
cd tools && python get.py
31+
if [ "$OS_IS_WINDOWS" == "1" ]; then
32+
cd tools && ./get.exe
33+
else
34+
cd tools && python get.py
35+
fi
3236
cd $script_init_path
3337

3438
echo "ESP32 Arduino has been installed in '$ARDUINO_ESP32_PATH'"

Diff for: .github/scripts/on-release.sh

+5-2
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,9 @@ else
192192
cp -Rf "$GITHUB_WORKSPACE/variants/${variant}" "$PKG_DIR/variants/"
193193
done
194194
fi
195+
cp -f "$GITHUB_WORKSPACE/CMakeLists.txt" "$PKG_DIR/"
196+
cp -f "$GITHUB_WORKSPACE/idf_component.yml" "$PKG_DIR/"
197+
cp -f "$GITHUB_WORKSPACE/Kconfig.projbuild" "$PKG_DIR/"
195198
cp -f "$GITHUB_WORKSPACE/package.json" "$PKG_DIR/"
196199
cp -f "$GITHUB_WORKSPACE/programmers.txt" "$PKG_DIR/"
197200
cp -Rf "$GITHUB_WORKSPACE/cores" "$PKG_DIR/"
@@ -421,12 +424,12 @@ fi
421424
# Upload package JSONs (temporary halted to fix json generation)
422425
echo "Uploading $PACKAGE_JSON_DEV ..."
423426
echo "Download URL: "`git_safe_upload_asset "$OUTPUT_DIR/$PACKAGE_JSON_DEV"`
424-
# echo "Pages URL: "`git_safe_upload_to_pages "$PACKAGE_JSON_DEV" "$OUTPUT_DIR/$PACKAGE_JSON_DEV"`
427+
echo "Pages URL: "`git_safe_upload_to_pages "$PACKAGE_JSON_DEV" "$OUTPUT_DIR/$PACKAGE_JSON_DEV"`
425428
echo
426429
if [ "$RELEASE_PRE" == "false" ]; then
427430
echo "Uploading $PACKAGE_JSON_REL ..."
428431
echo "Download URL: "`git_safe_upload_asset "$OUTPUT_DIR/$PACKAGE_JSON_REL"`
429-
# echo "Pages URL: "`git_safe_upload_to_pages "$PACKAGE_JSON_REL" "$OUTPUT_DIR/$PACKAGE_JSON_REL"`
432+
echo "Pages URL: "`git_safe_upload_to_pages "$PACKAGE_JSON_REL" "$OUTPUT_DIR/$PACKAGE_JSON_REL"`
430433
echo
431434
fi
432435

Diff for: .github/scripts/update-version.sh

+7
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,11 @@ sed "s/#define ESP_ARDUINO_VERSION_MAJOR.*/#define ESP_ARDUINO_VERSION_MAJOR $ES
3636
sed "s/#define ESP_ARDUINO_VERSION_MINOR.*/#define ESP_ARDUINO_VERSION_MINOR $ESP_ARDUINO_VERSION_MINOR/g" | \
3737
sed "s/#define ESP_ARDUINO_VERSION_PATCH.*/#define ESP_ARDUINO_VERSION_PATCH $ESP_ARDUINO_VERSION_PATCH/g" > __esp_arduino_version.h && mv __esp_arduino_version.h cores/esp32/esp_arduino_version.h
3838

39+
for lib in `ls libraries`; do
40+
if [ -f "libraries/$lib/library.properties" ]; then
41+
echo "Updating Library $lib..."
42+
cat "libraries/$lib/library.properties" | sed "s/version=.*/version=$ESP_ARDUINO_VERSION/g" > "libraries/$lib/__library.properties" && mv "libraries/$lib/__library.properties" "libraries/$lib/library.properties"
43+
fi
44+
done
45+
3946
exit 0

Diff for: .github/workflows/build_py_tools.yml

+15-11
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,11 @@ name: Build Python Tools
33
on:
44
pull_request:
55
paths:
6-
- 'tools/get.py'
7-
- 'tools/espota.py'
8-
- 'tools/gen_esp32part.py'
9-
- 'tools/gen_insights_package.py'
6+
- '.github/workflows/build_py_tools.yml'
7+
- 'tools/get.py'
8+
- 'tools/espota.py'
9+
- 'tools/gen_esp32part.py'
10+
- 'tools/gen_insights_package.py'
1011

1112
jobs:
1213
find-changed-tools:
@@ -21,6 +22,13 @@ jobs:
2122
with:
2223
fetch-depth: 2
2324
ref: ${{ github.event.pull_request.head.ref }}
25+
26+
- name: Check if checkout failed
27+
if: failure()
28+
run: |
29+
echo "Checkout failed."
30+
echo "Make sure you are using a branch inside the repository and not a fork."
31+
2432
- name: Verify Python Tools Changed
2533
uses: tj-actions/changed-files@v41
2634
id: verify-changed-files
@@ -47,7 +55,7 @@ jobs:
4755
strategy:
4856
fail-fast: false
4957
matrix:
50-
os: [windows-latest, macos-latest, ubuntu-20.04, ARM, ARM64]
58+
os: [windows-latest, macos-latest, ubuntu-20.04, ARM]
5159
include:
5260
- os: windows-latest
5361
TARGET: win64
@@ -63,10 +71,6 @@ jobs:
6371
CONTAINER: python:3.8-bullseye
6472
TARGET: arm
6573
SEPARATOR: ':'
66-
- os: ARM64
67-
CONTAINER: python:3.8-bullseye
68-
TARGET: arm64
69-
SEPARATOR: ':'
7074
container: ${{ matrix.CONTAINER }} # use python container on ARM
7175
env:
7276
DISTPATH: pytools-${{ matrix.TARGET }}
@@ -93,7 +97,7 @@ jobs:
9397
ref: ${{ github.event.pull_request.head.ref }}
9498
- name: Set up Python 3.8
9599
# Skip setting python on ARM because of missing compatibility: https://github.com/actions/setup-python/issues/108
96-
if: matrix.os != 'ARM' && matrix.os != 'ARM64'
100+
if: matrix.os != 'ARM'
97101
uses: actions/setup-python@master
98102
with:
99103
python-version: 3.8
@@ -108,7 +112,7 @@ jobs:
108112
pyinstaller --distpath ./${{ env.DISTPATH }} -F --icon=.github/pytools/espressif.ico tools/$tool.py
109113
done
110114
- name: Sign binaries
111-
if: matrix.os == 'windows-latest' && env.CERTIFICATE != '' && env.CERTIFICATE_PASSWORD != ''
115+
if: matrix.os == 'windows-latest'
112116
env:
113117
CERTIFICATE: ${{ secrets.CERTIFICATE }}
114118
CERTIFICATE_PASSWORD: ${{ secrets.CERTIFICATE_PASSWORD }}

Diff for: .github/workflows/tests.yml

+35-102
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,29 @@
1+
# This file is used to run the runtime tests for the Arduino core for ESP32.
2+
# The tests are run on the hardware, Wokwi and QEMU emulators.
3+
# The QEMU tests are disabled for now as they are redundant with most of the Wokwi tests.
4+
# As the Wokwi tests require access to secrets, they are run in a separate workflow.
5+
# We need to ensure that the artifacts from previous tests in the chain are propagated for publishing the results.
6+
# This is the current trigger sequence for the tests:
7+
# tests.yml -> tests_wokwi.yml -> tests_results.yml
8+
# ⌙> tests_build.yml
9+
# ⌙> tests_hw.yml
10+
# ⌙> tests_qemu.yml
11+
112
name: Runtime Tests
213

314
on:
415
workflow_dispatch:
5-
pull_request_target:
16+
pull_request:
617
types: [opened, reopened, closed, synchronize, labeled, unlabeled]
718
paths:
19+
- '.github/workflows/tests*'
20+
- '.github/scripts/*.sh'
21+
- '!.github/scripts/check-cmakelists.sh'
22+
- '!.github/scripts/find_*'
23+
- '!.github/scripts/on-*.sh'
24+
- '!.github/scripts/set_push_chunks.sh'
25+
- '!.github/scripts/update-version.sh'
26+
- '!.github/scripts/upload_py_tools.sh'
827
- 'tests/**'
928
- 'cores/**'
1029
- 'libraries/**'
@@ -19,14 +38,19 @@ concurrency:
1938
group: tests-${{ github.event.pull_request.number || github.ref }}
2039
cancel-in-progress: true
2140

22-
# To avoid giving elevated permissions to the entire workflow, specify default permissions at the top level
23-
# and then override them for specific jobs.
24-
permissions: { contents: read }
25-
2641
jobs:
42+
push-event-file:
43+
name: Push event file
44+
runs-on: ubuntu-latest
45+
steps:
46+
- name: Upload
47+
uses: actions/upload-artifact@v4
48+
with:
49+
name: event_file
50+
path: ${{ github.event_path }}
51+
2752
gen-matrix:
2853
name: Generate matrix
29-
if: github.event.action != 'closed'
3054
runs-on: ubuntu-latest
3155
outputs:
3256
build-types: ${{ steps.set-matrix.outputs.build-types }}
@@ -59,9 +83,8 @@ jobs:
5983
6084
call-build-tests:
6185
name: Build
62-
uses: espressif/arduino-esp32/.github/workflows/build_tests.yml@master
86+
uses: ./.github/workflows/tests_build.yml
6387
needs: gen-matrix
64-
if: github.event.action != 'closed'
6588
strategy:
6689
matrix:
6790
type: ${{ fromJson(needs.gen-matrix.outputs.build-types) }}
@@ -72,11 +95,11 @@ jobs:
7295

7396
call-hardware-tests:
7497
name: Hardware
75-
uses: espressif/arduino-esp32/.github/workflows/hw.yml@master
98+
uses: ./.github/workflows/tests_hw.yml
7699
needs: [gen-matrix, call-build-tests]
77100
if: |
78101
github.repository == 'espressif/arduino-esp32' &&
79-
(github.event_name != 'pull_request_target' ||
102+
(github.event_name != 'pull_request' ||
80103
contains(github.event.pull_request.labels.*.name, 'hil_test'))
81104
strategy:
82105
fail-fast: false
@@ -87,26 +110,10 @@ jobs:
87110
type: ${{ matrix.type }}
88111
chip: ${{ matrix.chip }}
89112

90-
call-wokwi-tests:
91-
name: Wokwi
92-
uses: espressif/arduino-esp32/.github/workflows/wokwi.yml@master
93-
needs: [gen-matrix, call-build-tests]
94-
if: github.event.action != 'closed'
95-
strategy:
96-
fail-fast: false
97-
matrix:
98-
type: ${{ fromJson(needs.gen-matrix.outputs.wokwi-types) }}
99-
chip: ['esp32', 'esp32s2', 'esp32s3', 'esp32c3', 'esp32c6', 'esp32h2']
100-
secrets:
101-
WOKWI_CLI_TOKEN: ${{ secrets.WOKWI_CLI_TOKEN }}
102-
with:
103-
type: ${{ matrix.type }}
104-
chip: ${{ matrix.chip }}
105-
106113
# This job is disabled for now
107114
call-qemu-tests:
108115
name: QEMU
109-
uses: espressif/arduino-esp32/.github/workflows/qemu.yml@master
116+
uses: ./.github/workflows/tests_qemu.yml
110117
needs: [gen-matrix, call-build-tests]
111118
if: false
112119
strategy:
@@ -118,78 +125,4 @@ jobs:
118125
type: ${{ matrix.type }}
119126
chip: ${{ matrix.chip }}
120127

121-
unit-test-results:
122-
name: Unit Test Results
123-
needs: [call-hardware-tests, call-wokwi-tests, call-qemu-tests]
124-
if: always() && github.event_name == 'pull_request_target'
125-
runs-on: ubuntu-latest
126-
permissions:
127-
checks: write
128-
pull-requests: write
129-
steps:
130-
- name: Download and Extract HW Artifacts
131-
uses: actions/download-artifact@v4
132-
continue-on-error: true
133-
with:
134-
merge-multiple: true
135-
pattern: tests-results-hw-*
136-
path: ./results/hw
137-
138-
- name: Download and Extract Wokwi Artifacts
139-
uses: actions/download-artifact@v4
140-
continue-on-error: true
141-
with:
142-
merge-multiple: true
143-
pattern: tests-results-wokwi-*
144-
path: ./results/wokwi
145-
146-
- name: Download and Extract QEMU Artifacts
147-
uses: actions/download-artifact@v4
148-
continue-on-error: true
149-
with:
150-
merge-multiple: true
151-
pattern: tests-results-qemu-*
152-
path: ./results/qemu
153-
154-
- name: Publish Unit Test Results
155-
uses: EnricoMi/publish-unit-test-result-action@v2
156-
with:
157-
commit: ${{ github.event.pull_request.head.sha || github.sha }}
158-
files: ./results/**/*.xml
159-
clean:
160-
name: Clean objects
161-
needs: unit-test-results
162-
if: always()
163-
permissions:
164-
actions: write
165-
runs-on: ubuntu-latest
166-
steps:
167-
- name: Clean up caches
168-
uses: actions/github-script@v7
169-
with:
170-
script: |
171-
const ref = '${{ github.event.pull_request.number || github.ref }}';
172-
const key_prefix = 'tests-' + ref + '-';
173-
174-
if ('${{ github.event_name }}' == 'pull_request_target' && '${{ github.event.action }}' != 'closed') {
175-
console.log('Skipping cache cleanup for open PR');
176-
return;
177-
}
178-
179-
await github.paginate(github.rest.actions.getActionsCacheList, {
180-
owner: context.repo.owner,
181-
repo: context.repo.repo,
182-
per_page: 100,
183-
key: key_prefix
184-
}).then(caches => {
185-
if (caches) {
186-
for (const cache of caches) {
187-
console.log(`Deleting cache: ${cache.key}`);
188-
github.rest.actions.deleteActionsCacheById({
189-
owner: context.repo.owner,
190-
repo: context.repo.repo,
191-
cache_id: cache.id
192-
});
193-
}
194-
}
195-
});
128+
# Wokwi tests are run after this workflow as it needs access to secrets

Diff for: .github/workflows/build_tests.yml renamed to .github/workflows/tests_build.yml

+2-17
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ jobs:
2020
id: ${{ github.event.pull_request.number || github.ref }}-${{ github.event.pull_request.head.sha || github.sha }}-${{ inputs.chip }}-${{ inputs.type }}
2121
steps:
2222
- name: Check if already built
23-
if: ${{ github.event.pull_request.number != null }}
2423
id: cache-build-binaries
24+
if: github.event.pull_request.number != null
2525
uses: actions/cache/restore@v4
2626
with:
2727
key: tests-${{ env.id }}-bin
@@ -46,21 +46,6 @@ jobs:
4646
- name: Checkout user repository
4747
if: ${{ steps.check-build.outputs.enabled == 'true' }}
4848
uses: actions/checkout@v4
49-
with:
50-
ref: ${{ github.event.pull_request.head.sha || github.sha }}
51-
persist-credentials: false
52-
sparse-checkout-cone-mode: false
53-
sparse-checkout: |
54-
/*
55-
!.github
56-
57-
# To avoid giving unknown scripts elevated permissions, download them from the master branch
58-
- name: Get CI scripts from master
59-
if: ${{ steps.check-build.outputs.enabled == 'true' }}
60-
run: |
61-
mkdir -p .github
62-
cd .github
63-
curl https://codeload.github.com/${{ github.repository }}/tar.gz/master | tar -xz --strip=2 arduino-esp32-master/.github
6449

6550
- name: Get libs cache
6651
uses: actions/cache@v4
@@ -83,7 +68,7 @@ jobs:
8368
8469
- name: Upload ${{ inputs.chip }} ${{ inputs.type }} binaries as cache
8570
uses: actions/cache/save@v4
86-
if: ${{ steps.check-build.outputs.enabled == 'true' }}
71+
if: steps.check-build.outputs.enabled == 'true' && github.event.pull_request.number != null
8772
with:
8873
key: tests-${{ env.id }}-bin
8974
path: |

0 commit comments

Comments
 (0)