Skip to content

Commit 585e4b3

Browse files
authored
Merge pull request #483 from espressif-abhikroy/ci/build_app_failure_fix
fix(common): Fixed scripts for build test failure
2 parents 1393764 + 47736a2 commit 585e4b3

File tree

6 files changed

+50
-24
lines changed

6 files changed

+50
-24
lines changed

.github/workflows/console_cmd_ifconfig__build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
matrix:
1616
idf_ver: ["latest", "release-v5.0"]
1717
idf_target: ["esp32"]
18-
test: [ { app: example, path: "components/console_cmd_ifconfig/examples" }]
18+
test: [ { app: ifconfig-basic, path: "components/console_cmd_ifconfig/examples"}]
1919
runs-on: ubuntu-20.04
2020
container: espressif/idf:${{ matrix.idf_ver }}
2121
steps:
@@ -29,4 +29,4 @@ jobs:
2929
run: |
3030
${IDF_PATH}/install.sh --enable-pytest
3131
. ${IDF_PATH}/export.sh
32-
python $IDF_PATH/tools/ci/ci_build_apps.py . --target ${{ matrix.idf_target }} -vv --preserve-all --pytest-app
32+
python ../../../ci/build_apps.py ./${{ matrix.test.app }} --target ${{ matrix.idf_target }} -vv --preserve-all --pytest-app

.github/workflows/console_cmd_ping__build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
matrix:
1616
idf_ver: ["latest", "release-v5.0"]
1717
idf_target: ["esp32"]
18-
test: [ { app: example, path: "components/console_cmd_ping/examples" }]
18+
test: [ { app: ping-basic, path: "components/console_cmd_ping/examples" }]
1919
runs-on: ubuntu-20.04
2020
container: espressif/idf:${{ matrix.idf_ver }}
2121
steps:
@@ -29,4 +29,4 @@ jobs:
2929
run: |
3030
${IDF_PATH}/install.sh --enable-pytest
3131
. ${IDF_PATH}/export.sh
32-
python $IDF_PATH/tools/ci/ci_build_apps.py . --target ${{ matrix.idf_target }} -vv --preserve-all --pytest-app
32+
python ../../../ci/build_apps.py ./${{ matrix.test.app }} --target ${{ matrix.idf_target }} -vv --preserve-all --pytest-app

.github/workflows/console_cmd_wifi__build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
matrix:
1616
idf_ver: ["latest", "release-v5.0"]
1717
idf_target: ["esp32"]
18-
test: [ { app: example, path: "components/console_cmd_wifi/examples" }]
18+
test: [ { app: wifi-basic, path: "components/console_cmd_wifi/examples" }]
1919
runs-on: ubuntu-20.04
2020
container: espressif/idf:${{ matrix.idf_ver }}
2121
steps:
@@ -29,4 +29,4 @@ jobs:
2929
run: |
3030
${IDF_PATH}/install.sh --enable-pytest
3131
. ${IDF_PATH}/export.sh
32-
python $IDF_PATH/tools/ci/ci_build_apps.py . --target ${{ matrix.idf_target }} -vv --preserve-all --pytest-app
32+
python ../../../ci/build_apps.py ./${{ matrix.test.app }} --target ${{ matrix.idf_target }} -vv --preserve-all --pytest-app

.github/workflows/console_simple_init__build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
matrix:
1616
idf_ver: ["latest", "release-v5.0"]
1717
idf_target: ["esp32"]
18-
test: [ { app: example, path: "components/console_simple_init/examples" }]
18+
test: [ { app: console_basic, path: "components/console_simple_init/examples" }]
1919
runs-on: ubuntu-20.04
2020
container: espressif/idf:${{ matrix.idf_ver }}
2121
steps:
@@ -29,4 +29,4 @@ jobs:
2929
run: |
3030
${IDF_PATH}/install.sh --enable-pytest
3131
. ${IDF_PATH}/export.sh
32-
python $IDF_PATH/tools/ci/ci_build_apps.py . --target ${{ matrix.idf_target }} -vv --preserve-all --pytest-app
32+
python ../../../ci/build_apps.py ./${{ matrix.test.app }} --target ${{ matrix.idf_target }} -vv --preserve-all --pytest-app

