fix(common): Fixed scripts for build test failure

This commit is contained in:
Abhik Roy
2024-01-16 00:37:32 +11:00
parent 1393764dc5
commit 47736a2556
6 changed files with 50 additions and 24 deletions

View File

@ -15,7 +15,7 @@ jobs:
matrix: matrix:
idf_ver: ["latest", "release-v5.0"] idf_ver: ["latest", "release-v5.0"]
idf_target: ["esp32"] idf_target: ["esp32"]
test: [ { app: example, path: "components/console_cmd_ifconfig/examples" }] test: [ { app: ifconfig-basic, path: "components/console_cmd_ifconfig/examples"}]
runs-on: ubuntu-20.04 runs-on: ubuntu-20.04
container: espressif/idf:${{ matrix.idf_ver }} container: espressif/idf:${{ matrix.idf_ver }}
steps: steps:
@ -29,4 +29,4 @@ jobs:
run: | run: |
${IDF_PATH}/install.sh --enable-pytest ${IDF_PATH}/install.sh --enable-pytest
. ${IDF_PATH}/export.sh . ${IDF_PATH}/export.sh
python $IDF_PATH/tools/ci/ci_build_apps.py . --target ${{ matrix.idf_target }} -vv --preserve-all --pytest-app python ../../../ci/build_apps.py ./${{ matrix.test.app }} --target ${{ matrix.idf_target }} -vv --preserve-all --pytest-app

View File

@ -15,7 +15,7 @@ jobs:
matrix: matrix:
idf_ver: ["latest", "release-v5.0"] idf_ver: ["latest", "release-v5.0"]
idf_target: ["esp32"] idf_target: ["esp32"]
test: [ { app: example, path: "components/console_cmd_ping/examples" }] test: [ { app: ping-basic, path: "components/console_cmd_ping/examples" }]
runs-on: ubuntu-20.04 runs-on: ubuntu-20.04
container: espressif/idf:${{ matrix.idf_ver }} container: espressif/idf:${{ matrix.idf_ver }}
steps: steps:
@ -29,4 +29,4 @@ jobs:
run: | run: |
${IDF_PATH}/install.sh --enable-pytest ${IDF_PATH}/install.sh --enable-pytest
. ${IDF_PATH}/export.sh . ${IDF_PATH}/export.sh
python $IDF_PATH/tools/ci/ci_build_apps.py . --target ${{ matrix.idf_target }} -vv --preserve-all --pytest-app python ../../../ci/build_apps.py ./${{ matrix.test.app }} --target ${{ matrix.idf_target }} -vv --preserve-all --pytest-app

View File

@ -15,7 +15,7 @@ jobs:
matrix: matrix:
idf_ver: ["latest", "release-v5.0"] idf_ver: ["latest", "release-v5.0"]
idf_target: ["esp32"] idf_target: ["esp32"]
test: [ { app: example, path: "components/console_cmd_wifi/examples" }] test: [ { app: wifi-basic, path: "components/console_cmd_wifi/examples" }]
runs-on: ubuntu-20.04 runs-on: ubuntu-20.04
container: espressif/idf:${{ matrix.idf_ver }} container: espressif/idf:${{ matrix.idf_ver }}
steps: steps:
@ -29,4 +29,4 @@ jobs:
run: | run: |
${IDF_PATH}/install.sh --enable-pytest ${IDF_PATH}/install.sh --enable-pytest
. ${IDF_PATH}/export.sh . ${IDF_PATH}/export.sh
python $IDF_PATH/tools/ci/ci_build_apps.py . --target ${{ matrix.idf_target }} -vv --preserve-all --pytest-app python ../../../ci/build_apps.py ./${{ matrix.test.app }} --target ${{ matrix.idf_target }} -vv --preserve-all --pytest-app

View File

@ -15,7 +15,7 @@ jobs:
matrix: matrix:
idf_ver: ["latest", "release-v5.0"] idf_ver: ["latest", "release-v5.0"]
idf_target: ["esp32"] idf_target: ["esp32"]
test: [ { app: example, path: "components/console_simple_init/examples" }] test: [ { app: console_basic, path: "components/console_simple_init/examples" }]
runs-on: ubuntu-20.04 runs-on: ubuntu-20.04
container: espressif/idf:${{ matrix.idf_ver }} container: espressif/idf:${{ matrix.idf_ver }}
steps: steps:
@ -29,4 +29,4 @@ jobs:
run: | run: |
${IDF_PATH}/install.sh --enable-pytest ${IDF_PATH}/install.sh --enable-pytest
. ${IDF_PATH}/export.sh . ${IDF_PATH}/export.sh
python $IDF_PATH/tools/ci/ci_build_apps.py . --target ${{ matrix.idf_target }} -vv --preserve-all --pytest-app python ../../../ci/build_apps.py ./${{ matrix.test.app }} --target ${{ matrix.idf_target }} -vv --preserve-all --pytest-app

View File

