Skip to content

Commit 3621139

Browse files
andy31415pull[bot]
authored andcommitted
Remove scripts/build/gn_build.sh (#11905)
* 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
1 parent 45415e2 commit 3621139

File tree

5 files changed

+12
-84
lines changed

5 files changed

+12
-84
lines changed

.github/workflows/build.yaml

+9-50
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ jobs:
6868
run: scripts/build/gn_gen.sh --args="chip_config_memory_debug_checks=true chip_config_memory_debug_dmalloc=true"
6969
- name: Run Build
7070
timeout-minutes: 20
71-
run: scripts/build/gn_build.sh
71+
run: scripts/run_in_build_env.sh "ninja -C ./out"
7272
- name: Run Tests
7373
timeout-minutes: 2
7474
run: scripts/tests/gn_tests.sh
@@ -84,12 +84,12 @@ jobs:
8484
run: scripts/build/gn_gen.sh --args="chip_detail_logging=false"
8585
- name: Run Build Without Detail Logging
8686
timeout-minutes: 20
87-
run: scripts/build/gn_build.sh
87+
run: scripts/run_in_build_env.sh "ninja -C ./out"
8888
- name: Setup Build Without Progress Logging
8989
run: scripts/build/gn_gen.sh --args="chip_detail_logging=false chip_progress_logging=false"
9090
- name: Run Build Without Progress Logging
9191
timeout-minutes: 20
92-
run: scripts/build/gn_build.sh
92+
run: scripts/run_in_build_env.sh "ninja -C ./out"
9393
build_linux:
9494
name: Build on Linux (gcc_release, clang, mbedtls)
9595
timeout-minutes: 60
@@ -146,7 +146,7 @@ jobs:
146146
esac
147147
148148
scripts/build/gn_gen.sh --args="$GN_ARGS"
149-
scripts/build/gn_build.sh
149+
scripts/run_in_build_env.sh "ninja -C ./out"
150150
scripts/tests/gn_tests.sh
151151
done
152152
- name: Build using build_examples.py
@@ -156,7 +156,7 @@ jobs:
156156
run: |
157157
./scripts/run_in_build_env.sh \
158158
"./scripts/build/build_examples.py --no-log-timestamps --target-glob 'linux-x64-*' build"
159-
159+
160160
# TODO Log Upload https://github.com/project-chip/connectedhomeip/issues/2227
161161
# TODO https://github.com/project-chip/connectedhomeip/issues/1512
162162
# - name: Run Code Coverage
@@ -202,64 +202,23 @@ jobs:
202202
uses: actions/checkout@v2
203203
with:
204204
submodules: true
205-
# - name: Initialize CodeQL
206-
# if: ${{ github.event_name == 'push' && github.event.ref == 'refs/heads/master' }}
207-
# uses: github/codeql-action/init@v1
208-
# with:
209-
# languages: "cpp"
210-
211205
- name: Bootstrap
212206
timeout-minutes: 10
213207
run: scripts/build/gn_bootstrap.sh
214-
# - name: Uploading bootstrap logs
215-
# uses: actions/upload-artifact@v2
216-
# if: ${{ always() }}
217-
# with:
218-
# name: bootstrap-logs
219-
# path: |
220-
# .environment/gn_out/.ninja_log
221-
# .environment/pigweed-venv/*.log
222208
- name: Setup Build, Run Build and Run Tests
223209
timeout-minutes: 50
224210
run: |
225-
for BUILD_TYPE in python_lib; do
226-
case $BUILD_TYPE in
227-
"python_lib") GN_ARGS='enable_rtti=true enable_pylib=true chip_config_memory_debug_checks=false chip_config_memory_debug_dmalloc=false';;
228-
esac
229-
230-
scripts/build/gn_gen.sh --args="$GN_ARGS"
231-
scripts/build/gn_build.sh
232-
scripts/tests/gn_tests.sh
233-
done
211+
scripts/build/gn_gen.sh --args="enable_rtti=true enable_pylib=true chip_config_memory_debug_checks=false chip_config_memory_debug_dmalloc=false"
212+
scripts/run_in_build_env.sh "ninja -C ./out"
213+
scripts/tests/gn_tests.sh
234214
- name: Run Python library specific unit tests
235215
timeout-minutes: 5
236216
run: |
237217
scripts/run_in_build_env.sh 'pip3 install ./out/controller/python/chip-0.0-cp37-abi3-linux_x86_64.whl'
238218
scripts/run_in_build_env.sh '(cd src/controller/python/test/unit_tests/ && python3 -m unittest -v)'
239-
# TODO Log Upload https://github.com/project-chip/connectedhomeip/issues/2227
240-
# TODO https://github.com/project-chip/connectedhomeip/issues/1512
241-
# - name: Run Code Coverage
242-
# if: ${{ contains('main', env.BUILD_TYPE) }}
243-
# run: scripts/tools/codecoverage.sh
244-
# - name: Upload Code Coverage
245-
# if: ${{ contains('main', env.BUILD_TYPE) }}
246-
# run: bash <(curl -s https://codecov.io/bash)
247-
# - name: Remove third_party binaries for CodeQL Analysis
248-
# run: find out -type d -name "third_party" -exec rm -rf {} +
249-
# - name: Remove dbus binaries for CodeQL Analysis
250-
# run: find out -type d -name "dbus" -exec rm -rf {} +
251-
# - name: Remove nrfxlib binaries for CodeQL Analysis
252-
# run: find . -type d -name "nrfxlib" -exec rm -rf {} +
253-
# - name: Perform CodeQL Analysis
254-
# if: ${{ github.event_name == 'push' && github.event.ref == 'refs/heads/master' }}
255-
# uses: github/codeql-action/analyze@v1
256219
build_darwin:
257220
name: Build on Darwin (clang, python_lib)
258221
timeout-minutes: 90
259-
260-
env:
261-
BUILD_TYPE: clang
262-
263222
runs-on: macos-latest
264223
if: github.actor != 'restyled-io[bot]'
265224

@@ -305,7 +264,7 @@ jobs:
305264
"python_lib") GN_ARGS='enable_rtti=true enable_pylib=true';;
306265
esac
307266
scripts/build/gn_gen.sh --args="$GN_ARGS"
308-
scripts/build/gn_build.sh
267+
scripts/run_in_build_env.sh "ninja -C ./out"
309268
scripts/tests/gn_tests.sh
310269
done
311270
- name: Uploading diagnostic logs

.github/workflows/unit_integration_test.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ jobs:
8585
scripts/build/gn_gen.sh --args="$GN_ARGS chip_enable_happy_tests=true"
8686
- name: Run Build
8787
timeout-minutes: 8
88-
run: scripts/build/gn_build.sh
88+
run: scripts/run_in_build_env.sh "ninja -C out/$BUILD_TYPE"
8989
- name: Run Tests
9090
timeout-minutes: 15
9191
run: RUN_HAPPY_TESTS=1 scripts/tests/gn_tests.sh

scripts/build/gn_build.sh

-31
This file was deleted.

scripts/run_in_build_env.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/bash
1+
#!/usr/bin/env bash
22
#
33
# Copyright (c) 2020 Project CHIP Authors
44
#

src/test_driver/happy/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535

3636
$ scripts/build/gn_bootstrap.sh
3737
$ scripts/build/gn_gen.sh --args="chip_enable_happy_tests=true"
38-
$ scripts/build/gn_build.sh
38+
$ ninja -C ./out
3939

4040
- Run Tests
4141

0 commit comments

Comments
 (0)