Skip to content

Commit

Permalink
Remove scripts/build/gn_build.sh (#11905)
Browse files Browse the repository at this point in the history
* Remove scripts/build/gn_build.sh

* Update python lib build logic: remove extra for loop, fix arguments and output path

* use out directly in the test workflow: build type variable is not exported

* Fix darwin build type logic: global argument not needed, update for loop

* Use run in build environment to execute ninja

* Add .sh suffix to run_in_build_env

* Make run in build env be able to run in both linux and mac

* Run ninja in the build env for happy tests as well
  • Loading branch information
andy31415 authored and pull[bot] committed Jan 13, 2022
1 parent ec72e65 commit 1389360
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 84 deletions.
59 changes: 9 additions & 50 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ jobs:
run: scripts/build/gn_gen.sh --args="chip_config_memory_debug_checks=true chip_config_memory_debug_dmalloc=true"
- name: Run Build
timeout-minutes: 20
run: scripts/build/gn_build.sh
run: scripts/run_in_build_env.sh "ninja -C ./out"
- name: Run Tests
timeout-minutes: 2
run: scripts/tests/gn_tests.sh
Expand All @@ -84,12 +84,12 @@ jobs:
run: scripts/build/gn_gen.sh --args="chip_detail_logging=false"
- name: Run Build Without Detail Logging
timeout-minutes: 20
run: scripts/build/gn_build.sh
run: scripts/run_in_build_env.sh "ninja -C ./out"
- name: Setup Build Without Progress Logging
run: scripts/build/gn_gen.sh --args="chip_detail_logging=false chip_progress_logging=false"
- name: Run Build Without Progress Logging
timeout-minutes: 20
run: scripts/build/gn_build.sh
run: scripts/run_in_build_env.sh "ninja -C ./out"
build_linux:
name: Build on Linux (gcc_release, clang, mbedtls)
timeout-minutes: 60
Expand Down Expand Up @@ -146,7 +146,7 @@ jobs:
esac
scripts/build/gn_gen.sh --args="$GN_ARGS"
scripts/build/gn_build.sh
scripts/run_in_build_env.sh "ninja -C ./out"
scripts/tests/gn_tests.sh
done
- name: Build using build_examples.py
Expand All @@ -156,7 +156,7 @@ jobs:
run: |
./scripts/run_in_build_env.sh \
"./scripts/build/build_examples.py --no-log-timestamps --target-glob 'linux-x64-*' build"
# TODO Log Upload https://github.com/project-chip/connectedhomeip/issues/2227
# TODO https://github.com/project-chip/connectedhomeip/issues/1512
# - name: Run Code Coverage
Expand Down Expand Up @@ -202,64 +202,23 @@ jobs:
uses: actions/checkout@v2
with:
submodules: true
# - name: Initialize CodeQL
# if: ${{ github.event_name == 'push' && github.event.ref == 'refs/heads/master' }}
# uses: github/codeql-action/init@v1
# with:
# languages: "cpp"

- name: Bootstrap
timeout-minutes: 10
run: scripts/build/gn_bootstrap.sh
# - name: Uploading bootstrap logs
# uses: actions/upload-artifact@v2
# if: ${{ always() }}
# with:
# name: bootstrap-logs
# path: |
# .environment/gn_out/.ninja_log
# .environment/pigweed-venv/*.log
- name: Setup Build, Run Build and Run Tests
timeout-minutes: 50
run: |
for BUILD_TYPE in python_lib; do
case $BUILD_TYPE in
"python_lib") GN_ARGS='enable_rtti=true enable_pylib=true chip_config_memory_debug_checks=false chip_config_memory_debug_dmalloc=false';;
esac
scripts/build/gn_gen.sh --args="$GN_ARGS"
scripts/build/gn_build.sh
scripts/tests/gn_tests.sh
done
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/run_in_build_env.sh "ninja -C ./out"
scripts/tests/gn_tests.sh
- name: Run Python library specific unit tests
timeout-minutes: 5
run: |
scripts/run_in_build_env.sh 'pip3 install ./out/controller/python/chip-0.0-cp37-abi3-linux_x86_64.whl'
scripts/run_in_build_env.sh '(cd src/controller/python/test/unit_tests/ && python3 -m unittest -v)'
# TODO Log Upload https://github.com/project-chip/connectedhomeip/issues/2227
# TODO https://github.com/project-chip/connectedhomeip/issues/1512
# - name: Run Code Coverage
# if: ${{ contains('main', env.BUILD_TYPE) }}
# run: scripts/tools/codecoverage.sh
# - name: Upload Code Coverage
# if: ${{ contains('main', env.BUILD_TYPE) }}
# run: bash <(curl -s https://codecov.io/bash)
# - name: Remove third_party binaries for CodeQL Analysis
# run: find out -type d -name "third_party" -exec rm -rf {} +
# - name: Remove dbus binaries for CodeQL Analysis
# run: find out -type d -name "dbus" -exec rm -rf {} +
# - name: Remove nrfxlib binaries for CodeQL Analysis
# run: find . -type d -name "nrfxlib" -exec rm -rf {} +
# - name: Perform CodeQL Analysis
# if: ${{ github.event_name == 'push' && github.event.ref == 'refs/heads/master' }}
# uses: github/codeql-action/analyze@v1
build_darwin:
name: Build on Darwin (clang, python_lib)
timeout-minutes: 90

env:
BUILD_TYPE: clang

runs-on: macos-latest
if: github.actor != 'restyled-io[bot]'

Expand Down Expand Up @@ -305,7 +264,7 @@ jobs:
"python_lib") GN_ARGS='enable_rtti=true enable_pylib=true';;
esac
scripts/build/gn_gen.sh --args="$GN_ARGS"
scripts/build/gn_build.sh
scripts/run_in_build_env.sh "ninja -C ./out"
scripts/tests/gn_tests.sh
done
- name: Uploading diagnostic logs
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/unit_integration_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ jobs:
scripts/build/gn_gen.sh --args="$GN_ARGS chip_enable_happy_tests=true"
- name: Run Build
timeout-minutes: 8
run: scripts/build/gn_build.sh
run: scripts/run_in_build_env.sh "ninja -C out/$BUILD_TYPE"
- name: Run Tests
timeout-minutes: 15
run: RUN_HAPPY_TESTS=1 scripts/tests/gn_tests.sh
Expand Down
31 changes: 0 additions & 31 deletions scripts/build/gn_build.sh

This file was deleted.

2 changes: 1 addition & 1 deletion scripts/run_in_build_env.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/bash
#!/usr/bin/env bash
#
# Copyright (c) 2020 Project CHIP Authors
#
Expand Down
2 changes: 1 addition & 1 deletion src/test_driver/happy/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@

$ scripts/build/gn_bootstrap.sh
$ scripts/build/gn_gen.sh --args="chip_enable_happy_tests=true"
$ scripts/build/gn_build.sh
$ ninja -C ./out

- Run Tests

Expand Down

0 comments on commit 1389360

Please sign in to comment.