EDE: add optional Electrical Protection Alarm cluster include (#72277) #439
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Copyright (c) 2022 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: Darwin Tests | |
| on: | |
| push: | |
| branches: | |
| - master | |
| - "v*-branch" | |
| 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_LOG_TIMESTAMPS: false | |
| jobs: | |
| test_suites_chip_tool_darwin: | |
| name: Test Suites - Darwin | |
| strategy: | |
| matrix: | |
| include: | |
| - os: macos-26 # NOTE: must match `runs-on` | |
| arch: arm64 # observed, not configured | |
| dry-run: true | |
| build_variant: no-ble-no-shell-asan-clang | |
| chip_tool: "" | |
| env: | |
| BUILD_VARIANT: ${{matrix.build_variant}} | |
| # We can't use the pigweed clang to build the Darwin framework once we start using | |
| # Swift, because it does not handle CLANG_ENABLE_MODULES correctly. | |
| # | |
| # But the Xcode clang does not handle LSan correctly. Since we can't easily apply | |
| # LSAN_OPTIONS to just everything except darwin-framework-tool, instead disable asan for | |
| # it. | |
| BUILD_VARIANT_FRAMEWORK_TOOL: no-ble | |
| LSAN_OPTIONS: detect_leaks=1 malloc_context_size=40 suppressions=scripts/tests/chiptest/lsan-mac-suppressions.txt | |
| DISABLE_CCACHE: ${{ (github.event_name == 'workflow_dispatch' && inputs.disable_ccache == 'true') && 'true' || (contains(github.event.head_commit.message, '[no-ccache]') && 'true') || 'false' }} | |
| CCACHE_KEY_SUFFIX: ${{ github.event_name == 'workflow_dispatch' && inputs.cache_suffix || '' }} | |
| if: github.actor != 'restyled-io[bot]' | |
| # Namespace MacOS 26 profile is configured as "26.3 with Xcode 26.2" currently | |
| # This is not yet enabled since namespace still has high concurrency limit: we have | |
| # 48 cores and are forced to 6 cores minimum. | |
| # runs-on: namespace-profile-macos-26 | |
| runs-on: macos-26 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 | |
| - name: Setup Environment | |
| # coreutils for stdbuf; gnubin is needed because newer coreutils only exposes 'stdbuf' under libexec/gnubin | |
| run: | | |
| brew install coreutils | |
| echo "$HOMEBREW_PREFIX/opt/coreutils/libexec/gnubin" >> "$GITHUB_PATH" | |
| - name: Try to ensure the directories for core dumping and diagnostic | |
| log collection exist and we can write them. | |
| run: | | |
| sudo chown ${USER} /cores || true | |
| mkdir -p ~/Library/Logs/DiagnosticReports || true | |
| mkdir objdir-clone || true | |
| - name: Checkout submodules & Bootstrap | |
| uses: ./.github/actions/checkout-submodules-and-bootstrap | |
| with: | |
| platform: darwin | |
| bootstrap-log-name: bootstrap-logs-darwin-${{ matrix.build_variant }} | |
| - name: Build iOS Darwin Framework Tool Build Debug | |
| working-directory: src/darwin/Framework | |
| run: xcodebuild -target "darwin-framework-tool" -sdk iphoneos -configuration Debug | |
| - name: Run macOS Darwin Framework Tool Build Debug | |
| working-directory: src/darwin/Framework | |
| run: xcodebuild -target "darwin-framework-tool" -sdk macosx -configuration Debug | |
| - name: Delete Defaults | |
| run: defaults delete com.apple.dt.xctest.tool | |
| continue-on-error: true | |
| - name: Clean Build | |
| run: xcodebuild clean | |
| working-directory: src/darwin/Framework | |
| - name: Setup and Restore Cache | |
| id: ccache | |
| uses: ./.github/actions/setup-ccache | |
| with: | |
| build-variant: ${{ matrix.build_variant }} | |
| disable: ${{ env.DISABLE_CCACHE }} | |
| cache-suffix: ${{ env.CCACHE_KEY_SUFFIX }} | |
| - name: Build Apps Using Unified Build | |
| run: | | |
| ./scripts/run_in_build_env.sh \ | |
| "./scripts/build/build_examples.py \ | |
| --target darwin-${{matrix.arch}}-lock-${BUILD_VARIANT}-unified \ | |
| --target darwin-${{matrix.arch}}-bridge-${BUILD_VARIANT}-unified \ | |
| --target darwin-${{matrix.arch}}-microwave-oven-${BUILD_VARIANT}-unified \ | |
| --target darwin-${{matrix.arch}}-rvc-${BUILD_VARIANT}-unified \ | |
| --target darwin-${{matrix.arch}}-ota-provider-${BUILD_VARIANT}-unified \ | |
| --pw-command-launcher=ccache \ | |
| build \ | |
| --copy-artifacts-to objdir-clone \ | |
| " | |
| - name: Clean out | |
| run: rm -rf out/ | |
| - name: Build Remaining Apps That Don't Support Unified Build | |
| run: | | |
| ./scripts/run_in_build_env.sh \ | |
| "./scripts/build/build_examples.py \ | |
| --target darwin-${{matrix.arch}}-darwin-framework-tool-${BUILD_VARIANT_FRAMEWORK_TOOL} \ | |
| --target darwin-${{matrix.arch}}-all-clusters-${BUILD_VARIANT} \ | |
| --target darwin-${{matrix.arch}}-ota-requestor-${BUILD_VARIANT} \ | |
| --target darwin-${{matrix.arch}}-tv-app-${BUILD_VARIANT} \ | |
| --target darwin-${{matrix.arch}}-lit-icd-${BUILD_VARIANT} \ | |
| --target darwin-${{matrix.arch}}-network-manager-${BUILD_VARIANT} \ | |
| --target darwin-${{matrix.arch}}-energy-gateway-${BUILD_VARIANT} \ | |
| --target darwin-${{matrix.arch}}-evse-${BUILD_VARIANT} \ | |
| --target darwin-${{matrix.arch}}-water-heater-${BUILD_VARIANT} \ | |
| --target darwin-${{matrix.arch}}-all-devices-${BUILD_VARIANT} \ | |
| --pw-command-launcher=ccache \ | |
| build \ | |
| --copy-artifacts-to objdir-clone \ | |
| " | |
| - name: ccache stats | |
| run: ccache -s | |
| - name: Run Tests | |
| run: | | |
| ./scripts/run_in_build_env.sh \ | |
| "./scripts/tests/run_test_suite.py \ | |
| --runner darwin_framework_tool_python \ | |
| --target-skip-glob '{TestAccessControlConstraints}' \ | |
| --test-order random \ | |
| run \ | |
| --iterations 1 \ | |
| --test-timeout-seconds 120 \ | |
| --tool-path darwin-framework-tool:./out/darwin-${{matrix.arch}}-darwin-framework-tool-${BUILD_VARIANT_FRAMEWORK_TOOL}/darwin-framework-tool \ | |
| --app-path all-clusters:./objdir-clone/darwin-${{matrix.arch}}-all-clusters-${BUILD_VARIANT}/chip-all-clusters-app \ | |
| --app-path all-devices:./objdir-clone/darwin-${{matrix.arch}}-all-devices-${BUILD_VARIANT}/all-devices-app \ | |
| --app-path lock:./objdir-clone/darwin-${{matrix.arch}}-lock-${BUILD_VARIANT}-unified/chip-lock-app \ | |
| --app-path ota-provider:./objdir-clone/darwin-${{matrix.arch}}-ota-provider-${BUILD_VARIANT}-unified/chip-ota-provider-app \ | |
| --app-path ota-requestor:./objdir-clone/darwin-${{matrix.arch}}-ota-requestor-${BUILD_VARIANT}/chip-ota-requestor-app \ | |
| --app-path tv:./objdir-clone/darwin-${{matrix.arch}}-tv-app-${BUILD_VARIANT}/chip-tv-app \ | |
| --app-path lit-icd:./objdir-clone/darwin-${{matrix.arch}}-lit-icd-${BUILD_VARIANT}/lit-icd-app \ | |
| --app-path bridge:./objdir-clone/darwin-${{matrix.arch}}-bridge-${BUILD_VARIANT}-unified/chip-bridge-app \ | |
| --app-path microwave-oven:./objdir-clone/darwin-${{matrix.arch}}-microwave-oven-${BUILD_VARIANT}-unified/chip-microwave-oven-app \ | |
| --app-path rvc:./objdir-clone/darwin-${{matrix.arch}}-rvc-${BUILD_VARIANT}-unified/chip-rvc-app \ | |
| --app-path network-manager:./objdir-clone/darwin-${{matrix.arch}}-network-manager-${BUILD_VARIANT}/matter-network-manager-app \ | |
| --app-path energy-gateway:./objdir-clone/darwin-${{matrix.arch}}-energy-gateway-${BUILD_VARIANT}/chip-energy-gateway-app \ | |
| --app-path evse:./objdir-clone/darwin-${{matrix.arch}}-evse-${BUILD_VARIANT}/chip-evse-app \ | |
| --app-path water-heater:./objdir-clone/darwin-${{matrix.arch}}-water-heater-${BUILD_VARIANT}/matter-water-heater-app \ | |
| " | |
| - name: Run OTA Test | |
| run: | | |
| ./scripts/run_in_build_env.sh \ | |
| "./scripts/tests/run_darwin_framework_ota_test.py \ | |
| run \ | |
| --darwin-framework-tool ./out/darwin-${{matrix.arch}}-darwin-framework-tool-${BUILD_VARIANT_FRAMEWORK_TOOL}/darwin-framework-tool \ | |
| --ota-requestor-app ./objdir-clone/darwin-${{matrix.arch}}-ota-requestor-${BUILD_VARIANT}/chip-ota-requestor-app \ | |
| --ota-data-file /tmp/rawImage \ | |
| --ota-image-file /tmp/otaImage \ | |
| --ota-destination-file /tmp/downloadedImage \ | |
| --ota-candidate-file /tmp/otaCandidateJSON \ | |
| " | |
| - name: Uploading core files | |
| uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7 | |
| if: ${{ failure() && !env.ACT }} | |
| with: | |
| name: crash-core-darwin-${{ matrix.build_variant }} | |
| path: /cores/ | |
| # Cores are big; don't hold on to them too long. | |
| retention-days: 5 | |
| - name: Uploading diagnostic logs | |
| uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7 | |
| if: ${{ failure() && !env.ACT }} | |
| with: | |
| name: crash-log-darwin-${{ matrix.build_variant }} | |
| path: ~/Library/Logs/DiagnosticReports/ | |
| - name: Uploading framework build log | |
| uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7 | |
| if: ${{ failure() && !env.ACT }} | |
| with: | |
| name: framework-build-log-darwin-${BUILD_VARIANT_FRAMEWORK_TOOL} | |
| path: out/darwin-${{matrix.arch}}-darwin-framework-tool-${BUILD_VARIANT_FRAMEWORK_TOOL}/darwin_framework_build.log | |
| - name: Uploading objdir for debugging | |
| uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7 | |
| if: ${{ failure() && !env.ACT }} | |
| with: | |
| name: crash-objdir-darwin-${{ matrix.build_variant }} | |
| path: objdir-clone/ | |
| # objdirs are big; don't hold on to them too long. | |
| retention-days: 5 | |
| - name: Ensure only useful ccache is kept | |
| if: github.ref == 'refs/heads/master' && env.DISABLE_CCACHE != 'true' | |
| run: ccache --evict-older-than 1d || true | |
| - name: Delete existing ccache before save | |
| if: github.ref == 'refs/heads/master' && env.DISABLE_CCACHE != 'true' | |
| uses: ./.github/actions/delete-cache | |
| with: | |
| cache-key: ${{ env.CCACHE_KEY }} | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Save ccache | |
| if: github.ref == 'refs/heads/master' && env.DISABLE_CCACHE != 'true' | |
| uses: actions/cache/save@v5 | |
| with: | |
| path: .ccache | |
| key: ${{ env.CCACHE_KEY }} | |
| - name: Notify Slack on Failure | |
| if: failure() | |
| uses: ./.github/actions/notify-slack-failure | |
| with: | |
| slack-webhook: ${{ secrets.SWTT_SLACK_WEBHOOK }} |