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

feature(ci): Added esp_iot_solutions examples build verification #2868

Closed
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
100 changes: 31 additions & 69 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -1,86 +1,48 @@
name: Bug Report
description: Report a problem with TinyUSB
labels: 'Bug 🐞'
name: Bug report
description: Report build and runtime bugs
labels: ["Type: Bug"]
body:
- type: markdown
attributes:
value: |
Thanks for taking the time to fill out this bug report!
It's okay to leave some blank if it doesn't apply to your problem.

- type: dropdown
- type: checkboxes
id: checklist
attributes:
label: Operating System
label: Answers checklist.
description: Before submitting a new issue, please follow the checklist and try to find the answer.
options:
- Linux
- MacOS
- RaspberryPi OS
- Windows 7
- Windows 10
- Windows 11
- Others
validations:
required: true

- label: I have read the component documentation [ESP-IDF Components](https://components.espressif.com) and the issue is not addressed there.
required: true
- label: I am using target and esp-idf version as defined in component's idf_component.yml
required: true
- label: I have searched the [issue tracker](https://github.com/espressif/tinyusb/issues?q=is%3Aissue) for a similar issue and not found any related issue.
required: true
- type: input
id: idf_version
attributes:
label: Board
placeholder: e.g Feather nRF52840 Express
validations:
required: true

- type: textarea
attributes:
label: Firmware
placeholder: |
e.g examples/device/cdc_msc. If it is custom firmware, it is preferably compiled like one in example folder and reviewable for people to comment on. The easiest way is
- Fork this repo, checkout a new branch
- Add your-own-example based on stock one
- Push and post it here.
label: ESP-IDF version.
description: On which ESP-IDF version does this issue occur on? Run `git describe --tags` in your esp-idf folder to find it.
placeholder: ex. v5.0-rc1
validations:
required: true

- type: textarea
attributes:
label: What happened ?
placeholder: A clear and concise description of what the bug is.
validations:
required: true

- type: textarea
- type: input
id: devkit
attributes:
label: How to reproduce ?
placeholder: |
Exact steps in chronological order, details should be specific e.g if you use a command/script to test with, please post it as well.
1. Go to '...'
2. Click on '....'
3. See error
label: Development Kit.
description: On which Development Kit does this issue occur on?
placeholder: ex. ESP32-Wrover-Kit v2 | Custom Board
validations:
required: true

- type: textarea
- type: input
id: component_version
attributes:
label: Debug Log as txt file (LOG/CFG_TUSB_DEBUG=2)
placeholder: |
Attach your debug log txt file here, where the issue occurred, best with comments to explain the actual events.

Note1: Please DO NOT paste your lengthy log contents here since it hurts the readability.
Note2: To enable logging, add `LOG=2` to to the make command if building with stock examples or set `CFG_TUSB_DEBUG=2` in your tusb_config.h.
More information can be found at [example's readme](https://github.com/hathach/tinyusb/blob/master/docs/getting_started.md)
label: Used Component version.
description: On which Component version does this issue occur on? Check `dependencies.lock` file in your project root to find it.
placeholder: ex. v1.2.0-rc0
validations:
required: true

- type: textarea
id: more-info
attributes:
label: Screenshots
description: If applicable, add screenshots to help explain your problem.
label: More Information.
description: Do you have any other information from investigating this?
placeholder: ex. I tried on my friend's Windows 10 PC and the command works there.
validations:
required: false

- type: checkboxes
attributes:
label: I have checked existing issues, dicussion and documentation
description: You agree to check all the resources above before opening a new issue.
options:
- label: I confirm I have checked existing issues, dicussion and documentation.
required: true
8 changes: 0 additions & 8 deletions .github/ISSUE_TEMPLATE/config.yml

This file was deleted.

49 changes: 0 additions & 49 deletions .github/ISSUE_TEMPLATE/feature_request.yml

This file was deleted.

17 changes: 17 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
## Requirements
_Provide a requirements for requesting changes_

## Limitations
_Describe limitations if there are any_

## Breaking change
_No breaking changes_

## Checklist

- [ ] Pull Request name has appropriate format (for example: "fix(dcd_dwc2): Resolved address selection when several phy are present")
- [ ] _Optional:_ README.md updated
- [ ] CI passed

## Related issues
_No related issues_
64 changes: 64 additions & 0 deletions .github/ci/override_managed_component.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
#!/usr/bin/env python
#
# SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD
# SPDX-License-Identifier: Apache-2.0

import sys
import argparse
from pathlib import Path
from glob import glob
from idf_component_tools.manifest import ManifestManager


def override_with_local_component(component, local_path, app):
app_path = Path(app)

absolute_local_path = Path(local_path).absolute()
if not absolute_local_path.exists():
print('[Error] {} path does not exist'.format(local_path))
raise Exception
if not app_path.exists():
print('[Error] {} path does not exist'.format(app_path))
raise Exception

print('[Info] Processing app {}'.format(app))
manager = ManifestManager(app_path / 'main', 'app')
if '/' not in component:
# Prepend with default namespace
component_with_namespace = 'espressif/' + component

try:
manager.manifest_tree['dependencies'][component_with_namespace] = {
'version': '*',
'override_path': str(absolute_local_path)
}
except KeyError:
print('[Error] {} app does not depend on {}'.format(app, component_with_namespace))
raise KeyError

manager.dump()


def override_with_local_component_all(component, local_path, apps):
# Process wildcard, e.g. "app_prefix_*"
apps_with_glob = list()
for app in apps:
apps_with_glob += glob(app)

# Go through all collected apps
for app in apps_with_glob:
try:
override_with_local_component(component, local_path, app)
except:
print("[Error] Could not process app {}".format(app))
return -1
return 0


if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument('component', help='Existing component that the app depends on')
parser.add_argument('local_path', help='Path to component that will be used instead of the managed version')
parser.add_argument('apps', nargs='*', help='List of apps to process')
args = parser.parse_args()
sys.exit(override_with_local_component_all(args.component, args.local_path, args.apps))
5 changes: 0 additions & 5 deletions .github/pull_request_template.md

This file was deleted.

28 changes: 28 additions & 0 deletions .github/workflows/build_idf_examples.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Build ESP-IDF USB examples

on:
schedule:
- cron: '0 0 * * SAT' # Saturday midnight
pull_request:
types: [opened, reopened, synchronize]

jobs:
build:
strategy:
matrix:
idf_ver: ["release-v5.0", "release-v5.1", "release-v5.2", "release-v5.3", "release-v5.4", "latest"]
runs-on: ubuntu-20.04
container: espressif/idf:${{ matrix.idf_ver }}
steps:
- uses: actions/checkout@v4
with:
submodules: 'true'
- name: Build ESP-IDF USB Device examples
shell: bash
run: |
. ${IDF_PATH}/export.sh
pip install idf-component-manager==1.5.2 idf-build-apps --upgrade
python .github/ci/override_managed_component.py tinyusb . ${IDF_PATH}/examples/peripherals/usb/device/tusb_*
cd ${IDF_PATH}
idf-build-apps find --path examples/peripherals/usb/device/ --recursive --target all --manifest-file examples/peripherals/.build-test-rules.yml
idf-build-apps build --path examples/peripherals/usb/device/ --recursive --target all --manifest-file examples/peripherals/.build-test-rules.yml
30 changes: 30 additions & 0 deletions .github/workflows/build_iot_examples.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Build ESP IoT Solution examples

on:
schedule:
- cron: '0 0 * * SAT' # Saturday midnight
pull_request:
types: [opened, reopened, synchronize]

jobs:
build:
strategy:
matrix:
idf_ver: ["latest"]
runs-on: ubuntu-20.04
container: espressif/iot-solution:${{ matrix.idf_ver }}
steps:
- uses: actions/checkout@v4
with:
submodules: 'true'
- name: Build ESP IOT Solution examples
shell: bash
run: |
echo ${IDF_PATH}
# run: |
# . ${IDF_PATH}/export.sh
# pip install idf-component-manager==1.5.2 idf-build-apps --upgrade
# python .github/ci/override_managed_component.py tinyusb . ${IDF_PATH}/examples/peripherals/usb/device/tusb_*
# cd ${IDF_PATH}
# idf-build-apps find --path examples/peripherals/usb/device/ --recursive --target all --manifest-file examples/peripherals/.build-test-rules.yml
# idf-build-apps build --path examples/peripherals/usb/device/ --recursive --target all --manifest-file examples/peripherals/.build-test-rules.yml
25 changes: 25 additions & 0 deletions .github/workflows/upload_component.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Push TinyUSB to Espressif Component Service

# If the commit is tagged, it will be uploaded. Other scenario silently fail.
on:
push:
tags:
- v*

jobs:
upload_components:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Remove unneeded files
shell: bash
run: rm -rf docs tools lib/embedded-cli lib/fatfs lib/SEGGER_RTT

- name: Upload components to component service
uses: espressif/upload-components-ci-action@v1
with:
name: "tinyusb"
version: ${{ github.ref_name }}
namespace: "espressif"
api_token: ${{ secrets.IDF_COMPONENT_API_TOKEN }}
Loading