Skip to content

Commit

Permalink
feat(launchpad): add launchpad readme txt
Browse files Browse the repository at this point in the history
  • Loading branch information
lijunru-hub committed Jul 1, 2024
1 parent 981676d commit a979d42
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 8 deletions.
1 change: 0 additions & 1 deletion .gitlab/ci/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ pack-upload_files:
expire_in: 1 week
rules:
- if: $CI_COMMIT_REF_NAME == "master"
- if: $CI_COMMIT_REF_NAME == "feat/usb_device_example_support_usb_otg"
script:
- pip install rtoml ruamel.yaml --upgrade
- pip install idf_build_apps
Expand Down
1 change: 1 addition & 0 deletions components/openai/test_apps/pytest_openai.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
@pytest.mark.target('esp32s2')
@pytest.mark.target('esp32s3')
@pytest.mark.env('generic')
@pytest.mark.timeout(1000)
@pytest.mark.parametrize(
'config',
[
Expand Down
2 changes: 1 addition & 1 deletion conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def session_tempdir() -> str:
@multi_dut_argument
def config(request: FixtureRequest) -> str:
config_marker = list(request.node.iter_markers(name='config'))
return config_marker[0].args[0] if config_marker else 'default'
return config_marker[0].args[0] if config_marker else 'defaults'


@pytest.fixture
Expand Down
2 changes: 1 addition & 1 deletion tools/build_apps.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ def main(args): # type: (argparse.Namespace) -> None
)
parser.add_argument(
'--config',
default=['sdkconfig.defaults=default', 'sdkconfig.ci.*=', '=default'],
default=['sdkconfig.defaults=defaults', 'sdkconfig.ci.*=', '=defaults'],
action='append',
help='Adds configurations (sdkconfig file names) to build. This can either be '
'FILENAME[=NAME] or FILEPATTERN. FILENAME is the name of the sdkconfig file, '
Expand Down
13 changes: 10 additions & 3 deletions tools/ci/launchpad/generateFiles.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ def __init__(self, app):
self.build_info = []
# App version
self.app_version = ''
# App readme
self.readme = ''

current_app = App(None)

Expand Down Expand Up @@ -131,6 +133,9 @@ def remove_app_from_config(apps):
matched_build_info.append(build_info)
if matched_build_info:
app['build_info'] = matched_build_info
if config_apps[app_dir].get('readme'):
print(config_apps[app_dir]['readme'])
app['readme'] = config_apps[app_dir]['readme']
new_apps.append(app)

return new_apps
Expand Down Expand Up @@ -208,6 +213,8 @@ def write_app(app):
toml_obj[support_app] = {}
toml_obj[support_app]['android_app_url'] = ''
toml_obj[support_app]['ios_app_url'] = ''
if app.get('readme'):
toml_obj[support_app]['readme.text'] = app['readme']
if not toml_obj[support_app].get('chipsets'):
toml_obj[support_app]['chipsets'] = [f'{build_info["target"]}-{build_info["sdkconfig"]}']
else:
Expand All @@ -225,14 +232,14 @@ def create_config_toml(apps):

# This is a workaround to remove the quotes around the image.<string> in the config.toml file as dot is not allowed in the key by default
with open('binaries/config.toml', 'r') as toml_file:
fixed = replace_image_string(toml_file.read())
fixed = replace_image_and_readme_string(toml_file.read())

with open('binaries/config.toml', 'w') as toml_file:
toml_file.write(fixed)

def replace_image_string(text):
def replace_image_and_readme_string(text):
# Define the regular expression pattern to find "image.<string>"
pattern = r'"(image\.[\w-]+)"'
pattern = r'"((image|readme)\.[\w-]+)"'
# Use re.sub() to replace the matched pattern with image.<string>
result = re.sub(pattern, r'\1', text)
return result
Expand Down
14 changes: 12 additions & 2 deletions tools/ci/launchpad/upload_project_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,27 +7,37 @@
# sdkconfig: // sdkconfig name
# - b // sdkconfig.ci.a
# - default // sdkconfig.default
# readme: // readme url must point a README.md link
# <URL>

examples/usb/device/usb_dual_uvc_device:
esp32s3:
sdkconfig:
- esp32s3_usb_otg
esp32p4:
sdkconfig:
- default
- defaults
readme:
https://raw.githubusercontent.com/espressif/esp-iot-solution/master/examples/usb/device/usb_dual_uvc_device/README.md

examples/usb/device/usb_webcam:
esp32s3:
sdkconfig:
- esp32s3_eye
readme:
https://raw.githubusercontent.com/espressif/esp-iot-solution/master/examples/usb/device/usb_webcam/README.md

examples/usb/host/usb_camera_lcd_display:
esp32s3:
sdkconfig:
- esp32s3_lcd_ev_board
readme:
https://raw.githubusercontent.com/espressif/esp-iot-solution/master/examples/usb/host/usb_camera_lcd_display/README.md

examples/usb/host/usb_camera_mic_spk:
esp32s3:
sdkconfig:
- esp32s3_usb_otg
- default
- defaults
readme:
https://raw.githubusercontent.com/espressif/esp-iot-solution/master/examples/usb/host/usb_camera_mic_spk/README.md

0 comments on commit a979d42

Please sign in to comment.