@ -15,7 +15,7 @@ jobs:
matrix: matrix:
idf_ver: ["latest", "release-v5.0"] idf_ver: ["latest", "release-v5.0"]
idf_target: ["esp32"] idf_target: ["esp32"]
test: [ { app: example, path: "components/esp_mqtt_cxx/examples" }] test: [ { app: mqtt-basic, path: "components/esp_mqtt_cxx/examples" }]
runs-on: ubuntu-20.04 runs-on: ubuntu-20.04
container: espressif/idf:${{ matrix.idf_ver }} container: espressif/idf:${{ matrix.idf_ver }}
steps: steps:
@ -29,4 +29,4 @@ jobs:
run: | run: |
${IDF_PATH}/install.sh --enable-pytest ${IDF_PATH}/install.sh --enable-pytest
. ${IDF_PATH}/export.sh . ${IDF_PATH}/export.sh
python $IDF_PATH/tools/ci/ci_build_apps.py . --target ${{ matrix.idf_target }} -vv --preserve-all --pytest-app python ../../../ci/build_apps.py ./${{ matrix.test.app }} --target ${{ matrix.idf_target }} -vv --preserve-all --pytest-app

View File

@ -10,6 +10,8 @@ import sys
from idf_build_apps import build_apps, find_apps, setup_logging from idf_build_apps import build_apps, find_apps, setup_logging
from idf_build_apps.constants import SUPPORTED_TARGETS from idf_build_apps.constants import SUPPORTED_TARGETS
from packaging import version
from pkg_resources import get_distribution
if __name__ == '__main__': if __name__ == '__main__':
parser = argparse.ArgumentParser( parser = argparse.ArgumentParser(
@ -17,6 +19,12 @@ if __name__ == '__main__':
formatter_class=argparse.ArgumentDefaultsHelpFormatter, formatter_class=argparse.ArgumentDefaultsHelpFormatter,
) )
parser.add_argument('paths', nargs='+', help='Paths to the apps to build.') parser.add_argument('paths', nargs='+', help='Paths to the apps to build.')
parser.add_argument(
'-v',
'--verbose',
action='count',
help='Increase the LOGGER level of the script. Can be specified multiple times.',
)
parser.add_argument( parser.add_argument(
'-t', '-t',
'--target', '--target',
@ -28,6 +36,8 @@ if __name__ == '__main__':
parser.add_argument('-d', '--delete', action='store_true', help='Delete build artifacts') parser.add_argument('-d', '--delete', action='store_true', help='Delete build artifacts')
parser.add_argument('-c', '--recursive', action='store_true', help='Build recursively') parser.add_argument('-c', '--recursive', action='store_true', help='Build recursively')
parser.add_argument('-l', '--linux', action='store_true', help='Include linux build (dont check warnings)') parser.add_argument('-l', '--linux', action='store_true', help='Include linux build (dont check warnings)')
parser.add_argument('--preserve-all', action='store_true', help='Preserve the binaries for all apps when specified.')
parser.add_argument('--pytest-apps', action='store_true', help='Only build apps required by pytest scripts.')
args = parser.parse_args() args = parser.parse_args()
IDF_PATH = os.environ['IDF_PATH'] IDF_PATH = os.environ['IDF_PATH']
@ -41,20 +51,36 @@ if __name__ == '__main__':
SUPPORTED_TARGETS.append('linux') SUPPORTED_TARGETS.append('linux')
ignore_warning = 'warning: ' # Ignore all common warnings on linux builds ignore_warning = 'warning: ' # Ignore all common warnings on linux builds
setup_logging(2) setup_logging(2)
apps = find_apps( if version.parse(get_distribution('idf_build_apps').version) >= version.parse('2.0.0'):
args.paths, apps = find_apps(
recursive=args.recursive, args.paths,
target=args.target, recursive=args.recursive,
build_dir='build_@t_@w', target=args.target,
config_rules_str=args.rules, build_dir='build_@t_@w',
build_log_path='build_log.txt', config_rules_str=args.rules,
size_json_path='size.json' if not args.linux else None, build_log_filename='build_log.txt',
check_warnings=True, size_json_filename='size.json' if not args.linux else None,
preserve=not args.delete, check_warnings=True,
manifest_files=args.manifests, preserve=not args.delete,
default_build_targets=SUPPORTED_TARGETS, manifest_files=args.manifests,
manifest_rootpath='.', default_build_targets=SUPPORTED_TARGETS,
) manifest_rootpath='.',
)
else:
apps = find_apps(
args.paths,
recursive=args.recursive,
target=args.target,
build_dir='build_@t_@w',
config_rules_str=args.rules,
build_log_path='build_log.txt',
size_json_path='size.json' if not args.linux else None,
check_warnings=True,
preserve=not args.delete,
manifest_files=args.manifests,
default_build_targets=SUPPORTED_TARGETS,
manifest_rootpath='.',
)
for app in apps: for app in apps:
print(app) print(app)