-
Notifications
You must be signed in to change notification settings - Fork 2.4k
140 lines (132 loc) · 6.4 KB
/
darwin.yaml
File metadata and controls
140 lines (132 loc) · 6.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
# 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:
- 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:
framework:
name: Build framework
if: github.actor != 'restyled-io[bot]'
strategy:
matrix:
os: [ macos-26 ]
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
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v6
- 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
run: xcodebuild -scheme "Matter Framework" -derivedDataPath ./Framework/build ${{ matrix.options.arguments }}
- name: Build CHIPTool
if: ${{ matrix.options.flavor == 'ios-release' }}
working-directory: src/darwin
# Use the same derivedDataPath as the framework build, so we don't have to build the framework again and can use the one we already built.
run: xcodebuild -scheme "CHIP Tool App" -derivedDataPath ./Framework/build ${{ matrix.options.arguments }} CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO
tests:
name: Run framework tests
if: github.actor != 'restyled-io[bot]'
needs: [framework] # serialize to avoid running to many parallel macos runners
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ macos-26 ]
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@v6
- name: Checkout submodules & Bootstrap
uses: ./.github/actions/checkout-submodules-and-bootstrap
with:
platform: darwin
bootstrap-log-name:
bootstrap-logs-framework-${{ matrix.options.flavor }}
- name: Run Framework Tests
# We want to ensure that our log upload runs on timeout, so use a timeout here shorter
# than the 6-hour overall job timeout. 4.5 hours should be plenty.
timeout-minutes: 270
working-directory: src/darwin/Framework
run: |
mkdir -p /tmp/darwin/framework-tests
export TEST_RUNNER_ASAN_OPTIONS=__CURRENT_VALUE__:detect_stack_use_after_return=1
echo "Quiet work in progress - artifacts 'darwin-tests.log' and 'darwin-tests-err.log' will be output."
xcodebuild test -target "Matter" -scheme "Matter Framework Tests" \
-resultBundlePath /tmp/darwin/framework-tests/TestResults.xcresult \
-sdk macosx ${{ matrix.options.arguments }} \
GCC_PREPROCESSOR_DEFINITIONS='${inherited} ${{ matrix.options.defines }}' \
> /tmp/darwin/framework-tests/darwin-tests.log 2> /tmp/darwin/framework-tests/darwin-tests-err.log
- name: Generate Summary
if: always()
working-directory: /tmp
run: |
wget https://github.com/a7ex/xcresultparser/releases/download/1.8.4/xcresultparser.zip
unzip -j xcresultparser.zip
./xcresultparser --output-format md --failed-tests-only /tmp/darwin/framework-tests/TestResults.xcresult >>"$GITHUB_STEP_SUMMARY"
- 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@v7
if: failure() && !env.ACT
with:
name: darwin-framework-test-logs-${{ matrix.options.flavor }}
path: /tmp/darwin/framework-tests
retention-days: 5