diff --git a/.github/workflows/console_cmd_ifconfig__build.yml b/.github/workflows/console_cmd_ifconfig__build.yml index 8d94314a9..c5d21626a 100644 --- a/.github/workflows/console_cmd_ifconfig__build.yml +++ b/.github/workflows/console_cmd_ifconfig__build.yml @@ -15,7 +15,7 @@ jobs: matrix: idf_ver: ["latest", "release-v5.0"] 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 container: espressif/idf:${{ matrix.idf_ver }} steps: @@ -29,4 +29,4 @@ jobs: run: | ${IDF_PATH}/install.sh --enable-pytest . ${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 diff --git a/.github/workflows/console_cmd_ping__build.yml b/.github/workflows/console_cmd_ping__build.yml index a6729f0ff..37f9f120a 100644 --- a/.github/workflows/console_cmd_ping__build.yml +++ b/.github/workflows/console_cmd_ping__build.yml @@ -15,7 +15,7 @@ jobs: matrix: idf_ver: ["latest", "release-v5.0"] 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 container: espressif/idf:${{ matrix.idf_ver }} steps: @@ -29,4 +29,4 @@ jobs: run: | ${IDF_PATH}/install.sh --enable-pytest . ${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 diff --git a/.github/workflows/console_cmd_wifi__build.yml b/.github/workflows/console_cmd_wifi__build.yml index fd2822082..803118433 100644 --- a/.github/workflows/console_cmd_wifi__build.yml +++ b/.github/workflows/console_cmd_wifi__build.yml @@ -15,7 +15,7 @@ jobs: matrix: idf_ver: ["latest", "release-v5.0"] 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 container: espressif/idf:${{ matrix.idf_ver }} steps: @@ -29,4 +29,4 @@ jobs: run: | ${IDF_PATH}/install.sh --enable-pytest . ${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 diff --git a/.github/workflows/console_simple_init__build.yml b/.github/workflows/console_simple_init__build.yml index bb0b58b6c..53cfc45b7 100644 --- a/.github/workflows/console_simple_init__build.yml +++ b/.github/workflows/console_simple_init__build.yml @@ -15,7 +15,7 @@ jobs: matrix: idf_ver: ["latest", "release-v5.0"] 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 container: espressif/idf:${{ matrix.idf_ver }} steps: @@ -29,4 +29,4 @@ jobs: run: | ${IDF_PATH}/install.sh --enable-pytest . ${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 diff --git a/.github/workflows/mqtt_cxx__build.yml b/.github/workflows/mqtt_cxx__build.yml index 7f04f3dd5..20cfcf7f5 100644 --- a/.github/workflows/mqtt_cxx__build.yml +++ b/.github/workflows/mqtt_cxx__build.yml @@ -15,7 +15,7 @@ jobs: matrix: idf_ver: ["latest", "release-v5.0"] 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 container: espressif/idf:${{ matrix.idf_ver }} steps: @@ -29,4 +29,4 @@ jobs: run: | ${IDF_PATH}/install.sh --enable-pytest . ${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 diff --git a/ci/build_apps.py b/ci/build_apps.py index a1fd942e9..0e35cf303 100644 --- a/ci/build_apps.py +++ b/ci/build_apps.py @@ -10,6 +10,8 @@ import sys from idf_build_apps import build_apps, find_apps, setup_logging from idf_build_apps.constants import SUPPORTED_TARGETS +from packaging import version +from pkg_resources import get_distribution if __name__ == '__main__': parser = argparse.ArgumentParser( @@ -17,6 +19,12 @@ if __name__ == '__main__': formatter_class=argparse.ArgumentDefaultsHelpFormatter, ) 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( '-t', '--target', @@ -28,6 +36,8 @@ if __name__ == '__main__': 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('-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() IDF_PATH = os.environ['IDF_PATH'] @@ -41,20 +51,36 @@ if __name__ == '__main__': SUPPORTED_TARGETS.append('linux') ignore_warning = 'warning: ' # Ignore all common warnings on linux builds setup_logging(2) - 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='.', - ) + if version.parse(get_distribution('idf_build_apps').version) >= version.parse('2.0.0'): + apps = find_apps( + args.paths, + recursive=args.recursive, + target=args.target, + build_dir='build_@t_@w', + config_rules_str=args.rules, + build_log_filename='build_log.txt', + size_json_filename='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='.', + ) + 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: print(app)