.github/workflows/mqtt_cxx__build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
matrix:
1616
idf_ver: ["latest", "release-v5.0"]
1717
idf_target: ["esp32"]
18-
test: [ { app: example, path: "components/esp_mqtt_cxx/examples" }]
18+
test: [ { app: mqtt-basic, path: "components/esp_mqtt_cxx/examples" }]
1919
runs-on: ubuntu-20.04
2020
container: espressif/idf:${{ matrix.idf_ver }}
2121
steps:
@@ -29,4 +29,4 @@ jobs:
2929
run: |
3030
${IDF_PATH}/install.sh --enable-pytest
3131
. ${IDF_PATH}/export.sh
32-
python $IDF_PATH/tools/ci/ci_build_apps.py . --target ${{ matrix.idf_target }} -vv --preserve-all --pytest-app
32+
python ../../../ci/build_apps.py ./${{ matrix.test.app }} --target ${{ matrix.idf_target }} -vv --preserve-all --pytest-app

ci/build_apps.py

Lines changed: 40 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,21 @@
1010

1111
from idf_build_apps import build_apps, find_apps, setup_logging
1212
from idf_build_apps.constants import SUPPORTED_TARGETS
13+
from packaging import version
14+
from pkg_resources import get_distribution
1315

1416
if __name__ == '__main__':
1517
parser = argparse.ArgumentParser(
1618
description='Build all projects',
1719
formatter_class=argparse.ArgumentDefaultsHelpFormatter,
1820
)
1921
parser.add_argument('paths', nargs='+', help='Paths to the apps to build.')
22+
parser.add_argument(
23+
'-v',
24+
'--verbose',
25+
action='count',
26+
help='Increase the LOGGER level of the script. Can be specified multiple times.',
27+
)
2028
parser.add_argument(
2129
'-t',
2230
'--target',
@@ -28,6 +36,8 @@
2836
parser.add_argument('-d', '--delete', action='store_true', help='Delete build artifacts')
2937
parser.add_argument('-c', '--recursive', action='store_true', help='Build recursively')
3038
parser.add_argument('-l', '--linux', action='store_true', help='Include linux build (dont check warnings)')
39+
parser.add_argument('--preserve-all', action='store_true', help='Preserve the binaries for all apps when specified.')
40+
parser.add_argument('--pytest-apps', action='store_true', help='Only build apps required by pytest scripts.')
3141
args = parser.parse_args()
3242

3343
IDF_PATH = os.environ['IDF_PATH']
@@ -41,20 +51,36 @@
4151
SUPPORTED_TARGETS.append('linux')
4252
ignore_warning = 'warning: ' # Ignore all common warnings on linux builds
4353
setup_logging(2)
44-
apps = find_apps(
45-
args.paths,
46-
recursive=args.recursive,
47-
target=args.target,
48-
build_dir='build_@t_@w',
49-
config_rules_str=args.rules,
50-
build_log_path='build_log.txt',
51-
size_json_path='size.json' if not args.linux else None,
52-
check_warnings=True,
53-
preserve=not args.delete,
54-
manifest_files=args.manifests,
55-
default_build_targets=SUPPORTED_TARGETS,
56-
manifest_rootpath='.',
57-
)
54+
if version.parse(get_distribution('idf_build_apps').version) >= version.parse('2.0.0'):
55+
apps = find_apps(
56+
args.paths,
57+
recursive=args.recursive,
58+
target=args.target,
59+
build_dir='build_@t_@w',
60+
config_rules_str=args.rules,
61+
build_log_filename='build_log.txt',
62+
size_json_filename='size.json' if not args.linux else None,
63+
check_warnings=True,
64+
preserve=not args.delete,
65+
manifest_files=args.manifests,
66+
default_build_targets=SUPPORTED_TARGETS,
67+
manifest_rootpath='.',
68+
)
69+
else:
70+
apps = find_apps(
71+
args.paths,
72+
recursive=args.recursive,
73+
target=args.target,
74+
build_dir='build_@t_@w',
75+
config_rules_str=args.rules,
76+
build_log_path='build_log.txt',
77+
size_json_path='size.json' if not args.linux else None,
78+
check_warnings=True,
79+
preserve=not args.delete,
80+
manifest_files=args.manifests,
81+
default_build_targets=SUPPORTED_TARGETS,
82+
manifest_rootpath='.',
83+
)
5884

5985
for app in apps:
6086
print(app)

0 commit comments

Comments
 (0)