Skip to content

Commit

Permalink
Update python test CI: stop dirtying build env, cleanup build outputs (
Browse files Browse the repository at this point in the history
…project-chip#29584)

* Prevent dirtying the buildenv, make sure things are cleaned

* Virtualenv seems to be installed in the buildenv ... use that so we do not need to globally install

* Force bash shell because source requires it

* Stop generating link map files for the python builds..they just take up space and this saves 2GB
  • Loading branch information
andy31415 authored and HunsupJung committed Oct 23, 2023
1 parent ddecfa9 commit 0fdcfcf
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 8 deletions.
29 changes: 21 additions & 8 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -303,21 +303,34 @@ jobs:

- name: Setup Build, Run Build and Run Tests
run: |
scripts/build/gn_gen.sh --args="enable_rtti=true enable_pylib=true chip_config_memory_debug_checks=false chip_config_memory_debug_dmalloc=false"
scripts/build/gn_gen.sh --args="enable_rtti=true enable_pylib=true chip_config_memory_debug_checks=false chip_config_memory_debug_dmalloc=false chip_generate_link_map_file=false"
scripts/run_in_build_env.sh "ninja -C ./out"
scripts/tests/gn_tests.sh
- name: Run Python library specific unit tests
- name: Setup test python environment
shell: bash
run: |
scripts/run_in_build_env.sh 'pip3 install ./out/controller/python/chip_core-0.0-cp37-abi3-linux_x86_64.whl'
scripts/run_in_build_env.sh 'pip3 install ./out/controller/python/chip_clusters-0.0-py3-none-any.whl'
scripts/run_in_build_env.sh 'pip3 install ./out/controller/python/chip_repl-0.0-py3-none-any.whl'
scripts/run_in_build_env.sh '(cd src/controller/python/test/unit_tests/ && python3 -m unittest -v)'
scripts/run_in_build_env.sh 'virtualenv pyenv'
source pyenv/bin/activate
pip3 install ./out/controller/python/chip_core-0.0-cp37-abi3-linux_x86_64.whl
pip3 install ./out/controller/python/chip_clusters-0.0-py3-none-any.whl
pip3 install ./out/controller/python/chip_repl-0.0-py3-none-any.whl
- name: Run Python tests
shell: bash
run: |
source pyenv/bin/activate
cd src/controller/python/test/unit_tests/
python3 -m unittest -v
- name: Clean previous outputs
run: rm -rf out pyenv
- name: Run Python Setup Payload Generator Test
shell: bash
run: |
scripts/run_in_build_env.sh 'scripts/examples/gn_build_example.sh examples/chip-tool out/'
scripts/run_in_build_env.sh 'pip3 install -r src/setup_payload/python/requirements.txt'
scripts/run_in_build_env.sh 'python3 src/setup_payload/tests/run_python_setup_payload_gen_test.py out/chip-tool'
scripts/run_in_build_env.sh 'virtualenv pyenv'
source pyenv/bin/activate
pip3 install -r src/setup_payload/python/requirements.txt
python3 src/setup_payload/tests/run_python_setup_payload_gen_test.py out/chip-tool
build_darwin:
name: Build on Darwin (clang, python_lib, simulated)
Expand Down
10 changes: 10 additions & 0 deletions build/toolchain/gcc_toolchain.gni
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,14 @@
import("//build_overrides/pigweed.gni")
import("$dir_pw_toolchain/generate_toolchain.gni")

declare_args() {
# Generate Linker map files. Can skip since they can
# be quite large.
#
# Note that toolchains can individually override this
chip_generate_link_map_file = true
}

template("gcc_toolchain") {
invoker_toolchain_args = invoker.toolchain_args

Expand Down Expand Up @@ -42,6 +50,8 @@ template("gcc_toolchain") {

if (defined(invoker.link_generate_map_file)) {
link_generate_map_file = invoker.link_generate_map_file
} else {
link_generate_map_file = chip_generate_link_map_file
}

is_host_toolchain = invoker_toolchain_args.current_os == host_os
Expand Down

0 comments on commit 0fdcfcf

Please sign in to comment.