@@ -26,14 +26,25 @@ concurrency:
26
26
27
27
env :
28
28
CHIP_NO_LOG_TIMESTAMPS : true
29
-
30
- jobs :
31
- darwin :
32
- name : Build Darwin
33
29
30
+ jobs :
31
+ framework :
32
+ name : Build framework
34
33
if : github.actor != 'restyled-io[bot]'
35
34
runs-on : macos-latest
36
-
35
+ strategy :
36
+ matrix :
37
+ options : # We don't need a full matrix
38
+ - flavor : macos-release-availability
39
+ arguments : -sdk macosx -configuration Release OTHER_CFLAGS='${inherited} -Werror -Wconversion -Wno-unguarded-availability-new'
40
+ - flavor : ios-release
41
+ arguments : -sdk iphoneos -configuration Release OTHER_CFLAGS='${inherited} -Werror -Wconversion' GCC_PREPROCESSOR_DEFINITIONS='${inherited} MTR_NO_AVAILABILITY=1'
42
+ - flavor : ios-debug
43
+ arguments : -sdk iphoneos -configuration Debug OTHER_CFLAGS='${inherited} -Werror -Wconversion' GCC_PREPROCESSOR_DEFINITIONS='${inherited} MTR_NO_AVAILABILITY=1'
44
+ - flavor : tvos-debug
45
+ arguments : -sdk appletvos -configuration Debug OTHER_CFLAGS='${inherited} -Werror -Wconversion' GCC_PREPROCESSOR_DEFINITIONS='${inherited} MTR_NO_AVAILABILITY=1'
46
+ - flavor : watchos-debug
47
+ arguments : -sdk watchos -configuration Debug OTHER_CFLAGS='${inherited} -Werror -Wconversion' GCC_PREPROCESSOR_DEFINITIONS='${inherited} MTR_NO_AVAILABILITY=1'
37
48
steps :
38
49
- name : Checkout
39
50
uses : actions/checkout@v4
@@ -43,57 +54,41 @@ jobs:
43
54
uses : ./.github/actions/checkout-submodules-and-bootstrap
44
55
with :
45
56
platform : darwin
57
+ bootstrap-log-name : bootstrap-logs-framework-${{ matrix.options.flavor }}
46
58
- name : Block zap-cli from being used
47
- # xcodebuild is NOT expected to require zap-cli
48
- run : scripts/run_in_build_env.sh 'D=$(dirname $(which zap-cli)) && mv $D/zap-cli $D/zap-cli.moved'
49
- - name : Validate zap-cli is NOT available
50
- # run_in_build_env.sh is used to ensure PATH is set to something that would otherwise find zap-cli
51
- run : scripts/run_in_build_env.sh '(zap-cli --version && exit 1) || exit 0'
52
- - name : Run watchOS Build Debug
53
- working-directory : src/darwin/Framework
54
- # Disable availability annotations, since we are not building a system
55
- # Matter.framework.
56
- run : xcodebuild -target "Matter" -sdk watchos -configuration Debug GCC_PREPROCESSOR_DEFINITIONS='${inherited} MTR_NO_AVAILABILITY=1'
57
- - name : Run tvOS Build Debug
58
- working-directory : src/darwin/Framework
59
- # Disable availability annotations, since we are not building a system
60
- # Matter.framework.
61
- run : xcodebuild -target "Matter" -sdk appletvos -configuration Debug GCC_PREPROCESSOR_DEFINITIONS='${inherited} MTR_NO_AVAILABILITY=1'
62
- - name : Run iOS Build Debug
63
- working-directory : src/darwin/Framework
64
- # Disable availability annotations, since we are not building a system
65
- # Matter.framework.
66
- run : xcodebuild -target "Matter" -sdk iphoneos -configuration Debug GCC_PREPROCESSOR_DEFINITIONS='${inherited} MTR_NO_AVAILABILITY=1'
67
- - name : Run iOS Build Release
68
- working-directory : src/darwin/Framework
69
- # Disable availability annotations, since we are not building a system
70
- # Matter.framework.
71
- run : xcodebuild -target "Matter" -sdk iphoneos -configuration Release GCC_PREPROCESSOR_DEFINITIONS='${inherited} MTR_NO_AVAILABILITY=1'
72
- - name : Clean Build
73
- run : xcodebuild clean
74
- working-directory : src/darwin/Framework
75
- - name : Delete Defaults
76
- run : defaults delete com.apple.dt.xctest.tool
77
- continue-on-error : true
78
- - name : Run macOS Build
79
- # Enable -Werror by hand here, because the Xcode config can't
80
- # enable it for various reasons. Keep whatever Xcode settings
81
- # for OTHER_CFLAGS exist by using ${inherited}.
82
- #
83
- # Enable -Wconversion by hand as well, because it seems to not be
84
- # enabled by default in the Xcode config.
85
- #
86
- # Disable availability annotations, since we are not building a system
87
- # Matter.framework.
88
- run : xcodebuild -target "Matter" -sdk macosx OTHER_CFLAGS='${inherited} -Werror -Wconversion' GCC_PREPROCESSOR_DEFINITIONS='${inherited} MTR_NO_AVAILABILITY=1'
89
- working-directory : src/darwin/Framework
90
- - name : Clean Build
91
- run : xcodebuild clean
59
+ run : |
60
+ # Framework builds are NOT expected to require zap-cli
61
+ scripts/run_in_build_env.sh 'D=$(dirname $(which zap-cli)) && mv $D/zap-cli $D/zap-cli.moved'
62
+ # run_in_build_env.sh is used to ensure PATH is set to something that would otherwise find zap-cli
63
+ scripts/run_in_build_env.sh '(zap-cli --version && exit 1) || exit 0'
64
+ - name : Build
92
65
working-directory : src/darwin/Framework
93
- - name : Make zap-cli work again
94
- run : scripts/run_in_build_env.sh 'D=$(dirname $(which zap-cli.moved)) && mv $D/zap-cli.moved $D/zap-cli'
95
- - name : Validate zap-cli is again available
96
- run : scripts/run_in_build_env.sh 'zap-cli --version'
66
+ run : xcodebuild -target "Matter" ${{ matrix.options.arguments }}
67
+
68
+ tests :
69
+ name : Run framework tests
70
+ if : github.actor != 'restyled-io[bot]'
71
+ runs-on : macos-latest
72
+ strategy :
73
+ matrix :
74
+ options : # We don't need a full matrix
75
+ - flavor : asan
76
+ arguments : -enableAddressSanitizer YES -enableUndefinedBehaviorSanitizer YES
77
+ - flavor : asan-global-storage
78
+ arguments : -enableAddressSanitizer YES -enableUndefinedBehaviorSanitizer YES
79
+ defines : MTR_PER_CONTROLLER_STORAGE_ENABLED=0
80
+ - flavor : tsan
81
+ arguments : -enableThreadSanitizer YES
82
+ steps :
83
+ - name : Checkout
84
+ uses : actions/checkout@v4
85
+ - name : Setup Environment
86
+ run : brew install python@3.9
87
+ - name : Checkout submodules & Bootstrap
88
+ uses : ./.github/actions/checkout-submodules-and-bootstrap
89
+ with :
90
+ platform : darwin
91
+ bootstrap-log-name : bootstrap-logs-framework-${{ matrix.options.flavor }}
97
92
- name : Build example All Clusters Server
98
93
run : |
99
94
scripts/examples/gn_build_example.sh examples/all-clusters-app/linux out/debug chip_config_network_layer_ble=false
@@ -103,40 +98,57 @@ jobs:
103
98
- name : Build example OTA Requestor
104
99
run : |
105
100
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
106
- - name : Delete Defaults
107
- run : defaults delete com.apple.dt.xctest.tool
108
- continue-on-error : true
109
101
- name : Run Framework Tests
110
102
# For now disable unguarded-availability-new warnings because we
111
103
# internally use APIs that we are annotating as only available on
112
104
# new enough versions. Maybe we should change out deployment
113
105
# target versions instead?
106
+ working-directory : src/darwin/Framework
114
107
run : |
115
108
mkdir -p /tmp/darwin/framework-tests
116
- ../../../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) &
109
+ echo "This is a simple log" > /tmp/darwin/framework-tests/end_user_support_log.txt
110
+ ../../../out/debug/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) &
117
111
../../../out/debug/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) &
118
- # Disable BLE (CHIP_IS_BLE=NO) because the app does not have the permission to use it and that may crash the CI.
119
112
120
- TEST_RUNNER_ASAN_OPTIONS=__CURRENT_VALUE__:detect_stack_use_after_return=1 xcodebuild test -target "Matter" -scheme "Matter Framework Tests" -sdk macosx -enableAddressSanitizer YES -enableUndefinedBehaviorSanitizer YES OTHER_CFLAGS='${inherited} -Werror -Wconversion' CHIP_IS_BLE=NO GCC_PREPROCESSOR_DEFINITIONS='${inherited} MTR_NO_AVAILABILITY=1'> >(tee /tmp/darwin/framework-tests/darwin-tests-asan.log) 2> >(tee /tmp/darwin/framework-tests/darwin-tests-asan-err.log >&2)
121
- # And the same thing, but with MTR_PER_CONTROLLER_STORAGE_ENABLED turned off, so we test that it does not break for now.
122
- TEST_RUNNER_ASAN_OPTIONS=__CURRENT_VALUE__:detect_stack_use_after_return=1 xcodebuild test -target "Matter" -scheme "Matter Framework Tests" -sdk macosx -enableAddressSanitizer YES -enableUndefinedBehaviorSanitizer YES OTHER_CFLAGS='${inherited} -Werror -Wconversion' CHIP_IS_BLE=NO GCC_PREPROCESSOR_DEFINITIONS='${inherited} MTR_NO_AVAILABILITY=1 MTR_PER_CONTROLLER_STORAGE_ENABLED=0' > >(tee /tmp/darwin/framework-tests/darwin-tests-asan-controller-storage.log) 2> >(tee /tmp/darwin/framework-tests/darwin-tests-asan-controller-storage-err.log >&2)
123
- # And the same thing, but with MTR_NO_AVAILABILITY not turned on. This requires -Wno-unguarded-availability-new to avoid availability errors.
124
- TEST_RUNNER_ASAN_OPTIONS=__CURRENT_VALUE__:detect_stack_use_after_return=1 xcodebuild test -target "Matter" -scheme "Matter Framework Tests" -sdk macosx -enableAddressSanitizer YES -enableUndefinedBehaviorSanitizer YES OTHER_CFLAGS='${inherited} -Werror -Wconversion -Wno-unguarded-availability-new' CHIP_IS_BLE=NO GCC_PREPROCESSOR_DEFINITIONS='${inherited}' > >(tee /tmp/darwin/framework-tests/darwin-tests-asan-with-availability-annotations.log) 2> >(tee /tmp/darwin/framework-tests/darwin-tests-asan-with-availability-annotations-err.log >&2)
113
+ export TEST_RUNNER_ASAN_OPTIONS=__CURRENT_VALUE__:detect_stack_use_after_return=1
125
114
126
- xcodebuild test -target "Matter" -scheme "Matter Framework Tests" -sdk macosx -enableThreadSanitizer YES OTHER_CFLAGS='${inherited} -Werror -Wconversion' CHIP_IS_BLE=NO GCC_PREPROCESSOR_DEFINITIONS='${inherited} MTR_NO_AVAILABILITY=1' > >(tee /tmp/darwin/framework-tests/darwin-tests-tsan.log) 2> >(tee /tmp/darwin/framework-tests/darwin-tests-tsan-err.log >&2)
127
- working-directory : src/darwin/Framework
128
- - name : Build Matter TV Casting Bridge
129
- run : |
130
- xcodebuild -target "MatterTvCastingBridge" -sdk iphoneos
131
- working-directory : examples/tv-casting-app/darwin/MatterTvCastingBridge
115
+ # Disable BLE (CHIP_IS_BLE=NO) because the app does not have the permission to use it and that may crash the CI.
116
+ xcodebuild test -target "Matter" -scheme "Matter Framework Tests" -sdk macosx ${{ matrix.options.arguments }} \
117
+ OTHER_CFLAGS='${inherited} -Werror -Wconversion' CHIP_IS_BLE=NO GCC_PREPROCESSOR_DEFINITIONS='${inherited} MTR_NO_AVAILABILITY=1 ${{ matrix.options.defines }}' \
118
+ > >(tee /tmp/darwin/framework-tests/darwin-tests.log) 2> >(tee /tmp/darwin/framework-tests/darwin-tests-err.log >&2)
132
119
- name : Collect crash logs
133
120
run : |
134
121
mkdir -p /tmp/darwin/framework-tests
135
122
find ~/Library/Developer/Xcode/DerivedData /Library/Logs/DiagnosticReports -name '*.ips' -print0 | xargs -0 -J % cp % /tmp/darwin/framework-tests
136
123
- name : Uploading log files
137
124
uses : actions/upload-artifact@v4
138
- if : ${{ failure() && !env.ACT }}
125
+ if : failure() && !env.ACT
139
126
with :
140
- name : darwin-framework-test-logs
127
+ name : darwin-framework-test-logs-${{ matrix.options.flavor }}
141
128
path : /tmp/darwin/framework-tests
142
129
retention-days : 5
130
+
131
+ tv-casting-bridge :
132
+ name : Build TV Casting Bridge example
133
+ if : github.actor != 'restyled-io[bot]'
134
+ runs-on : macos-latest
135
+ steps :
136
+ - name : Checkout
137
+ uses : actions/checkout@v4
138
+ - name : Setup Environment
139
+ run : brew install python@3.9
140
+ - name : Checkout submodules & Bootstrap
141
+ uses : ./.github/actions/checkout-submodules-and-bootstrap
142
+ with :
143
+ platform : darwin
144
+ - name : Build
145
+ working-directory : examples/tv-casting-app/darwin/MatterTvCastingBridge
146
+ run : xcodebuild -target "MatterTvCastingBridge" -sdk iphoneos
147
+
148
+ darwin :
149
+ name : Build Darwin # Matches the previous monolithic build that's marked "required" for PRs
150
+ needs : [ framework, tests ]
151
+ runs-on : macos-latest
152
+ steps :
153
+ - name : Done
154
+ run : ' true' # nothing to do
0 commit comments