| # Copyright (c) 2020-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: Darwin |
| |
| on: |
| push: |
| pull_request: |
| 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 |
| |
| jobs: |
| darwin: |
| name: Build Darwin |
| timeout-minutes: 210 |
| |
| if: github.actor != 'restyled-io[bot]' |
| runs-on: macos-latest |
| |
| steps: |
| - uses: Wandalen/wretry.action@v1.0.36 |
| name: Checkout |
| with: |
| action: actions/checkout@v3 |
| with: | |
| token: ${{ github.token }} |
| attempt_limit: 3 |
| attempt_delay: 2000 |
| - name: Checkout submodules |
| run: scripts/checkout_submodules.py --shallow --platform darwin |
| - name: Setup Environment |
| run: brew install openssl pkg-config python@3.9 |
| - name: Fix pkgconfig link |
| working-directory: /usr/local/lib/pkgconfig |
| run: | |
| pwd |
| ls -la /usr/local/Cellar/ |
| ls -la /usr/local/Cellar/openssl@1.1 |
| OPEN_SSL_VERSION=`ls -la /usr/local/Cellar/openssl@1.1 | cat | tail -n1 | awk '{print $NF}'` |
| ln -s /usr/local/Cellar/openssl@1.1/$OPEN_SSL_VERSION/lib/pkgconfig/* . |
| - name: Install zap |
| run: | |
| sudo mkdir -p $ZAP_INSTALL_PATH |
| sudo chown `whoami` $ZAP_INSTALL_PATH |
| curl -L https://github.com/project-chip/zap/releases/download/${ZAP_VERSION}/zap-mac.zip \ |
| --output $ZAP_INSTALL_PATH/zap-mac.zip |
| cd $ZAP_INSTALL_PATH |
| unzip zap-mac.zip zap-cli |
| rm zap-mac.zip |
| ./zap-cli --version |
| env: |
| # NOTE: Generally kept in sync within the repo using |
| # scripts/tools/zap/version_update.py |
| # This is scoped to only the steps that don't use xcodebuild. |
| ZAP_VERSION: v2023.01.19-nightly |
| ZAP_INSTALL_PATH: /usr/local/zap/zap-v2023.01.19-nightly |
| - name: Bootstrap |
| timeout-minutes: 25 |
| run: scripts/build/gn_bootstrap.sh |
| - name: Uploading bootstrap logs |
| uses: actions/upload-artifact@v3 |
| if: ${{ always() && !env.ACT }} |
| with: |
| name: bootstrap-logs |
| path: | |
| .environment/gn_out/.ninja_log |
| .environment/pigweed-venv/*.log |
| - name: Run iOS Build Debug |
| timeout-minutes: 50 |
| working-directory: src/darwin/Framework |
| # For now disable unguarded-availability-new warnings because we |
| # internally use APIs that we are annotating as only available on |
| # new enough versions. Maybe we should change out deployment |
| # target versions instead? |
| run: xcodebuild -target "Matter" -sdk iphoneos OTHER_CFLAGS='${inherited} -Wno-unguarded-availability-new' |
| - name: Run iOS Build Release |
| timeout-minutes: 50 |
| working-directory: src/darwin/Framework |
| # For now disable unguarded-availability-new warnings because we |
| # internally use APIs that we are annotating as only available on |
| # new enough versions. Maybe we should change out deployment |
| # target versions instead? |
| run: xcodebuild -target "Matter" -sdk iphoneos -configuration Release OTHER_CFLAGS='${inherited} -Wno-unguarded-availability-new' |
| - name: Clean Build |
| run: xcodebuild clean |
| working-directory: src/darwin/Framework |
| - name: Delete Defaults |
| run: defaults delete com.apple.dt.xctest.tool |
| continue-on-error: true |
| - name: Run macOS Build |
| timeout-minutes: 70 |
| # Enable -Werror by hand here, because the Xcode config can't |
| # enable it for various reasons. Keep whatever Xcode settings |
| # for OTHER_CFLAGS exist by using ${inherited}. |
| # |
| # Enable -Wconversion by hand as well, because it seems to not be |
| # enabled by default in the Xcode config. |
| # |
| # Disable -Wunguarded-availability-new because we internally use |
| # APIs we added after our deployment target version. Maybe we |
| # should change the deployment target version instead? |
| run: xcodebuild -target "Matter" -sdk macosx OTHER_CFLAGS='${inherited} -Werror -Wconversion -Wno-unguarded-availability-new' |
| working-directory: src/darwin/Framework |
| - name: Clean Build |
| run: xcodebuild clean |
| working-directory: src/darwin/Framework |
| - name: Build example All Clusters Server |
| timeout-minutes: 15 |
| run: | |
| scripts/examples/gn_build_example.sh examples/all-clusters-app/linux out/debug chip_config_network_layer_ble=false |
| env: |
| # NOTE: Generally kept in sync within the repo using |
| # scripts/tools/zap/version_update.py |
| # This is scoped to only the steps that don't use xcodebuild. |
| ZAP_VERSION: v2023.01.19-nightly |
| ZAP_INSTALL_PATH: /usr/local/zap/zap-v2023.01.19-nightly |
| - name: Build example OTA Provider |
| timeout-minutes: 10 |
| run: | |
| scripts/examples/gn_build_example.sh examples/ota-provider-app/linux out/debug chip_config_network_layer_ble=false |
| env: |
| # NOTE: Generally kept in sync within the repo using |
| # scripts/tools/zap/version_update.py |
| # This is scoped to only the steps that don't use xcodebuild. |
| ZAP_VERSION: v2023.01.19-nightly |
| ZAP_INSTALL_PATH: /usr/local/zap/zap-v2023.01.19-nightly |
| - name: Build example OTA Requestor |
| timeout-minutes: 10 |
| run: | |
| scripts/examples/gn_build_example.sh examples/ota-requestor-app/linux out/debug chip_config_network_layer_ble=false |
| env: |
| # NOTE: Generally kept in sync within the repo using |
| # scripts/tools/zap/version_update.py |
| # This is scoped to only the steps that don't use xcodebuild. |
| ZAP_VERSION: v2023.01.19-nightly |
| ZAP_INSTALL_PATH: /usr/local/zap/zap-v2023.01.19-nightly |
| - name: Delete Defaults |
| run: defaults delete com.apple.dt.xctest.tool |
| continue-on-error: true |
| - name: Run Framework Tests |
| timeout-minutes: 20 |
| # For now disable unguarded-availability-new warnings because we |
| # internally use APIs that we are annotating as only available on |
| # new enough versions. Maybe we should change out deployment |
| # target versions instead? |
| run: | |
| mkdir -p /tmp/darwin/framework-tests |
| ../../../out/debug/chip-all-clusters-app --interface-id -1 > >(tee /tmp/darwin/framework-tests/all-cluster-app.log) 2> >(tee /tmp/darwin/framework-tests/all-cluster-app-err.log >&2) & |
| xcodebuild test -target "Matter" -scheme "Matter Framework Tests" -sdk macosx OTHER_CFLAGS='${inherited} -Werror -Wconversion -Wno-incomplete-umbrella -Wno-unguarded-availability-new' > >(tee /tmp/darwin/framework-tests/darwin-tests.log) 2> >(tee /tmp/darwin/framework-tests/darwin-tests-err.log >&2) |
| working-directory: src/darwin/Framework |
| - name: Uploading log files |
| uses: actions/upload-artifact@v3 |
| if: ${{ failure() && !env.ACT }} |
| with: |
| name: darwin-framework-test-logs |
| path: /tmp/darwin/framework-tests |
| retention-days: 5 |