# 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) &
                  ../../../out/debug/all-clusters-app/chip-all-clusters-app --interface-id -1 --dac_provider ../../../credentials/development/commissioner_dut/struct_cd_origin_pid_vid_correct/test_case_vector.json --product-id 32768 --discriminator 3839 --secured-device-port 5539 --KVS /tmp/chip-all-clusters-app-kvs2 > >(tee /tmp/darwin/framework-tests/all-cluster-app-origin-vid.log) 2> >(tee /tmp/darwin/framework-tests/all-cluster-app-origin-vid-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
