Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci(pre-commit): Bump hooks versions and fix leftover files #10680

Merged
merged 3 commits into from
Dec 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions .github/ISSUE_TEMPLATE/Issue-report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ body:
- type: markdown
attributes:
value: |
* Before reporting a new issue please check and search in [List of existing issues](https://github.com/espressif/arduino-esp32/issues?q=is%3Aissue)
* Before reporting a new issue please check and search in [List of existing issues](https://github.com/espressif/arduino-esp32/issues?q=is%3Aissue)
* Please check [Online Documentation](https://docs.espressif.com/projects/arduino-esp32/en/latest/index.html)
* Take a look on [Troubleshooting guide](https://docs.espressif.com/projects/arduino-esp32/en/latest/troubleshooting.html)
* If still experiencing the issue, please provide as many details as possible below about your hardware, computer setup and code.
Expand All @@ -24,7 +24,7 @@ body:
description: What development board or other hardware is the chip attached to?
placeholder: ex. DevKitC, plain module on breadboard, etc. If your hardware is custom or unusual, please attach a photo.
validations:
required: true
required: true
- type: textarea
id: other-hw
attributes:
Expand Down Expand Up @@ -60,7 +60,7 @@ body:
- v2.0.8
- v2.0.7
- v2.0.6
- v2.0.5
- v2.0.5
- v2.0.4
- v2.0.3
- v2.0.2
Expand All @@ -77,7 +77,7 @@ body:
description: What IDE are you using?
placeholder: eg. Arduino IDE, PlatformIO, Sloeber...
validations:
required: true
required: true
- type: input
id: os
attributes:
Expand All @@ -95,13 +95,13 @@ body:
validations:
required: true
- type: dropdown
id: PSRAM
id: PSRAM
attributes:
label: PSRAM enabled
description: Is PSRAM enabled?
options:
- 'yes'
- 'no'
- "yes"
- "no"
validations:
required: true
- type: input
Expand All @@ -116,8 +116,8 @@ body:
id: Description
attributes:
label: Description
description: Please describe your problem here and expected behaviour
placeholder: ex. Can't connect/weird behaviour/wrong function/missing parameter..
description: Please describe your problem here and expected behavior
placeholder: ex. Can't connect/weird behavior/wrong function/missing parameter..
validations:
required: true
- type: textarea
Expand All @@ -128,7 +128,7 @@ body:
placeholder: ex. Related part of the code to replicate the issue
render: cpp
validations:
required: true
required: true
- type: textarea
id: Debug
attributes:
Expand All @@ -137,11 +137,11 @@ body:
placeholder: Enable Core debug level - Debug on tools menu of Arduino IDE, then put the serial output here.
render: plain
validations:
required: true
required: true
- type: textarea
id: other-remarks
attributes:
label: Other Steps to Reproduce
label: Other Steps to Reproduce
description: Is there any other information you can think of which will help us reproduce this problem? Any additional info can be added as well.
placeholder: ex. I also tried on other OS, HW...it works correctly on that setup.
- type: checkboxes
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ contact_links:
about: Community channel for questions and help
- name: ESP32 Forum - Arduino
url: https://esp32.com/viewforum.php?f=19
about: Official Forum for questions
about: Official Forum for questions
78 changes: 46 additions & 32 deletions .github/scripts/merge_packages.py
Original file line number Diff line number Diff line change
@@ -1,50 +1,58 @@
#!/usr/bin/env python

# This script merges two Arduino Board Manager package json files.
# Usage:
# python merge_packages.py package_esp8266com_index.json version/new/package_esp8266com_index.json
# Written by Ivan Grokhotkov, 2015
#

from __future__ import print_function
#from distutils.version import LooseVersion

# from distutils.version import LooseVersion
from packaging.version import Version
import re
import json
import sys


def load_package(filename):
pkg = json.load(open(filename))['packages'][0]
print("Loaded package {0} from {1}".format(pkg['name'], filename), file=sys.stderr)
print("{0} platform(s), {1} tools".format(len(pkg['platforms']), len(pkg['tools'])), file=sys.stderr)
pkg = json.load(open(filename))["packages"][0]
print("Loaded package {0} from {1}".format(pkg["name"], filename), file=sys.stderr)
print("{0} platform(s), {1} tools".format(len(pkg["platforms"]), len(pkg["tools"])), file=sys.stderr)
return pkg


def merge_objects(versions, obj):
for o in obj:
name = o['name'].encode('ascii')
ver = o['version'].encode('ascii')
if not name in versions:
name = o["name"].encode("ascii")
ver = o["version"].encode("ascii")
if name not in versions:
print("found new object, {0}".format(name), file=sys.stderr)
versions[name] = {}
if not ver in versions[name]:
if ver not in versions[name]:
print("found new version {0} for object {1}".format(ver, name), file=sys.stderr)
versions[name][ver] = o
return versions

# Normalize ESP release version string (x.x.x) by adding '-rc<MAXINT>' (x.x.x-rc9223372036854775807) to ensure having REL above any RC
# Dummy approach, functional anyway for current ESP package versioning (unlike NormalizedVersion/LooseVersion/StrictVersion & similar crap)

# Normalize ESP release version string (x.x.x) by adding '-rc<MAXINT>' (x.x.x-rc9223372036854775807)
# to ensure having REL above any RC
# Dummy approach, functional anyway for current ESP package versioning
# (unlike NormalizedVersion/LooseVersion/StrictVersion & similar crap)
def pkgVersionNormalized(versionString):

verStr = str(versionString)
verParts = re.split('\.|-rc|-alpha', verStr, flags=re.IGNORECASE)
verParts = re.split(r"\.|-rc|-alpha", verStr, flags=re.IGNORECASE)

if len(verParts) == 3:
if (sys.version_info > (3, 0)): # Python 3
verStr = str(versionString) + '-rc' + str(sys.maxsize)
else: # Python 2
verStr = str(versionString) + '-rc' + str(sys.maxint)
if sys.version_info > (3, 0): # Python 3
verStr = str(versionString) + "-rc" + str(sys.maxsize)
else: # Python 2
verStr = str(versionString) + "-rc" + str(sys.maxint)

elif len(verParts) != 4:
print("pkgVersionNormalized WARNING: unexpected version format: {0})".format(verStr), file=sys.stderr)

return verStr


Expand All @@ -54,31 +62,37 @@ def main(args):
return 1

tools = {}
platforms = {}
platforms = {}
pkg1 = load_package(args[1])
tools = merge_objects(tools, pkg1['tools']);
platforms = merge_objects(platforms, pkg1['platforms']);
tools = merge_objects(tools, pkg1["tools"])
platforms = merge_objects(platforms, pkg1["platforms"])
pkg2 = load_package(args[2])
tools = merge_objects(tools, pkg2['tools']);
platforms = merge_objects(platforms, pkg2['platforms']);
tools = merge_objects(tools, pkg2["tools"])
platforms = merge_objects(platforms, pkg2["platforms"])

pkg1['tools'] = []
pkg1['platforms'] = []
pkg1["tools"] = []
pkg1["platforms"] = []

for name in tools:
for version in tools[name]:
print("Adding tool {0}-{1}".format(name, version), file=sys.stderr)
pkg1['tools'].append(tools[name][version])
pkg1["tools"].append(tools[name][version])

for name in platforms:
for version in platforms[name]:
print("Adding platform {0}-{1}".format(name, version), file=sys.stderr)
pkg1['platforms'].append(platforms[name][version])

#pkg1['platforms'] = sorted(pkg1['platforms'], key=lambda k: LooseVersion(pkgVersionNormalized(k['version'])), reverse=True)
pkg1['platforms'] = sorted(pkg1['platforms'], key=lambda k: Version(pkgVersionNormalized(k['version'])), reverse=True)
pkg1["platforms"].append(platforms[name][version])

# pkg1["platforms"] = sorted(
# pkg1["platforms"], key=lambda k: LooseVersion(pkgVersionNormalized(k["version"])), reverse=True
# )

pkg1["platforms"] = sorted(
pkg1["platforms"], key=lambda k: Version(pkgVersionNormalized(k["version"])), reverse=True
)

json.dump({"packages": [pkg1]}, sys.stdout, indent=2)

json.dump({'packages':[pkg1]}, sys.stdout, indent=2)

if __name__ == '__main__':
if __name__ == "__main__":
sys.exit(main(sys.argv))
18 changes: 7 additions & 11 deletions .github/workflows/allboards.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Boards Test - Remote trigger

# The workflow will run on remote dispath with event-type set to "test-boards"
# The workflow will run on remote dispatch with event-type set to "test-boards"
on:
repository_dispatch:
types: [test-boards]
Expand All @@ -20,8 +20,7 @@ jobs:
ref: ${{ github.event.client_payload.branch }}

- name: Get boards fqbns
run:
bash .github/scripts/find_all_boards.sh
run: bash .github/scripts/find_all_boards.sh

setup-chunks:
needs: find-boards
Expand All @@ -43,8 +42,7 @@ jobs:

- id: set-test-chunks
name: Set Chunks
run:
echo "test-chunks<<EOF" >> $GITHUB_OUTPUT
run: echo "test-chunks<<EOF" >> $GITHUB_OUTPUT

echo "$( jq -nc '${{ needs.find-boards.outputs.fqbns }} | [_nwise( ${{ needs.find-boards.outputs.board-count }}/15 | ceil)]')" >> $GITHUB_OUTPUT

Expand All @@ -61,7 +59,7 @@ jobs:

strategy:
fail-fast: false
matrix:
matrix:
chunk: ${{ fromJSON(needs.setup-chunks.outputs['test-chunks']) }}

steps:
Expand All @@ -71,9 +69,8 @@ jobs:
ref: ${{ github.event.client_payload.branch }}

- name: Echo FQBNS to file
run:
echo "$FQBN" > fqbns.json
env:
run: echo "$FQBN" > fqbns.json
env:
FQBN: ${{ toJSON(matrix.chunk) }}

- name: Compile sketch
Expand All @@ -88,5 +85,4 @@ jobs:
enable-warnings-report: false
cli-compile-flags: |
- --warnings="all"
sketch-paths:
"- ./libraries/ESP32/examples/CI/CIBoardsTest/CIBoardsTest.ino"
sketch-paths: "- ./libraries/ESP32/examples/CI/CIBoardsTest/CIBoardsTest.ino"
14 changes: 6 additions & 8 deletions .github/workflows/boards.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ name: Boards Test
on:
pull_request:
paths:
- 'boards.txt'
- 'libraries/ESP32/examples/CI/CIBoardsTest/CIBoardsTest.ino'
- '.github/workflows/boards.yml'
- "boards.txt"
- "libraries/ESP32/examples/CI/CIBoardsTest/CIBoardsTest.ino"
- ".github/workflows/boards.yml"

env:
# It's convenient to set variables for values used multiple times in the workflow
Expand All @@ -28,8 +28,7 @@ jobs:
uses: dcarbone/[email protected]

- name: Get board name
run:
bash .github/scripts/find_new_boards.sh ${{ github.repository }} ${{github.base_ref}}
run: bash .github/scripts/find_new_boards.sh ${{ github.repository }} ${{github.base_ref}}

test-boards:
needs: find-boards
Expand Down Expand Up @@ -72,7 +71,7 @@ jobs:
./tools/openocd-esp32
./tools/riscv32-*
./tools/xtensa-*

- name: Compile sketch
uses: P-R-O-C-H-Y/compile-sketches@main
with:
Expand All @@ -85,6 +84,5 @@ jobs:
cli-compile-flags: |
- --warnings="all"
exit-on-fail: true
sketch-paths:
"- ./libraries/ESP32/examples/CI/CIBoardsTest/CIBoardsTest.ino"
sketch-paths: "- ./libraries/ESP32/examples/CI/CIBoardsTest/CIBoardsTest.ino"
verbose: true
42 changes: 21 additions & 21 deletions .github/workflows/build_py_tools.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ name: Build Python Tools
on:
pull_request:
paths:
- '.github/workflows/build_py_tools.yml'
- 'tools/get.py'
- 'tools/espota.py'
- 'tools/gen_esp32part.py'
- 'tools/gen_insights_package.py'
- ".github/workflows/build_py_tools.yml"
- "tools/get.py"
- "tools/espota.py"
- "tools/gen_esp32part.py"
- "tools/gen_insights_package.py"

jobs:
find-changed-tools:
Expand All @@ -33,8 +33,8 @@ jobs:
uses: tj-actions/changed-files@v41
id: verify-changed-files
with:
fetch_depth: '2'
since_last_remote_commit: 'true'
fetch_depth: "2"
since_last_remote_commit: "true"
files: |
tools/get.py
tools/espota.py
Expand All @@ -57,20 +57,20 @@ jobs:
matrix:
os: [windows-latest, macos-latest, ubuntu-20.04, ARM]
include:
- os: windows-latest
TARGET: win64
EXTEN: .exe
SEPARATOR: ';'
- os: macos-latest
TARGET: macos
SEPARATOR: ':'
- os: ubuntu-20.04
TARGET: linux-amd64
SEPARATOR: ':'
- os: ARM
CONTAINER: python:3.8-bullseye
TARGET: arm
SEPARATOR: ':'
- os: windows-latest
TARGET: win64
EXTEN: .exe
SEPARATOR: ";"
- os: macos-latest
TARGET: macos
SEPARATOR: ":"
- os: ubuntu-20.04
TARGET: linux-amd64
SEPARATOR: ":"
- os: ARM
CONTAINER: python:3.8-bullseye
TARGET: arm
SEPARATOR: ":"
container: ${{ matrix.CONTAINER }} # use python container on ARM
env:
DISTPATH: pytools-${{ matrix.TARGET }}
Expand Down
Loading
Loading