# 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:
        branches-ignore:
            - "dependabot/**"
    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:
    framework:
        name: Build framework
        if: github.actor != 'restyled-io[bot]'
        runs-on: macos-13
        strategy:
            matrix:
                options: # We don't need a full matrix
                    - flavor: macos-release
                      arguments: -sdk macosx -configuration Release
                    - flavor: ios-release
                      arguments: -sdk iphoneos -configuration Release
                    - flavor: tvos-debug
                      arguments: -sdk appletvos -configuration Debug
                    - flavor: watchos-debug
                      arguments: -sdk watchos -configuration Debug
        steps:
            - name: Checkout
              uses: actions/checkout@v4
            - name: Checkout submodules & Bootstrap
              uses: ./.github/actions/checkout-submodules-and-bootstrap
              with:
                  platform: darwin
                  bootstrap-log-name:
                      bootstrap-logs-framework-${{ matrix.options.flavor }}
            - name: Block zap-cli from being used
              env:
                  PW_ENVSETUP_NO_BANNER: 1
              run: |
                  # Framework builds are NOT expected to require zap-cli
                  scripts/run_in_build_env.sh 'rm -- "$(which zap-cli)"'
                  # run_in_build_env.sh is used to ensure PATH is set to something that would otherwise find zap-cli
                  scripts/run_in_build_env.sh '(zap-cli --version && exit 1) || exit 0'
            - name: Build
              working-directory: src/darwin/Framework
              run: xcodebuild -target "Matter" ${{ matrix.options.arguments }}

    tests:
        name: Run framework tests
        if: github.actor != 'restyled-io[bot]'
        needs: [framework] # serialize to avoid running to many parallel macos runners
        runs-on: macos-13
        strategy:
            matrix:
                options: # We don't need a full matrix
                    - flavor: asan
                      arguments:
                          -enableAddressSanitizer YES
                          -enableUndefinedBehaviorSanitizer YES
                    - flavor: tsan
                      arguments: -enableThreadSanitizer YES
                    # "leaks" does not seem to be very compatible with asan or tsan
                    - flavor: leaks
                      defines: ENABLE_LEAK_DETECTION=1
        steps:
            - name: Checkout
              uses: actions/checkout@v4
            - name: Checkout submodules & Bootstrap
              uses: ./.github/actions/checkout-submodules-and-bootstrap
              with:
                  platform: darwin
                  bootstrap-log-name:
                      bootstrap-logs-framework-${{ matrix.options.flavor }}
            - name: Build example All Clusters Server
              run: |
                  scripts/examples/gn_build_example.sh examples/all-clusters-app/linux out/debug/all-clusters-app chip_config_network_layer_ble=false
            - name: Build example OTA Provider
              run: |
                  scripts/examples/gn_build_example.sh examples/ota-provider-app/linux out/debug/ota-provider-app chip_config_network_layer_ble=false
            - name: Build example OTA Requestor
              run: |
                  scripts/examples/gn_build_example.sh examples/ota-requestor-app/linux out/debug/ota-requestor-app chip_config_network_layer_ble=false non_spec_compliant_ota_action_delay_floor=0
            - name: Run Framework Tests
              # 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?
              working-directory: src/darwin/Framework
              run: |
                  mkdir -p /tmp/darwin/framework-tests
                  echo "This is a simple log" > /tmp/darwin/framework-tests/end_user_support_log.txt
                  ../../../out/debug/all-clusters-app/chip-all-clusters-app --interface-id -1 --end_user_support_log /tmp/darwin/framework-tests/end_user_support_log.txt > >(tee /tmp/darwin/framework-tests/all-cluster-app.log) 2> >(tee /tmp/darwin/framework-tests/all-cluster-app-err.log >&2) &

                  export TEST_RUNNER_ASAN_OPTIONS=__CURRENT_VALUE__:detect_stack_use_after_return=1

                  # Disable BLE (CHIP_IS_BLE=NO) because the app does not have the permission to use it and that may crash the CI.
                  xcodebuild test -target "Matter" -scheme "Matter Framework Tests" -sdk macosx ${{ matrix.options.arguments }} \
                    CHIP_IS_BLE=NO GCC_PREPROCESSOR_DEFINITIONS='${inherited} ${{ matrix.options.defines }}' \
                    > >(tee /tmp/darwin/framework-tests/darwin-tests.log) 2> >(tee /tmp/darwin/framework-tests/darwin-tests-err.log >&2)
            - name: Collect crash logs
              if: failure() && !env.ACT
              run: |
                  mkdir -p /tmp/darwin/framework-tests
                  find ~/Library/Developer/Xcode/DerivedData /Library/Logs/DiagnosticReports -name '*.ips' -print0 | xargs -0 -J % cp % /tmp/darwin/framework-tests
            - name: Uploading log files
              uses: actions/upload-artifact@v4
              if: failure() && !env.ACT
              with:
                  name: darwin-framework-test-logs-${{ matrix.options.flavor }}
                  path: /tmp/darwin/framework-tests
                  retention-days: 5
