| # Copyright (c) 2021 Project CHIP Authors |
| # |
| # Licensed under the Apache License, Version 2.0 (the "License"); |
| # you may not use this file except in compliance with the License. |
| # You may obtain a copy of the License at |
| # |
| # http://www.apache.org/licenses/LICENSE-2.0 |
| # |
| # Unless required by applicable law or agreed to in writing, software |
| # distributed under the License is distributed on an "AS IS" BASIS, |
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| # See the License for the specific language governing permissions and |
| # limitations under the License. |
| |
| name: Build example - Open IoT SDK |
| |
| on: |
| push: |
| pull_request: |
| merge_group: |
| workflow_dispatch: |
| |
| concurrency: |
| group: ${{ github.ref }}-${{ github.workflow }}-${{ (github.event_name == 'pull_request' && github.event.number) || (github.event_name == 'workflow_dispatch' && github.run_number) || github.sha }} |
| cancel-in-progress: true |
| |
| env: |
| CHIP_NO_LOG_TIMESTAMPS: true |
| |
| jobs: |
| openiotsdk: |
| name: Open IoT SDK examples building |
| |
| env: |
| TEST_NETWORK_NAME: OIStest |
| |
| runs-on: ubuntu-latest |
| if: github.actor != 'restyled-io[bot]' |
| |
| container: |
| image: connectedhomeip/chip-build-openiotsdk:0.7.3 |
| volumes: |
| - "/tmp/bloat_reports:/tmp/bloat_reports" |
| options: --privileged |
| |
| steps: |
| - name: Checkout |
| uses: actions/checkout@v3 |
| - name: Checkout submodules & Bootstrap |
| uses: ./.github/actions/checkout-submodules-and-bootstrap |
| with: |
| platform: openiotsdk |
| extra-submodule-parameters: " --recursive" |
| |
| - name: Set up environment for size reports |
| uses: ./.github/actions/setup-size-reports |
| if: ${{ !env.ACT }} |
| with: |
| gh-context: ${{ toJson(github) }} |
| |
| - name: Build and install Python controller |
| run: | |
| scripts/run_in_build_env.sh './scripts/build_python.sh --install_virtual_env out/venv' |
| scripts/run_in_python_env.sh out/venv 'pip install -r scripts/setup/requirements.openiotsdk.txt' |
| |
| - name: Build shell example |
| id: build_shell |
| run: | |
| scripts/examples/openiotsdk_example.sh shell |
| .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ |
| openiotsdk release shell \ |
| examples/shell/openiotsdk/build/chip-openiotsdk-shell-example.elf \ |
| /tmp/bloat_reports/ |
| |
| - name: Build lock-app example (mbedtls) |
| id: build_lock_app_mbedtls |
| run: | |
| scripts/examples/openiotsdk_example.sh -b mbedtls lock-app |
| .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ |
| openiotsdk release lock-app-mbedtls \ |
| examples/lock-app/openiotsdk/build/chip-openiotsdk-lock-app-example.elf \ |
| /tmp/bloat_reports/ |
| |
| - name: Build unit tests (mbedtls) |
| id: build_unit_tests_mbedtls |
| run: | |
| scripts/examples/openiotsdk_example.sh -b mbedtls unit-tests |
| |
| - name: "Test: shell example" |
| if: steps.build_shell.outcome == 'success' |
| run: | |
| scripts/run_in_python_env.sh out/venv \ |
| 'scripts/examples/openiotsdk_example.sh --no-activate -C test shell' |
| |
| - name: "Test: lock-app example (mbedtls)" |
| if: steps.build_lock_app_mbedtls.outcome == 'success' |
| run: | |
| scripts/setup/openiotsdk/network_setup.sh -n $TEST_NETWORK_NAME up |
| scripts/run_in_python_env.sh out/venv \ |
| 'scripts/run_in_ns.sh ${TEST_NETWORK_NAME}ns scripts/examples/openiotsdk_example.sh --no-activate -C test -n ${TEST_NETWORK_NAME}tap lock-app' |
| scripts/setup/openiotsdk/network_setup.sh -n $TEST_NETWORK_NAME down |
| |
| - name: "Test: unit-tests (mbedtls)" |
| if: steps.build_unit_tests_mbedtls.outcome == 'success' |
| run: | |
| scripts/run_in_python_env.sh out/venv \ |
| 'scripts/examples/openiotsdk_example.sh --no-activate -C test unit-tests' |
| |
| - name: Build lock-app example (psa) |
| id: build_lock_app_psa |
| run: | |
| scripts/examples/openiotsdk_example.sh -c -b psa lock-app |
| .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ |
| openiotsdk release lock-app-psa \ |
| examples/lock-app/openiotsdk/build/chip-openiotsdk-lock-app-example.elf \ |
| /tmp/bloat_reports/ |
| |
| - name: Build unit tests (psa) |
| id: build_unit_tests_psa |
| run: | |
| scripts/examples/openiotsdk_example.sh -b psa unit-tests |
| |
| - name: "Test: lock-app example (psa)" |
| if: steps.build_lock_app_psa.outcome == 'success' |
| run: | |
| scripts/setup/openiotsdk/network_setup.sh -n $TEST_NETWORK_NAME up |
| scripts/run_in_python_env.sh out/venv \ |
| 'scripts/run_in_ns.sh ${TEST_NETWORK_NAME}ns scripts/examples/openiotsdk_example.sh --no-activate -C test -n ${TEST_NETWORK_NAME}tap lock-app' |
| scripts/setup/openiotsdk/network_setup.sh -n $TEST_NETWORK_NAME down |
| |
| - name: "Test: unit-tests (psa)" |
| if: steps.build_unit_tests_psa.outcome == 'success' |
| run: | |
| scripts/run_in_python_env.sh out/venv \ |
| 'scripts/examples/openiotsdk_example.sh --no-activate -C test unit-tests' |