From 0c075f9e823d0f71e5551a2131cd8e3bbd9e35f2 Mon Sep 17 00:00:00 2001 From: Michael Rupp <95718139+mykrupp@users.noreply.github.com> Date: Tue, 8 Oct 2024 15:40:49 -0400 Subject: [PATCH] Revert "delete CSA actions" This reverts commit 2f27c4a29883d29e788cfa694d7d2d948aa3e6de. --- .github/.wordlist.txt | 1628 +++++++++++++++++ .github/CODEOWNERS | 2 + .github/ISSUE_TEMPLATE/001-bug-report.yaml | 80 + .github/ISSUE_TEMPLATE/002-1.0-issue.yaml | 98 + .github/ISSUE_TEMPLATE/003-1.1-issue.yaml | 98 + .github/ISSUE_TEMPLATE/004-1.2-issue.yaml | 98 + .github/ISSUE_TEMPLATE/005-1.3-issue.yaml | 98 + .github/ISSUE_TEMPLATE/049-trivial-fix.yaml | 93 + .github/ISSUE_TEMPLATE/050-tooling-fix.yaml | 88 + .github/ISSUE_TEMPLATE/060-platform-fix.yaml | 88 + .../ISSUE_TEMPLATE/080-feature-request.yaml | 62 + .github/ISSUE_TEMPLATE/090-sve-issue.yaml | 119 ++ .github/ISSUE_TEMPLATE/091-cert-blocker.yaml | 108 ++ .../ISSUE_TEMPLATE/097-ci-test-failure.yaml | 59 + .github/ISSUE_TEMPLATE/098-build-issue.yaml | 59 + .../099-github-workflow-issue.yaml | 59 + .../100-documentation-issue.yaml | 58 + .github/ISSUE_TEMPLATE/config.yaml | 1 + .github/PULL_REQUEST_TEMPLATE.md | 12 + .github/actions/bootstrap-cache/action.yaml | 17 + .github/actions/bootstrap/action.yaml | 82 + .../action.yaml | 43 + .../actions/checkout-submodules/action.yaml | 19 + .github/actions/dump-disk-info/action.yaml | 20 + .github/actions/dynamic/action.yaml | 38 + .../actions/git-safe-directory/action.yaml | 9 + .../actions/maximize-runner-disk/action.yaml | 48 + .../perform-codeql-analysis/action.yaml | 34 + .../actions/setup-size-reports/action.yaml | 15 + .../actions/upload-size-reports/action.yaml | 17 + .github/boring-cyborg.yml | 132 ++ .github/config.yml | 8 + .github/dependabot.yml | 61 + .github/issue-labeler.yml | 54 + .github/labeler.yml | 333 ++++ .github/release.yml | 76 + .github/workflows/artifacts.yaml | 17 + .github/workflows/bloat_check.yaml | 53 + .github/workflows/build-cert-bins.yaml | 21 + .github/workflows/build.yaml | 476 +++++ .github/workflows/buildjet-cache-delete.yaml | 17 + .github/workflows/cert_test_checks.yaml | 35 + .../check-data-model-directory-updates.yaml | 31 + .github/workflows/chef.yaml | 117 ++ .github/workflows/cherry-picks.yaml | 37 + .github/workflows/cirque.yaml | 136 ++ .github/workflows/codeql.yml | 29 + .github/workflows/darwin-tests.yaml | 161 ++ .github/workflows/darwin.yaml | 134 ++ .github/workflows/docbuild.yaml | 54 + .github/workflows/docker_img.yaml | 171 ++ .github/workflows/doxygen.yaml | 107 ++ .../workflows/example-tv-casting-darwin.yaml | 49 + .github/workflows/examples-ameba.yaml | 60 + .github/workflows/examples-asr.yaml | 65 + .github/workflows/examples-bouffalolab.yaml | 147 ++ .github/workflows/examples-cc13xx_26xx.yaml | 114 ++ .github/workflows/examples-cc32xx.yaml | 87 + .github/workflows/examples-efr32.yaml | 148 ++ .github/workflows/examples-esp32.yaml | 169 ++ .github/workflows/examples-infineon.yaml | 226 +++ .github/workflows/examples-linux-arm.yaml | 90 + .github/workflows/examples-linux-imx.yaml | 96 + .../workflows/examples-linux-standalone.yaml | 225 +++ .../examples-linux-tv-casting-app.yaml | 89 + .github/workflows/examples-mw320.yaml | 71 + .github/workflows/examples-nrfconnect.yaml | 211 +++ .github/workflows/examples-nuttx.yaml | 55 + .github/workflows/examples-nxp.yaml | 287 +++ .github/workflows/examples-openiotsdk.yaml | 220 +++ .github/workflows/examples-qpg.yaml | 89 + .github/workflows/examples-stm32.yaml | 79 + .github/workflows/examples-telink.yaml | 280 +++ .github/workflows/examples-tizen.yaml | 86 + .github/workflows/full-android.yaml | 117 ++ .github/workflows/fuzzing-build.yaml | 101 + .../workflows/gradle-wrapper-validation.yml | 20 + .github/workflows/issue-labeler.yaml | 20 + .github/workflows/java-tests.yaml | 308 ++++ .github/workflows/kotlin-style.yaml | 70 + .github/workflows/labeler.yaml | 15 + .github/workflows/lint.yml | 347 ++++ .github/workflows/minimal-build.yaml | 71 + .github/workflows/protocol_compatibility.yaml | 49 + .github/workflows/qemu.yaml | 99 + .github/workflows/recent_fail_summary.yaml | 58 + .github/workflows/release_artifacts.yaml | 89 + .github/workflows/roll_and_build_docker.yaml | 15 + .github/workflows/silabs_workflow.yaml | 40 - .github/workflows/smoketest-android.yaml | 82 + .github/workflows/spell.yml | 36 + .github/workflows/stale.yaml | 42 + .github/workflows/tag-releases.yaml | 52 + .github/workflows/tests.yaml | 627 +++++++ .github/workflows/third-party-check.yaml | 39 + .github/workflows/todos.yaml | 38 + .github/workflows/unit_integration_test.yaml | 88 + .github/workflows/zap_regeneration.yaml | 54 + .github/workflows/zap_templates.yaml | 75 + 99 files changed, 10965 insertions(+), 40 deletions(-) create mode 100644 .github/.wordlist.txt create mode 100644 .github/CODEOWNERS create mode 100644 .github/ISSUE_TEMPLATE/001-bug-report.yaml create mode 100644 .github/ISSUE_TEMPLATE/002-1.0-issue.yaml create mode 100644 .github/ISSUE_TEMPLATE/003-1.1-issue.yaml create mode 100644 .github/ISSUE_TEMPLATE/004-1.2-issue.yaml create mode 100644 .github/ISSUE_TEMPLATE/005-1.3-issue.yaml create mode 100644 .github/ISSUE_TEMPLATE/049-trivial-fix.yaml create mode 100644 .github/ISSUE_TEMPLATE/050-tooling-fix.yaml create mode 100644 .github/ISSUE_TEMPLATE/060-platform-fix.yaml create mode 100644 .github/ISSUE_TEMPLATE/080-feature-request.yaml create mode 100644 .github/ISSUE_TEMPLATE/090-sve-issue.yaml create mode 100644 .github/ISSUE_TEMPLATE/091-cert-blocker.yaml create mode 100644 .github/ISSUE_TEMPLATE/097-ci-test-failure.yaml create mode 100644 .github/ISSUE_TEMPLATE/098-build-issue.yaml create mode 100644 .github/ISSUE_TEMPLATE/099-github-workflow-issue.yaml create mode 100644 .github/ISSUE_TEMPLATE/100-documentation-issue.yaml create mode 100644 .github/ISSUE_TEMPLATE/config.yaml create mode 100644 .github/PULL_REQUEST_TEMPLATE.md create mode 100644 .github/actions/bootstrap-cache/action.yaml create mode 100644 .github/actions/bootstrap/action.yaml create mode 100644 .github/actions/checkout-submodules-and-bootstrap/action.yaml create mode 100644 .github/actions/checkout-submodules/action.yaml create mode 100644 .github/actions/dump-disk-info/action.yaml create mode 100644 .github/actions/dynamic/action.yaml create mode 100644 .github/actions/git-safe-directory/action.yaml create mode 100644 .github/actions/maximize-runner-disk/action.yaml create mode 100644 .github/actions/perform-codeql-analysis/action.yaml create mode 100644 .github/actions/setup-size-reports/action.yaml create mode 100644 .github/actions/upload-size-reports/action.yaml create mode 100644 .github/boring-cyborg.yml create mode 100644 .github/config.yml create mode 100644 .github/dependabot.yml create mode 100644 .github/issue-labeler.yml create mode 100644 .github/labeler.yml create mode 100644 .github/release.yml create mode 100644 .github/workflows/artifacts.yaml create mode 100644 .github/workflows/bloat_check.yaml create mode 100644 .github/workflows/build-cert-bins.yaml create mode 100644 .github/workflows/build.yaml create mode 100644 .github/workflows/buildjet-cache-delete.yaml create mode 100644 .github/workflows/cert_test_checks.yaml create mode 100644 .github/workflows/check-data-model-directory-updates.yaml create mode 100644 .github/workflows/chef.yaml create mode 100644 .github/workflows/cherry-picks.yaml create mode 100644 .github/workflows/cirque.yaml create mode 100644 .github/workflows/codeql.yml create mode 100644 .github/workflows/darwin-tests.yaml create mode 100644 .github/workflows/darwin.yaml create mode 100644 .github/workflows/docbuild.yaml create mode 100644 .github/workflows/docker_img.yaml create mode 100644 .github/workflows/doxygen.yaml create mode 100644 .github/workflows/example-tv-casting-darwin.yaml create mode 100644 .github/workflows/examples-ameba.yaml create mode 100644 .github/workflows/examples-asr.yaml create mode 100644 .github/workflows/examples-bouffalolab.yaml create mode 100644 .github/workflows/examples-cc13xx_26xx.yaml create mode 100644 .github/workflows/examples-cc32xx.yaml create mode 100644 .github/workflows/examples-efr32.yaml create mode 100644 .github/workflows/examples-esp32.yaml create mode 100644 .github/workflows/examples-infineon.yaml create mode 100644 .github/workflows/examples-linux-arm.yaml create mode 100644 .github/workflows/examples-linux-imx.yaml create mode 100644 .github/workflows/examples-linux-standalone.yaml create mode 100644 .github/workflows/examples-linux-tv-casting-app.yaml create mode 100644 .github/workflows/examples-mw320.yaml create mode 100644 .github/workflows/examples-nrfconnect.yaml create mode 100644 .github/workflows/examples-nuttx.yaml create mode 100644 .github/workflows/examples-nxp.yaml create mode 100644 .github/workflows/examples-openiotsdk.yaml create mode 100644 .github/workflows/examples-qpg.yaml create mode 100644 .github/workflows/examples-stm32.yaml create mode 100644 .github/workflows/examples-telink.yaml create mode 100644 .github/workflows/examples-tizen.yaml create mode 100644 .github/workflows/full-android.yaml create mode 100644 .github/workflows/fuzzing-build.yaml create mode 100644 .github/workflows/gradle-wrapper-validation.yml create mode 100644 .github/workflows/issue-labeler.yaml create mode 100644 .github/workflows/java-tests.yaml create mode 100644 .github/workflows/kotlin-style.yaml create mode 100644 .github/workflows/labeler.yaml create mode 100644 .github/workflows/lint.yml create mode 100644 .github/workflows/minimal-build.yaml create mode 100644 .github/workflows/protocol_compatibility.yaml create mode 100644 .github/workflows/qemu.yaml create mode 100644 .github/workflows/recent_fail_summary.yaml create mode 100644 .github/workflows/release_artifacts.yaml create mode 100644 .github/workflows/roll_and_build_docker.yaml delete mode 100644 .github/workflows/silabs_workflow.yaml create mode 100644 .github/workflows/smoketest-android.yaml create mode 100644 .github/workflows/spell.yml create mode 100644 .github/workflows/stale.yaml create mode 100644 .github/workflows/tag-releases.yaml create mode 100644 .github/workflows/tests.yaml create mode 100644 .github/workflows/third-party-check.yaml create mode 100644 .github/workflows/todos.yaml create mode 100644 .github/workflows/unit_integration_test.yaml create mode 100644 .github/workflows/zap_regeneration.yaml create mode 100644 .github/workflows/zap_templates.yaml diff --git a/.github/.wordlist.txt b/.github/.wordlist.txt new file mode 100644 index 0000000000..f317901e45 --- /dev/null +++ b/.github/.wordlist.txt @@ -0,0 +1,1628 @@ +14 +15 +16 +17 +18 +19 +20 +21 +22 +AAAA +aarch +abcdef +abfb +ABI +ABIs +ables +accesscontrol +accessor +Accessors +acdbc +ack +ACKed +ACL +ACLs +actdiag +adb +AddNOC +addr +adk +adoc +adr +AdvAutonomous +AdvManagedFlag +AdvOnLink +AdvRouterAddr +AdvSendAdvert +AE +aef +AES +AFL +AIDL +algs +alloc +Ameba +amebad +amebaiot +AmebaZ +amebaz2 +announcementReason +AnnounceOTAProvider +AnnounceOTAProviderRequest +APIs +apk +AppImpl +AppleTV +appliable +applianceeventsandalert +ApplianceIdentification +appliancestatistics +ApplicationId +ApplicationIdentifier +ApplicationLauncher +ApplyUpdate +applyUpdateAction +ApplyUpdateRequest +ApplyUpdateResponse +approver +appspot +appwrite +aps +arg +argc +args +argv +armeabi +armino +ARMmbed +armv +ASAN +asdk +ASR +AssertionError +AST +ASYNC +ATLs +atomics +att +attId +attr +attrib +AttributeAccessInterface +attributeValue +attrListName +attrMask +attSizeBytes +attType +ATW +ATWC +AudioOutput +auth +AuthMode +autoApplyImage +autocompletion +AutoConf +autoconnect +autocrlf +autogenerated +automake +autotools +avahi +avL +AwaitNextAction +AXXXF +AYNJV +babaf +backend +backends +backticks +backtrace +BallastConfiguration +BarrierControl +BasicCHIPRegression +BasicInformation +baudrate +BCM +BD +BDX +BDXDownloader +BeagleBone +befc +BEKEN +betaprogram +BinaryInputBasic +Binfmt +bitbake +bld +BLE +BleApplicationDelegate +BleLayer +BLEManager +BLEManagerImpl +BlePlatformDelegate +Blinls +bloaty +blockdiag +blocklist +blockquote +bluetoothd +bluez +BOOL +booleans +BooleanState +bootable +Bootloader +BorderRouterAP +bouffalolab +BRD +breakpoint +bredr +BridgedDeviceBasicInformation +bringup +BroadcastReceiver +BromateConcentrationMeasurement +BromodichloromethaneConcentrationMeasurement +BromoformConcentrationMeasurement +bt +btmgmt +BTN +BTP +btvirt +BuildKit +buildwithmatter +buildX +burndown +ButtonIsr +BytesMain +bz +bzip +CACACACA +cacerts +CAfile +cancelled +capacitive +CarbonDioxideConcentrationMeasurement +CarbonMonoxideConcentrationMeasurement +CaseAdminNode +CatalogVendorId +CBB +cbd +CBOR +Ccache +ccf +CCMP +CCS +CCSTUDIO +CCXML +CDEEDC +CDVersionNumber +ced +cfg +CFLAGS +cgit +cgroup +changeset +Channel +characterised +CharString +checkmark +ChipBLEMgr +CHIPCirqueTest +CHIPConfig +CHIPCryptoPALHsm +CHIPDeviceController +ChipDeviceCtrl +CHIPDeviceEvent +CHIPDevicePlatformConfig +CHIPDevicePlatformEvent +ChipEchoRequester +ChipEchoResponder +ChipImInitiator +ChipImResponder +ChipLight +ChipMessageLayer +CHIPOBLE +CHIPProjectAppConfig +CHIPProjectConfig +CHIPTest +chiptests +CHIPTool +ChloraminesConcentrationMeasurement +ChlorineConcentrationMeasurement +ChlorodibromomethaneConcentrationMeasurement +ChloroformConcentrationMeasurement +chmod +chown +chrpath +CIPD +CircleCI +cJTAG +CKIT +CLA +clapre +CLI +CLIs +cloudbuild +CLRF +clusterAttrs +ClusterName +ClusterObjectTests +ClusterRevision +ClusterTestGeneration +cmake +CMakeLists +CMD +CMS +CMSIS +CMVH +cn +COAP +codeaurora +codebase +codegen +CodeGenerator +CodeLab +codelabs +ColorControl +Comcast +Commandline +CommandHandlerInterface +CommandName +Commissionable +CommissionableDataProvider +commissionables +commissionee +CommissioningFlow +commondatastorage +CONF +CONFIG +ConfigDescription +configs +configTOTAL +ConfigurationManager +ConfigurationManagerImpl +conformant +connectedhomeip +ConnectionData +ConnectIP +ConnectivityManager +ConnectivityManagerImpl +ConnectNetwork +ConnectNetworkRequest +ConnectNetworkResponse +connstring +conntype +const +ContentApp +ContentApp's +ContentAppPlatform +ContentLaunch +ContentLauncher +contrib +controllee +conv +CopperConcentrationMeasurement +Corstone +cortexa +cp +cpio +cpp +cppreference +CPROTO +cpuapp +cpython +CQM +crypto +cryptographic +CSA +csg +csrrequest +csu +csv +ctl +ctrl +ctypes +CurrentHue +CurrentLevel +CurrentSaturation +customAcl +customizations +cvfJ +cxx +CY +CYW +DAC +DACs +dadbdcdddedf +DAP +DAPLINK +DataFrame +datamodel +DataModelRevision +dataset +datasets +datastore +DataVersion +dbf +DBG +dBm +DBUILD +dbus +dcc +DCHIP +DCL +DCMAKE +DCONF +DCONFIG +debianutils +debugText +decrypt +decrypted +DEDEDEDE +deepnote +DefaultOTAProviders +DefaultOTARequestor +DefaultOTARequestorDriver +DefaultOTARequestorStorage +DefaultSuccess +definedValue +DehumidificationControl +DelayedActionTime +delayedApplyActionTimeSec +delayedQueryActionTimeSec +delayQuery +deliverables +demangle +deployable +depottools +deps +der +desc +descheduled +detokenization +detokenizer +dev +devcontainer +devCtrl +DevelopmentCerts +DeviceAttestationCredentialsProvider +DeviceAttestationCredsExample +DeviceCaCerts +DeviceCert +DeviceCommissioner +DeviceCommon +DeviceController +DeviceId +DeviceInstanceInfoProvider +DeviceLayer +DeviceNetworkProvisioningDelegate +DeviceNetworkProvisioningDelegateImpl +DevicePairingDelegate +DeviceTemperatureConfiguration +DevKitC +DevKitM +devtype +df +dfe +DFILE +dfu +DgDxsfHx +dhclient +DHCP +DHCPC +DHCPv +dhrishi +DiagnosticLogs +dialout +diffstat +diffsyms +dimmable +dirname +dirs +disableNotifyUpdateApplied +disambiguated +discoverable +DispatchEvent +DispatchEventToApplication +DissolvedOxygenConcentrationMeasurement +DISTRO +Distutils +DK +DL +DM +DMG +DMM +DNS +Dnsmasq +dnsmasqd +DNSSD +DNSStubListener +docbuild +Dockerfile +Dockerfiles +Don'ts +DoorLock +DoorState +doru +DOTBR +DOVERLAY +downcasting +DownloadProtocolEnum +Doxygen +dpkg +dropdown +dryrun +DS +duplicative +DUT +DUTS +DUT's +DV +DVK +dynload +eabi +EB +ECC +ECD +ECDH +ECDSA +EchoMessage +EchoRequests +EchoResponse +EchoService +ECW +edaf +edc +EDR +ee +eea +EEE +eef +ef +EFR +efuse +eg +EjQ +elftools +elock +emberAf +emberAfExternalAttributeReadCallback +emberAfExternalAttributeWriteCallback +EmberAfInitializeAttributes +emberAfSetDynamicEndpoint +emsp +EnableNetwork +EnableWiFiNetwork +endian +EndpointId +eno +entrypoint +enum +Enums +env +epochKey +epochStartTime +eq +errorValue +esd +espcoredump +ESPPORT +Espressif +esptool +eth +EthernetNetworkDiagnostics +ethernets +EthyleneConcentrationMeasurement +EthyleneOxideConcentrationMeasurement +EvalCode +EvalCodeWithName +EvalFrameDefault +EV +EVB +EventLogging +evk +EVSE +exceptfds +ExchangeContext +exe +ExecStart +executables +ExtendedPAN +ExtensionEntry +extern +extpanid +FabricId +fabricIdx +fabricIndex +factoryreset +FanControl +fb +fbb +fbd +FC +FCJ +FDDE +fddead +fde +fdx +FECA +FecalColiformAndEColiConcentrationMeasurement +feff +ffaa +ffeebaefa +FFF +fffe +fffff +Fi +filepath +fini +FixedLabel +flashdebug +FlowMeasurement +FluorideConcentrationMeasurement +focusable +forkpty +FOTA +FreeRTOS +FreeRTOSConfig +FS +fsl +fstab +fsync +ftd +fullclean +fuzzer +fuzzers +fuzztest +FW +gbl +gcloud +GDB +gdbgui +gdbserver +GeneralCommissioning +GeneralDiagnostics +generalised +GenericConfigurationManagerImpl +GenericConnectivityManagerImpl +GenericImpl +GenericPlatformManagerImpl +GenericThreadConfigurationManagerImpl +GenericThreadStackManagerImpl +GenericWiFiConfigurationManagerImpl +GetDeviceId +GetDeviceInfo +GetDns +getter +getters +GetInDevelopmentTests +GetIP +getManualTests +GetSafeAttributePersistenceProvider +getstarted +GH +ghcr +ghp +githubusercontent +gitignore +glibc +gn +GND +gni +GNinja +GNUARMEMB +gnueabihf +googleapis +googlesource +GPG +GPIO +GPL +GPLv +Gradle +gradlew +graphviz +Groupcast +GroupId +GroupKeyManagement +groupsettings +gsdk +gtk +GUA +Gv +gz +gzbf +HaloaceticAcidsConcentrationMeasurement +HandleCommand +hardcoded +hardknott +hardwarever +HardwareVersion +HardwareVersionString +hasValue +hci +hciattach +hciconfig +hdlc +HEPA +HKDF +HMAC +hoc +homebrew +HomePod +HomePods +hostapd +hostname +href +HSM +hsm +HTTPS +Humidistat +HW +hwadr +HydrogenConcentrationMeasurement +HydrogenSulphideConcentrationMeasurement +IasAce +IasWd +iaszone +ibb +ICA +ICAC +ICD +ICDs +iCloud +ICMP +IDF +IDL +IDLs +idt +idx +ifconfig +ifdef +ifdefs +IGMP +ihex +Illuminance +IlluminanceMeasurement +IM +imager +imagetool +imageUri +img +Impl +ImplClass +implementers +imx +imxlinux +incomingCommands +indexhtml +Inet +InetLayer +Infineon +ini +init +InitArgs +inlined +InputLoop +installDebug +instantiation +integrations +IntelliSense +InteractionModelEngine +InteractionModelVersion +Interoperable +introvideos +InvokeCommandRequests +InvokeCommandResponse +IoT +ipaddr +iPadOS +ipadr +IPK +ipp +iptables +iputils +IPv +ipykernel +ipynb +IPython +ISCAN +isHexString +isLowerCase +isUpperCase +itemName +iterable +itsfoss +JDK +jinja +JLink +JLinkExe +JLinkRTTClient +JN +jni +jpg +jre +js +json +JTAG +Jupyter +jupyterlab +KA +kAdminister +kbd +kBusy +kCase +Kconfig +kDacPublicKey +KeypadInput +keypair +keyset +kGroup +kInvalidCommandId +KitProg +kManage +kNewButton +kNodeIdNotSpecified +knownissues +kOperate +kPAKEParameterError +kPase +kView +KVS +kWindowNotOpen +LabelList +LabelStruct +launchable +LAUNCHXL +ldflags +LeadConcentrationMeasurement +LEDs +LevelControl +LF +libavahi +libc +libcairo +libCHIP +libdbus +LIBDIR +libegl +libffi +libfuzzer +libgirepository +libglib +libical +libncurses +libreadline +libsdl +libshell +libssl +libstdc +libthread +libtool +libTransportLayer +libudev +libwebkitgtk +lifecycle +lightbulb +lightin +LightingApp +LightingColor +LightingState +LinkSoftwareAndDocumentationPack +lladdr +LocalConfigDisabled +localedef +localhost +LocalizationConfiguration +localstatedir +LockingState +LogEvent +loopback +LowPower +LPC +LSP +LTE +LTS +LwIP +LwIP's +LZMA +macaddr +machineType +MacOS +MacOSX +MacPorts +Makefile +makefiles +MakeTpCall +mandir +ManganeseConcentrationMeasurement +ManualPairingCode +ManualTest +ManufacturingDate +masterkey +matterBuildSrcDir +matterc +MatterCustomTrace +matterd +MatterLock +MatterReportingAttributeChangeCallback +matterSdkSourceBuild +matterSourceBuildAbiFilters +matterUTestLib +maxApplicableSoftwareVersion +MaxInterval +MaxIntervalCeilingSeconds +maxLength +MaxRtrAdvInterval +maxValue +mbed +MbedCommissioning +MbedNewTarget +mbedos +mbedTarget +mbedTLS +MCORE +mcu +MCUboot +mcumgr +MCUs +mcux +MCUXpresso +mdash +MDNS +MediaInput +MediaPlayback +MediaTek +MEI +mem +memdf +MemMonitoring +menuconfig +MeshCoP +MeterIdentification +MfgDeviceCaCerts +MfgSpecificPing +mfrcacerts +mfrcert +MfrDeviceCert +MfrDeviceId +mgmt +microcontroller +microcontrollers +MicroSD +middleware +minApplicableSoftwareVersion +Minicom +MinInterval +MinIntervalFloorSeconds +minLength +MinRtrAdvInterval +minValue +mkdir +mlan +MLD +mmevk +moal +Mobly +ModeSelect +modprobe +Modustoolbox +moveMode +MoveToHue +MoveToLevel +MoveToSaturation +MoveWithOnOff +MPSL +MRP +MTD +MTR +MTU +Multiband +Multicast +multilib +Multiprotocol +multithreaded +mutex +mutexes +mv +MX +mydir +MyPASSWORD +MySSID +NAMESERVER +NAMESPACE +namespaces +namespacing +nano +natively +navpad +nbsp +NCP +ncs +nding +NDK +netcmp +netif +netplan +NetworkCommissioning +networkID +networkname +NewUDPEndPoint +nfds +NitricOxideConcentrationMeasurement +NitrogenDioxideConcentrationMeasurement +nl +nltest +nmcli +nmtui +noc +NodeId +nongnu +nordicsemi +NotAvailable +NotifyUpdateApplied +notValue +npm +nRF +nrfconnect +nrfdks +nrfutil +nrfxlib +NTAG +NTP +nullable +nullptr +NUM +NuttX +NVM +NVS +nwdiag +nwk +NXP +objcopy +OccupancySensing +OctetString +OECORE +OID +ol +Onboarding +onboardingcodes +oneshot +onnetwork +OnOff +OnOffClusterTest +OnOffSwitchConfiguration +OnPlatformEvent +onwards +OO +openiotsdk +openjdk +OpenOCD +OpenSSL +OpenThread +OpenThreadDemo +openweave +OperationalCredentials +operationalDataset +opkg +OPTIGA +optionMask +optionOverride +optionsMask +optionsOverride +orgs +OSS +OTA +OTADownloader +otaDownloadPath +otaImageList +OTAImageProcessorDriver +OTAImageProcessorImpl +OTAImageProcessorInterface +otaissues +OTAProvider +OTAProviderIpAddress +OTAProviderNodeId +otaproviders +OTAProviderSerialPort +OTARequesterImpl +OTARequestorDriver +OTARequestorInterface +OTARequestorSerialPort +OTARequestorStorage +otasoftwareupdateapp +OtaSoftwareUpdateProvider +otasoftwareupdaterequestor +otatesting +otaURL +OTBR +otcli +outform +outgoingCommands +overridable +OxygenConcentrationMeasurement +OzoneConcentrationMeasurement +PAA +PAAs +PacketBuffer +PAI +PairDevice +PAIs +PAKE +palletsprojects +PANID +pankore +param +params +PartNumber +PASE +Passcode +passRetained +passwd +PBKDF +pbuf +pbufs +pbxproj +PCA +pcap +pcaps +PDFs +PDK +PDM +peerAddrStr +peerNodeId +peerSessionId +pem +percentageLiftValue +perfetto +periodicQueryTimeout +pexpect +pickString +PICSCODE +PID +Pigweed +PinCode +pinrequest +PIXIT +PIXITs +pkgconfig +PKI +plaintext +PlatformManager +PlatformManagerImpl +plt +PluginServerCallback +png +Podman +PollControl +pollInterval +polymorphism +POSIX +PosixConfig +postAttributeChangeCallback +PowerConfiguration +PowerProfile +PowerSource +PowerSourceConfiguration +pre +preprocessor +Presetup +PressureMeasurement +prj +ProductID +ProductLabel +ProductName +ProductURL +proto +protobuf +protos +Prover +providerFabricIndex +ProviderLocation +providerNodeId +ProxyConfiguration +ProxyDiscovery +ProxyValid +ProxyView +PRs +PSA +PSCAN +PSECT +PSK +PSoC +PTR +pts +PulseWidthModulation +PumpConfigurationAndControl +pwd +PWM +PXXXF +py +pychip +pycrypto +pycryptodome +PyEval +PyFunction +pylint +PyObject +pypi +PyRun +pytest +QEMU +Qorvo +QPG +QRCode +qrcodetool +QRCodeUrl +QSPI +QueryImage +QueryImageResponse +queryImageStatus +Quickstart +qvCHIP +RADVD +raspberryPi +RasPi +rAv +RCAC +RCP +ReadAttribute +ReadConfigValue +readelf +readfds +README +READMEs +readonly +readthedocs +Reag +rebase +recommand +recommanded +recurse +regen +registerAttributeAccessOverride +RegisterCommandHandler +RelativeHumidityMeasurement +RemainAfterExit +remoteDeviceId +Rendez +RendezvousInformation +RendezvousParameters +RendezVousTest +REPL +repo +repos +req +Requestor +Requestor's +RequestorCanConsent +Requestors +responder +RestrictedEvent +retargeting +reusability +reviwed +rfid +rfids +RGB +riscv +rloc +rmw +rodata +Rollershade +rootfs +RPC +RPCs +RPi +RPi's +RPis +RSA +rsn +RSSI +RST +rsync +RTC +rtd +RTL +rtld +RTOS +RTT +RTX +runArgs +runIf +RUNAS +RunMain +runtime +RVC +rw +RXD +sandboxed +saveAs +saveDataVersschemaionAs +sbin +scalability +scalable +schema +schemas +scm +sco +scp +ScriptBinding +SDB +SDC +SDHC +SDK +SDK's +sdkconfig +SDKs +SDKTARGETSYSROOT +sdl +SecureCertDACProvider +SED +SEGGER +semver +SendButton +SendNewInputEvent +sendto +seqdiag +SERIALDEVICE +serialno +SerialNumber +ServiceId +SetDns +SetImageProcessorDelegate +SetOTADownloader +SetOtaRequestorDriver +setpin +setpoint +SetpointRaiseLower +SetRequestorInstance +SetUpPINCode +SetupQRCode +sexualized +sfv +SHA +ShadeConfiguration +SHAs +showDocumentation +showsdks +shubhamdp +SIGINT +SiLabs +Silabs's +SiliconLabs +SimpleFileExFlags +SimpleLink +SiWx +sizedb +sl +SLAAC +SLTB +SLWSTK +SmartThings +smoketest +SMP +socat +socio +SoCs +SodiumConcentrationMeasurement +softap +SoftDevice +softmmu +SoftwareDiagnostics +SoftwareVersion +softwareVersionStr +SoftwareVersionString +softwareVersionValid +SparkFun +sphinxcontrib +SPI +spiflash +spinel +src +SRP +SRV +SSBL +SSID +startoffset +StartScan +startsWith +StatusCode +stderr +stdout +sterm +stlink +stm +stmicroelectronics +storagepath +str +strcpy +struct +structs +su +Subclassing +subcommand +subcommands +subdirectories +subdirectory +subfolder +submodule +submodules +subnet +subprocess +SubscribeResponse +SubscriptionId +substeps +subtype +sudo +SulfateConcentrationMeasurement +SulfurDioxideConcentrationMeasurement +suppressResponse +svg +SVR +SWD +SWU +symlinks +sysbuild +sysconfdir +SysConfig +sysctl +sysdeps +SYSROOT +systemctl +systemd +systemdsystemunitdir +systemduserunitdir +systime +sysv +TargetNavigator +TBD +tbody +tcl +TCP +teardown +Telink +TemperatureMeasurement +templating +Tera +testability +TestArray +TestCluster +TestConstraints +TestEmptyString +TestEqualities +TestGenExample +TestGroupDemoConfig +TestMultiRead +TestName +TestOnlySendCommandTimedRequestFlagWithNoTimedInvoke +TESTPASSWD +TestPICS +TESTSSID +TestString +TestStruct +TestThreadStackMgr +TestTimedRequestTimeout +TestUint +TestUpdateValue +testws +texinfo +textboxes +TFT +ThermostatUserInterfaceConfiguration +ThIsIsNoTMyReAlGiThUbToKeNSoDoNoTtRy +thread +ThreadNetworkDiagnostics +threadOperationalDataset +ThreadStackManager +ThreadStackManagerImpl +ths +Thunderboard +timedInteractionTimeoutMs +TimeFormatLocalization +timeframe +timeoutMs +TimeSynchronization +tinycrypt +Tizen +TKIP +TLS +tlsr +TLV +tmp +tngvndl +TODO +toJson +tokenization +tokenized +tokenizer +toolchain +toolchains +topologies +tos +TotalColiformBacteriaConcentrationMeasurement +totalTests +TotalTrihalomethanesConcentrationMeasurement +TPK +trackAlloc +trackFree +TransferSession +transitionTime +TransportMgrBase +TriggerEffect +TRNG +trustm +TrustedRootCertificates +tsan +TSG +tsv +TTL +tty +ttyACM +ttyACMx +ttymxc +ttyUSB +TurbidityConcentrationMeasurement +TvCasting +TVOC +tvOS +TXD +txt +uargument +UART +UDC +udcport +udhcpc +UDP +UDPEndPoint +udpPort +ug +ui +uint +ULA +Ultrafast +UNBLUR +uncommissioned +Unencrypted +unfocus +Unicast +UniFlash +UnitLocalization +unpair +unprovisioned +Unsecure +Unselect +untrusted +updateAvailable +updateNotAvailable +UpdateTokens +upstreamed +ureverse +URI +urlrequest +usbmodem +usbserial +USBtoUART +uscif +UserConsentNeeded +userConsentState +userguide +USERINTERFACE +UserLabel +usermod +usr +UTF +util +utils +UUID +ux +validator +valgrind +vcom +VCP +Vectorcall +VendorID +VendorName +vendorpayload +venv +ver +Verifier +Verifiers +VID +vids +virtualenv +visualstudio +vlatest +VLEDs +vm +vn +vnc +vous +VPN +VSC +VSCode +WaitNewInputEvent +WakeOnLan +WantedBy +watchdogTimeout +watchOS +webpage +wf +wg +wget +whde +whitespace +whitespaces +whl +wic +WiFiNetworkDiagnostics +WindowCovering +WindowCoveringGoToLiftPercentage +WiseMCU +wlan +wmm +WPA +wpan +wra +WriteAttribute +writefds +wrover +WS +WSL +WSTK +xa +xAAAA +xab +xaver +xb +xbef +xc +xcd +Xcode +xcodebuild +xcodeproj +xcworkspace +xd +xds +xdsdfu +xEA +xEB +xEC +xed +xef +xF +xFA +xFB +xFC +xFD +xFE +xFF +xFFF +xFFFF +xfffff +xFFFFFFEFFFFFFFFF +xtensa +xvzf +xwayland +xyz +xz +xzvf +yaml +yearday +yml +YNJV +Yocto +yoctoproject +YourFolder +zapt +zaptool +ZCL +zclconfigure +zclread +zclsubscribe +zclwrite +ZephyrConfig +zephyrproject +zhengyaohan +Zigbee +zigbeealliance +zigbeethread diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 0000000000..b8ab010a1d --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1,2 @@ +# Current reviewers-XXX teams, who review everything for approval. +* @reviewers-amazon @reviewers-apple @reviewers-comcast @reviewers-google @reviewers-lg @reviewers-nordic @reviewers-samsung @reviewers-silabs @reviewers-tcl diff --git a/.github/ISSUE_TEMPLATE/001-bug-report.yaml b/.github/ISSUE_TEMPLATE/001-bug-report.yaml new file mode 100644 index 0000000000..8944e002c5 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/001-bug-report.yaml @@ -0,0 +1,80 @@ +name: "\U0001F41B Bug report" +description: Create a report to help Matter +title: "[BUG] " +labels: [bug, "needs triage"] +body: + - type: markdown + attributes: + value: | + Thanks for reporting an issue against the Matter SDK! We need information about the bug report to follow up, so please help us out by filling out this information. + - type: textarea + id: repro + attributes: + label: Reproduction steps + description: "How do you trigger this bug? Please walk us through it step by step." + placeholder: | + Please list reproduction steps step by step. + Place shell commands between ```. + Attach logs as files instead of pasting them in. + 1. + 2. + 3. + ... + validations: + required: true + - type: input + id: prevalence + attributes: + label: Bug prevalence + description: "How often do you or others encounter this bug?" + placeholder: "Example: Whenever I do this, 1-2 times a week, day, hour, etc" + validations: + required: true + - type: input + attributes: + label: GitHub hash of the SDK that was being used + description: Hash of the GitHub SDK used + validations: + required: true + - type: dropdown + attributes: + label: Platform + description: What platforms are affected? + multiple: true + options: + - ameba + - android + - cc13x2_cc26x2 + - darwin + - efr32 + - esp32 + - freeRTOS + - IMX8 + - k32w + - nrf + - python + - raspi + - vscode + - windows + - other + - core + validations: + required: true + - type: input + id: platform-versions + attributes: + label: Platform Version(s) + description: "What platform version(s) are affected [optional]" + placeholder: "eg: 1.0.1, N/A" + - type: textarea + attributes: + label: Anything else? + description: | + Links? References? Anything that will give us more context about the issue you are encountering! + + Tip: You can attach images or log files by clicking this area to highlight it and then dragging files in. + validations: + required: false + - type: markdown + attributes: + value: "Thanks for submitting a bug!" diff --git a/.github/ISSUE_TEMPLATE/002-1.0-issue.yaml b/.github/ISSUE_TEMPLATE/002-1.0-issue.yaml new file mode 100644 index 0000000000..10551fef60 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/002-1.0-issue.yaml @@ -0,0 +1,98 @@ +name: "\u0030\u20e3 1.0 Issue" +description: Create an issue that is required for Matter 1.0 release +title: "[1.0] " +labels: [bug, "V1.0", "needs triage"] +body: + - type: markdown + attributes: + value: | + Thanks for reporting an issue against the Matter SDK! We need information about the bug report to follow up, so please help us out by filling out this information. + - type: textarea + id: repro + attributes: + label: Reproduction steps + description: "How do you trigger this bug? Please walk us through it step by step." + placeholder: | + Please list reproduction steps step by step. + Place shell commands between ```. + Attach logs as files instead of pasting them in. + 1. + 2. + 3. + ... + validations: + required: true + - type: input + id: prevalence + attributes: + label: Bug prevalence + description: "How often do you or others encounter this bug?" + placeholder: "Example: Whenever I do this, 1-2 times a week, day, hour, etc" + validations: + required: true + - type: input + attributes: + label: GitHub hash of the SDK that was being used + description: Hash of the GitHub SDK used + validations: + required: true + - type: dropdown + attributes: + label: Platform + description: What platforms are affected? + multiple: true + options: + - ameba + - android + - cc13x2_cc26x2 + - darwin + - efr32 + - esp32 + - freeRTOS + - IMX8 + - k32w + - nrf connect + - nrf + - python + - raspi + - vscode + - windows + - other + - core + validations: + required: true + - type: input + id: platform-versions + attributes: + label: Platform Version(s) + description: "What platform version(s) are affected [optional]" + placeholder: "eg: 1.0.1, N/A" + - type: dropdown + attributes: + label: Type + description: What type of issue is this? + multiple: true + options: + - Test Improvement + - Common Cluster Logic + - Spec Compliance Issue + - Security Issue + - Platform Issue + - Core SDK Memory Issue + - Core SDK Crash + - Core SDK Performance Improvement + - Core SDK Interopability Issue + validations: + required: true + - type: textarea + attributes: + label: Anything else? + description: | + Links? References? Anything that will give us more context about the issue you are encountering! + + Tip: You can attach images or log files by clicking this area to highlight it and then dragging files in. + validations: + required: false + - type: markdown + attributes: + value: "Thanks for helping us get to 1.0!" diff --git a/.github/ISSUE_TEMPLATE/003-1.1-issue.yaml b/.github/ISSUE_TEMPLATE/003-1.1-issue.yaml new file mode 100644 index 0000000000..50db3e80a9 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/003-1.1-issue.yaml @@ -0,0 +1,98 @@ +name: "\u0031\u20e3 1.1 Issue" +description: Create an issue that is required for Matter 1.1 release +title: "[1.1] " +labels: [bug, "V1.1", "needs triage"] +body: + - type: markdown + attributes: + value: | + Thanks for reporting an issue against the Matter SDK! We need information about the bug report to follow up, so please help us out by filling out this information. + - type: textarea + id: repro + attributes: + label: Reproduction steps + description: "How do you trigger this bug? Please walk us through it step by step." + placeholder: | + Please list reproduction steps step by step. + Place shell commands between ```. + Attach logs as files instead of pasting them in. + 1. + 2. + 3. + ... + validations: + required: true + - type: input + id: prevalence + attributes: + label: Bug prevalence + description: "How often do you or others encounter this bug?" + placeholder: "Example: Whenever I do this, 1-2 times a week, day, hour, etc" + validations: + required: true + - type: input + attributes: + label: GitHub hash of the SDK that was being used + description: Hash of the GitHub SDK used + validations: + required: true + - type: dropdown + attributes: + label: Platform + description: What platforms are affected? + multiple: true + options: + - ameba + - android + - cc13x2_cc26x2 + - darwin + - efr32 + - esp32 + - freeRTOS + - IMX8 + - k32w + - nrf connect + - nrf + - python + - raspi + - vscode + - windows + - other + - core + validations: + required: true + - type: input + id: platform-versions + attributes: + label: Platform Version(s) + description: "What platform version(s) are affected [optional]" + placeholder: "eg: 1.1, N/A" + - type: dropdown + attributes: + label: Type + description: What type of issue is this? + multiple: true + options: + - Test Improvement + - Common Cluster Logic + - Spec Compliance Issue + - Security Issue + - Platform Issue + - Core SDK Memory Issue + - Core SDK Crash + - Core SDK Performance Improvement + - Core SDK Interopability Issue + validations: + required: true + - type: textarea + attributes: + label: Anything else? + description: | + Links? References? Anything that will give us more context about the issue you are encountering! + + Tip: You can attach images or log files by clicking this area to highlight it and then dragging files in. + validations: + required: false + - type: markdown + attributes: + value: "Thanks for helping us get to 1.1!" diff --git a/.github/ISSUE_TEMPLATE/004-1.2-issue.yaml b/.github/ISSUE_TEMPLATE/004-1.2-issue.yaml new file mode 100644 index 0000000000..81b641a52e --- /dev/null +++ b/.github/ISSUE_TEMPLATE/004-1.2-issue.yaml @@ -0,0 +1,98 @@ +name: "\u0032\u20e3 1.2 Issue" +description: Create an issue that is required for Matter 1.2 release +title: "[1.2] " +labels: [bug, "V1.2", "needs triage"] +body: + - type: markdown + attributes: + value: | + Thanks for reporting an issue against the Matter SDK! We need information about the bug report to follow up, so please help us out by filling out this information. + - type: textarea + id: repro + attributes: + label: Reproduction steps + description: "How do you trigger this bug? Please walk us through it step by step." + placeholder: | + Please list reproduction steps step by step. + Place shell commands between ```. + Attach logs as files instead of pasting them in. + 1. + 2. + 3. + ... + validations: + required: true + - type: input + id: prevalence + attributes: + label: Bug prevalence + description: "How often do you or others encounter this bug?" + placeholder: "Example: Whenever I do this, 1-2 times a week, day, hour, etc" + validations: + required: true + - type: input + attributes: + label: GitHub hash of the SDK that was being used + description: Hash of the GitHub SDK used + validations: + required: true + - type: dropdown + attributes: + label: Platform + description: What platforms are affected? + multiple: true + options: + - ameba + - android + - cc13x2_cc26x2 + - darwin + - efr32 + - esp32 + - freeRTOS + - IMX8 + - k32w + - nrf connect + - nrf + - python + - raspi + - vscode + - windows + - other + - core + validations: + required: true + - type: input + id: platform-versions + attributes: + label: Platform Version(s) + description: "What platform version(s) are affected [optional]" + placeholder: "eg: 1.2, N/A" + - type: dropdown + attributes: + label: Type + description: What type of issue is this? + multiple: true + options: + - Test Improvement + - Common Cluster Logic + - Spec Compliance Issue + - Security Issue + - Platform Issue + - Core SDK Memory Issue + - Core SDK Crash + - Core SDK Performance Improvement + - Core SDK Interopability Issue + validations: + required: true + - type: textarea + attributes: + label: Anything else? + description: | + Links? References? Anything that will give us more context about the issue you are encountering! + + Tip: You can attach images or log files by clicking this area to highlight it and then dragging files in. + validations: + required: false + - type: markdown + attributes: + value: "Thanks for helping us get to 1.2!" diff --git a/.github/ISSUE_TEMPLATE/005-1.3-issue.yaml b/.github/ISSUE_TEMPLATE/005-1.3-issue.yaml new file mode 100644 index 0000000000..5c91f91e75 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/005-1.3-issue.yaml @@ -0,0 +1,98 @@ +name: "\u0033\u20e3 1.3 Issue" +description: Create an issue that is required for Matter 1.3 release +title: "[1.3] " +labels: [bug, "V1.3", "needs triage"] +body: + - type: markdown + attributes: + value: | + Thanks for reporting an issue against the Matter SDK! We need information about the bug report to follow up, so please help us out by filling out this information. + - type: textarea + id: repro + attributes: + label: Reproduction steps + description: "How do you trigger this bug? Please walk us through it step by step." + placeholder: | + Please list reproduction steps step by step. + Place shell commands between ```. + Attach logs as files instead of pasting them in. + 1. + 2. + 3. + ... + validations: + required: true + - type: input + id: prevalence + attributes: + label: Bug prevalence + description: "How often do you or others encounter this bug?" + placeholder: "Example: Whenever I do this, 1-2 times a week, day, hour, etc" + validations: + required: true + - type: input + attributes: + label: GitHub hash of the SDK that was being used + description: Hash of the GitHub SDK used + validations: + required: true + - type: dropdown + attributes: + label: Platform + description: What platforms are affected? + multiple: true + options: + - ameba + - android + - cc13x2_cc26x2 + - darwin + - efr32 + - esp32 + - freeRTOS + - IMX8 + - k32w + - nrf connect + - nrf + - python + - raspi + - vscode + - windows + - other + - core + validations: + required: true + - type: input + id: platform-versions + attributes: + label: Platform Version(s) + description: "What platform version(s) are affected [optional]" + placeholder: "eg: 1.3, N/A" + - type: dropdown + attributes: + label: Type + description: What type of issue is this? + multiple: true + options: + - Test Improvement + - Common Cluster Logic + - Spec Compliance Issue + - Security Issue + - Platform Issue + - Core SDK Memory Issue + - Core SDK Crash + - Core SDK Performance Improvement + - Core SDK Interopability Issue + validations: + required: true + - type: textarea + attributes: + label: Anything else? + description: | + Links? References? Anything that will give us more context about the issue you are encountering! + + Tip: You can attach images or log files by clicking this area to highlight it and then dragging files in. + validations: + required: false + - type: markdown + attributes: + value: "Thanks for helping us get to 1.3!" diff --git a/.github/ISSUE_TEMPLATE/049-trivial-fix.yaml b/.github/ISSUE_TEMPLATE/049-trivial-fix.yaml new file mode 100644 index 0000000000..7c82d950e9 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/049-trivial-fix.yaml @@ -0,0 +1,93 @@ +name: "\U0001F3C3 Trivial Fix" +description: Create an issue for a trivial fix +title: "[Trivial] " +labels: [bug, "needs triage"] +body: + - type: markdown + attributes: + value: | + Thanks for taking the time to submit a trivial fix, can you please please help us understand this change in this quick form? + - type: dropdown + attributes: + label: Type + description: What type of trivial fix is this? + multiple: true + options: + - Comment fix + - Typo fix + - Rename + - Other + validations: + required: true + - type: textarea + id: repro + attributes: + label: Explanation + description: "(Optional) If other, why do you think this is trivial?" + validations: + required: false + - type: dropdown + attributes: + label: Platform + description: What platforms are affected? + multiple: true + options: + - all + - ameba + - android + - cc13x2_cc26x2 + - darwin + - efr32 + - esp32 + - freeRTOS + - IMX8 + - k32w + - nrf connect + - nrf + - python + - raspi + - vscode + - windows + - other + - core (please add to version below) + validations: + required: true + - type: input + id: platform-versions + attributes: + label: Platform Version(s) + description: "What platform version(s) are affected [optional]" + placeholder: "eg: 1.0.1, N/A" + - type: dropdown + attributes: + label: Testing + description: How was this tested? + multiple: true + options: + - Unit tested + - YAML tested + - Manually tested with SDK + - CI tested + - Hardware validated + - Platform validated + validations: + required: true + - type: textarea + attributes: + label: (Optional) If manually tested please explain why this is only manually tested + description: | + Please explain how you tested it + validations: + required: false + - type: textarea + attributes: + label: Anything else? + description: | + Links? References? Anything that will give us more context about this! + + Tip: You can attach images or log files by clicking this area to highlight it and then dragging files in. + validations: + required: false + - type: markdown + attributes: + value: "Thanks for submitting a trivial issue!" diff --git a/.github/ISSUE_TEMPLATE/050-tooling-fix.yaml b/.github/ISSUE_TEMPLATE/050-tooling-fix.yaml new file mode 100644 index 0000000000..0d775a61ef --- /dev/null +++ b/.github/ISSUE_TEMPLATE/050-tooling-fix.yaml @@ -0,0 +1,88 @@ +name: "\U0001F9F0 Tooling Fix/Feature" +description: Create an issue for a tooling specific fix/feature +title: "[Tooling] " +labels: ["tools", "needs triage"] +body: + - type: markdown + attributes: + value: | + Thanks for taking the time to submit a an issue for our tooling, can you please please help us understand this change in this quick form? + - type: textarea + id: repro + attributes: + label: Reproduction steps / Feature + description: "How do you trigger this issue and/or can you please explain this new feature? Please walk us through it step by step." + placeholder: | + Please list reproduction steps step by step. + Place shell commands between ```. + Attach logs as files instead of pasting them in. + 1. + 2. + 3. + ... + validations: + required: true + - type: dropdown + attributes: + label: Platform + description: What platforms are affected? + multiple: true + options: + - ameba + - android + - cc13x2_cc26x2 + - darwin + - efr32 + - esp32 + - freeRTOS + - IMX8 + - k32w + - nrf connect + - nrf + - python + - raspi + - vscode + - windows + - other + - core (please add to version below) + validations: + required: true + - type: input + id: platform-versions + attributes: + label: Platform Version(s) + description: "What platform version(s) are affected [optional]" + placeholder: "eg: 1.0.1, N/A" + - type: dropdown + attributes: + label: Type + description: How was this tested? + multiple: true + options: + - Unit tested + - YAML tested + - Manually tested with SDK + - CI tested + - Hardware validated + - Platform validated + validations: + required: true + - type: textarea + attributes: + label: (Optional) If manually tested please explain why this is only manually tested + description: | + Please explain how you tested it + validations: + required: false + - type: textarea + attributes: + label: Anything else? + description: | + Links? References? Anything that will give us more context about this! + + Tip: You can attach images or log files by clicking this area to highlight it and then dragging files in. + validations: + required: false + - type: markdown + attributes: + value: "Thanks for help our tooling!" diff --git a/.github/ISSUE_TEMPLATE/060-platform-fix.yaml b/.github/ISSUE_TEMPLATE/060-platform-fix.yaml new file mode 100644 index 0000000000..fdb8b76d88 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/060-platform-fix.yaml @@ -0,0 +1,88 @@ +name: "\U0001F3D7 Platform Fix" +description: Create an issue for a platform specific fix +title: "[Platform] " +labels: ["platform", "needs triage"] +body: + - type: markdown + attributes: + value: | + Thanks for taking the time to submit a an issue for a platform, can you please please help us understand this change in this quick form? + - type: textarea + id: repro + attributes: + label: Reproduction steps + description: "How do you trigger this issue? Please walk us through it step by step." + placeholder: | + Please list reproduction steps step by step. + Place shell commands between ```. + Attach logs as files instead of pasting them in. + 1. + 2. + 3. + ... + validations: + required: true + - type: dropdown + attributes: + label: Platform + description: What platforms are affected? + multiple: true + options: + - ameba + - android + - cc13x2_cc26x2 + - darwin + - efr32 + - esp32 + - freeRTOS + - IMX8 + - k32w + - nrf connect + - nrf + - python + - raspi + - vscode + - windows + - other + - core (please add to version below) + validations: + required: true + - type: input + id: platform-versions + attributes: + label: Platform Version(s) + description: "What platform version(s) are affected [optional]" + placeholder: "eg: 1.0.1, N/A" + - type: dropdown + attributes: + label: Type + description: How was this tested? + multiple: true + options: + - Unit tested + - YAML tested + - Manually tested with SDK + - CI tested + - Hardware validated + - Platform validated + validations: + required: true + - type: textarea + attributes: + label: (Optional) If manually tested please explain why this is only manually tested + description: | + Please explain how you tested it + validations: + required: false + - type: textarea + attributes: + label: Anything else? + description: | + Links? References? Anything that will give us more context about this! + + Tip: You can attach images or log files by clicking this area to highlight it and then dragging files in. + validations: + required: false + - type: markdown + attributes: + value: "Thanks for submitting a platform issue!" diff --git a/.github/ISSUE_TEMPLATE/080-feature-request.yaml b/.github/ISSUE_TEMPLATE/080-feature-request.yaml new file mode 100644 index 0000000000..c83b0c22ac --- /dev/null +++ b/.github/ISSUE_TEMPLATE/080-feature-request.yaml @@ -0,0 +1,62 @@ +name: "\U0001F4A1 Feature Request" +description: Create an feature to be considered future release +title: "[Feature] " +labels: ["feature work", "feature request", "needs triage"] +body: + - type: markdown + attributes: + value: | + Thanks for submitting a feature request to the Matter SDK! We need information about the feature to follow up, so please help us out by filling out this information. + - type: textarea + id: repro + attributes: + label: Feature description + description: "What feature are you looking to add? Please walk us through it!" + value: | + ... + validations: + required: true + - type: dropdown + attributes: + label: Platform + description: What platforms are affected? + multiple: true + options: + - all + - ameba + - android + - cc13x2_cc26x2 + - darwin + - efr32 + - esp32 + - freeRTOS + - IMX8 + - k32w + - nrf connect + - nrf + - python + - raspi + - vscode + - windows + - other + - core + validations: + required: true + - type: input + id: platform-versions + attributes: + label: Platform Version(s) + description: "What platform version(s) are affected [optional]" + placeholder: "eg: 1.0.1, N/A" + - type: textarea + attributes: + label: Anything else? + description: | + Links? References? Anything that will give us more context about the issue you are encountering! + + Tip: You can attach images or log files by clicking this area to highlight it and then dragging files in. + validations: + required: false + - type: markdown + attributes: + value: "Thanks for submitting a new feature request." diff --git a/.github/ISSUE_TEMPLATE/090-sve-issue.yaml b/.github/ISSUE_TEMPLATE/090-sve-issue.yaml new file mode 100644 index 0000000000..6ea6534123 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/090-sve-issue.yaml @@ -0,0 +1,119 @@ +name: "\U0001F9EA SVE Issue" +description: Create an issue that is required for SVE +title: "[SVE] " +labels: [bug, "sve", "request sve", "needs triage"] +body: + - type: markdown + attributes: + value: | + Thanks for reporting an issue against the Matter SDK! We need information about the bug report to follow up, so please help us out by filling out this information. + - type: textarea + id: repro + attributes: + label: Reproduction steps + description: "How do you trigger this bug? Please walk us through it step by step." + placeholder: | + Please list reproduction steps step by step. + Place shell commands between ```. + Attach logs as files instead of pasting them in. + 1. + 2. + 3. + ... + validations: + required: true + - type: input + id: prevalence + attributes: + label: Bug prevalence + description: "How often do you or others encounter this bug?" + placeholder: "Example: Whenever I do this, 1-2 times a week, day, hour, etc" + validations: + required: true + - type: input + attributes: + label: GitHub hash of the SDK that was being used + description: Hash of the GitHub SDK used + validations: + required: true + - type: dropdown + attributes: + label: Platform + description: What platforms are affected? + multiple: true + options: + - ameba + - android + - cc13x2_cc26x2 + - darwin + - efr32 + - esp32 + - freeRTOS + - IMX8 + - k32w + - nrf connect + - nrf + - python + - raspi + - vscode + - windows + - other + - core (please add to version below) + validations: + required: true + - type: input + id: platform-versions + attributes: + label: Platform Version(s) + description: "What platform version(s) are affected [optional]" + placeholder: "eg: 1.0.1, N/A" + - type: dropdown + attributes: + label: Type + description: What type of issue is this? + multiple: true + options: + - Test Improvement + - Common Cluster Logic + - Spec Compliance Issue + - Security Issue + - Platform Issue + - Core SDK Memory Issue + - Core SDK Crash + - Core SDK Performance Improvement + - Core SDK Interopability Issue + validations: + required: true + - type: dropdown + attributes: + label: Testing + description: How was this tested? + multiple: true + options: + - Unit tested + - YAML tested + - Manually tested with SDK + - CI tested + - Hardware validated + - Platform validated + validations: + required: true + - type: textarea + attributes: + label: (Optional) If manually tested please explain why this is only manually tested + description: | + Please explain how you tested it + validations: + required: false + - type: textarea + attributes: + label: Anything else? + description: | + Links? References? Anything that will give us more context about the issue you are encountering! + + Tip: You can attach images or log files by clicking this area to highlight it and then dragging files in. + validations: + required: false + - type: markdown + attributes: + value: "Thanks for helping our SVE!" diff --git a/.github/ISSUE_TEMPLATE/091-cert-blocker.yaml b/.github/ISSUE_TEMPLATE/091-cert-blocker.yaml new file mode 100644 index 0000000000..659135117d --- /dev/null +++ b/.github/ISSUE_TEMPLATE/091-cert-blocker.yaml @@ -0,0 +1,108 @@ +name: "\U0001F4DC Test Case Failure / Cert Blocker" +description: Create a report to identify matter certification test failures +title: "[CERT-TEST-FAILURE] " +labels: [bug, "cert blocker", "needs triage"] +body: + - type: markdown + attributes: + value: | + Thanks for reporting an issue against the Matter SDK! We need information about the cert blocker to follow up, so please help us out by filling out this information. + - type: dropdown + attributes: + label: Feature Area + description: What feature area is the test failing in? + multiple: true + options: + - Area:AirPurifiers + - Area:AirQualitySensor + - Area:ConcentrationMeasurement + - Area:DeviceAppearance + - Area:Dishwashers + - Area:DoorLockEnhancements + - Area:EventList + - Area:ICDPhase2 + - Area:ModeSelect + - Area:OperationalState + - Area:Refrigerators + - Area:RobotVacuums + - Area:RoomAirConditioner + - Area:Scenes + - Area:SmokeCO2 + - Area:TemperatureControlledCabinet + - Area:TimeSync + - Other + validations: + required: true + - type: input + id: testcase + attributes: + label: Test Case + description: "Which test case is failing?" + placeholder: "TC-XXXX" + validations: + required: true + - type: textarea + id: repro + attributes: + label: Reproduction steps + description: "How do you trigger this bug? Please walk us through it step by step." + placeholder: | + Please list reproduction steps step by step. + Place shell commands between ```. + Attach logs as files instead of pasting them in. + 1. + 2. + 3. + ... + validations: + required: true + - type: input + id: prevalence + attributes: + label: Bug prevalence + description: "How often do you or others encounter this bug?" + placeholder: "Example: Whenever I do this, 1-2 times a week, day, hour, etc" + validations: + required: true + - type: input + attributes: + label: GitHub hash of the SDK that was being used + description: Hash of the GitHub SDK used + validations: + required: true + - type: dropdown + attributes: + label: Platform + description: What platforms are affected? + multiple: true + options: + - ameba + - android + - cc13x2_cc26x2 + - darwin + - efr32 + - esp32 + - freeRTOS + - IMX8 + - k32w + - nrf + - python + - raspi + - vscode + - windows + - other + - core + validations: + required: true + - type: textarea + attributes: + label: Anything else? + description: | + Links? References? Anything that will give us more context about the issue you are encountering! + + Tip: You can attach images or log files by clicking this area to highlight it and then dragging files in. + validations: + required: false + - type: markdown + attributes: + value: "Thanks for submitting a test case/cert blocker!" diff --git a/.github/ISSUE_TEMPLATE/097-ci-test-failure.yaml b/.github/ISSUE_TEMPLATE/097-ci-test-failure.yaml new file mode 100644 index 0000000000..a99f5a6361 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/097-ci-test-failure.yaml @@ -0,0 +1,59 @@ +name: "\U0001F6E0 Test Issue" +description: Test issue +title: "[Test Failed] " +labels: ["build issue", "needs triage", "tests"] +body: + - type: markdown + attributes: + value: | + Thanks for reporting an issue against the Matter SDK's tests! We need information about the bug report to follow up, so please help us out by filling out this information. + - type: textarea + id: repro + attributes: + label: Test issue(s) + description: "What are the tests that failed? Please include links to failed jobs if possible." + value: | + 1. + 2. + 3. + ... + validations: + required: true + - type: dropdown + attributes: + label: Platform + description: What platforms are affected? + multiple: true + options: + - ameba + - android + - cc13x2_cc26x2 + - darwin + - efr32 + - esp32 + - freeRTOS + - IMX8 + - k32w + - nrf connect + - nrf + - python + - raspi + - vscode + - windows + - other + - core (please add to version below) + - all + validations: + required: false + - type: textarea + attributes: + label: Anything else? + description: | + Links? References? Anything that will give us more context about the issue you are encountering! + + Tip: You can attach images or log files by clicking this area to highlight it and then dragging files in. + validations: + required: false + - type: markdown + attributes: + value: "Thanks for helping improve our tests" diff --git a/.github/ISSUE_TEMPLATE/098-build-issue.yaml b/.github/ISSUE_TEMPLATE/098-build-issue.yaml new file mode 100644 index 0000000000..5d1adb3554 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/098-build-issue.yaml @@ -0,0 +1,59 @@ +name: "\U0001F6E0 Build Issue" +description: Build issue +title: "[Build] " +labels: ["build issue", "needs triage"] +body: + - type: markdown + attributes: + value: | + Thanks for reporting an issue against the Matter SDK's builds! We need information about the bug report to follow up, so please help us out by filling out this information. + - type: textarea + id: repro + attributes: + label: Build issue(s) + description: "What are the build issues? Please include links to failed jobs if possible." + value: | + 1. + 2. + 3. + ... + validations: + required: true + - type: dropdown + attributes: + label: Platform + description: What platforms are affected? + multiple: true + options: + - ameba + - android + - cc13x2_cc26x2 + - darwin + - efr32 + - esp32 + - freeRTOS + - IMX8 + - k32w + - nrf connect + - nrf + - python + - raspi + - vscode + - windows + - other + - core (please add to version below) + - all + validations: + required: false + - type: textarea + attributes: + label: Anything else? + description: | + Links? References? Anything that will give us more context about the issue you are encountering! + + Tip: You can attach images or log files by clicking this area to highlight it and then dragging files in. + validations: + required: false + - type: markdown + attributes: + value: "Thanks for helping improve our builds" diff --git a/.github/ISSUE_TEMPLATE/099-github-workflow-issue.yaml b/.github/ISSUE_TEMPLATE/099-github-workflow-issue.yaml new file mode 100644 index 0000000000..eefa5f0f98 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/099-github-workflow-issue.yaml @@ -0,0 +1,59 @@ +name: "\U0001F477 GitHub / CI / Workflow" +description: Create an issue to improve CI / Workflows +title: "[Workflow] " +labels: ["workflows", "needs triage"] +body: + - type: markdown + attributes: + value: | + Thanks for reporting an issue against the Matter SDK's workflows! We need information about the bug report to follow up, so please help us out by filling out this information. + - type: textarea + id: repro + attributes: + label: Workflow issues + description: "What updates to the workflows are needed?" + value: | + 1. + 2. + 3. + ... + validations: + required: true + - type: dropdown + attributes: + label: Platform + description: What platforms are affected? + multiple: true + options: + - ameba + - android + - cc13x2_cc26x2 + - darwin + - efr32 + - esp32 + - freeRTOS + - IMX8 + - k32w + - nrf connect + - nrf + - python + - raspi + - vscode + - windows + - other + - core (please add to version below) + - all + validations: + required: false + - type: textarea + attributes: + label: Anything else? + description: | + Links? References? Anything that will give us more context about the issue you are encountering! + + Tip: You can attach images or log files by clicking this area to highlight it and then dragging files in. + validations: + required: false + - type: markdown + attributes: + value: "Thanks for helping improve our development workflows" diff --git a/.github/ISSUE_TEMPLATE/100-documentation-issue.yaml b/.github/ISSUE_TEMPLATE/100-documentation-issue.yaml new file mode 100644 index 0000000000..51971d1d01 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/100-documentation-issue.yaml @@ -0,0 +1,58 @@ +name: "\U0001F5BA Documentation Issue" +description: Create an issue to improve documentation +title: "[Documentation] " +labels: ["documentation", "needs triage"] +body: + - type: markdown + attributes: + value: | + Thanks for reporting an issue against the Matter SDK! We need information about the bug report to follow up, so please help us out by filling out this information. + - type: textarea + id: repro + attributes: + label: Documentation issues + description: "What updates to documentation are needed?" + value: | + 1. + 2. + 3. + ... + validations: + required: true + - type: dropdown + attributes: + label: Platform + description: What platforms are affected? + multiple: true + options: + - ameba + - android + - cc13x2_cc26x2 + - darwin + - efr32 + - esp32 + - freeRTOS + - IMX8 + - k32w + - nrf connect + - nrf + - python + - raspi + - vscode + - windows + - other + - core (please add to version below) + validations: + required: false + - type: textarea + attributes: + label: Anything else? + description: | + Links? References? Anything that will give us more context about the issue you are encountering! + + Tip: You can attach images or log files by clicking this area to highlight it and then dragging files in. + validations: + required: false + - type: markdown + attributes: + value: "Thanks for helping improve our documentation." diff --git a/.github/ISSUE_TEMPLATE/config.yaml b/.github/ISSUE_TEMPLATE/config.yaml new file mode 100644 index 0000000000..3ba13e0cec --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yaml @@ -0,0 +1 @@ +blank_issues_enabled: false diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000000..dad1d2c646 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,12 @@ +> !!!!!!!!!! Please delete the instructions below and replace with PR description +> +> If you have an issue number, please use a syntax of +> `Fixes #12345` and a brief change description +> +> If you do not have an issue number, please have a good description of +> the problem and the fix. Help the reviewer understand what to expect. +> +> Make sure you delete these instructions (to prove you have read them). +> +> !!!!!!!!!! Instructions end + diff --git a/.github/actions/bootstrap-cache/action.yaml b/.github/actions/bootstrap-cache/action.yaml new file mode 100644 index 0000000000..f5ed24ba3f --- /dev/null +++ b/.github/actions/bootstrap-cache/action.yaml @@ -0,0 +1,17 @@ +name: Bootstrap cache +description: Bootstrap cache (deprecated) +runs: + using: "composite" + steps: + - uses: Wandalen/wretry.action@v1.4.10 + name: Bootstrap cache + continue-on-error: true + with: + action: buildjet/cache@v3 + attempt_limit: 3 + attempt_delay: 2000 + with: | + key: ${{ runner.os }}-env-${{ hashFiles('scripts/setup/*', 'third_party/pigweed/**', '/etc/lsb-release') }} + path: | + .environment + build_overrides/pigweed_environment.gni diff --git a/.github/actions/bootstrap/action.yaml b/.github/actions/bootstrap/action.yaml new file mode 100644 index 0000000000..ea06ceed7b --- /dev/null +++ b/.github/actions/bootstrap/action.yaml @@ -0,0 +1,82 @@ +name: Bootstrap +description: Bootstrap +inputs: + platform: + description: "Platform name" + required: false + default: none + bootstrap-log-name: + description: "Bootstrap log name" + required: false + default: bootstrap-logs-${{ github.job }} +outputs: + cache-hit: + description: "Bootstrap environment was restored from cache" + value: ${{ fromJSON(steps.restore.outputs.outputs).cache-hit }} # dynamic action returns all outputs in `outputs` + +runs: + using: "composite" + steps: + - name: Determine bootstrap cache configuration + id: prepare + shell: bash + run: | + # Determine bootstrap cache configuration + # In addition to the various setup files, the work directory matters as well, + # because the bootstrapped Pigweed environment contains absolute paths. + echo "Calculating bootstrap cache key for '$PWD'" + FILES_HASH="${{ hashFiles('scripts/setup/*', 'third_party/pigweed/**') }}" + case "$RUNNER_OS" in + macOS) OS_HASH="$(sw_vers | shasum -a 256 | cut -d' ' -f1)";; + *) OS_HASH="$(shasum -a 256 /etc/lsb-release | cut -d' ' -f1)";; + esac + PYTHON_HASH="$(python --version | shasum -a 256 | cut -d' ' -f1)" + FINAL_HASH="$(echo "$PWD:$FILES_HASH:$OS_HASH:$PYTHON_HASH" | shasum -a 256 | cut -d' ' -f1)" + echo key="${RUNNER_OS}-${RUNNER_ARCH}-${{ inputs.platform }}-${FINAL_HASH}" | tee -a "$GITHUB_OUTPUT" + + # Split caches across backends + case "$RUNNER_OS" in + macOS) echo backend=actions;; + *) echo backend=buildjet;; + esac | tee -a "$GITHUB_OUTPUT" + + - name: Bootstrap from cache + id: restore + uses: ./.github/actions/dynamic + continue-on-error: true + with: + action: ${{ steps.prepare.outputs.backend }}/cache/restore@v4 + with: | + key: ${{ steps.prepare.outputs.key }} + path: | + .environment + build_overrides/pigweed_environment.gni + + - name: Run bootstrap + if: ${{ fromJSON(steps.restore.outputs.outputs).cache-hit != 'true' }} + env: + PW_NO_CIPD_CACHE_DIR: 1 + PW_ENVSETUP_NO_BANNER: 1 + shell: bash + run: source scripts/bootstrap.sh -p all,${{ inputs.platform }} + + - name: Save bootstrap cache + uses: ./.github/actions/dynamic + if: ${{ fromJSON(steps.restore.outputs.outputs).cache-hit != 'true' }} + continue-on-error: true + with: + action: ${{ steps.prepare.outputs.backend }}/cache/save@v4 + with: | + key: ${{ steps.prepare.outputs.key }} + path: | + .environment + build_overrides/pigweed_environment.gni + + - name: Upload bootstrap logs + uses: actions/upload-artifact@v4 + if: ${{ always() && !env.ACT && fromJSON(steps.restore.outputs.outputs).cache-hit != 'true' }} + with: + name: ${{ inputs.bootstrap-log-name }} + path: | + .environment/gn_out/.ninja_log + .environment/pigweed-venv/*.log diff --git a/.github/actions/checkout-submodules-and-bootstrap/action.yaml b/.github/actions/checkout-submodules-and-bootstrap/action.yaml new file mode 100644 index 0000000000..df3fdff1e0 --- /dev/null +++ b/.github/actions/checkout-submodules-and-bootstrap/action.yaml @@ -0,0 +1,43 @@ +name: Checkout submodules & Bootstrap +description: Checkout submodules & Bootstrap +inputs: + platform: + description: "Platform name" + required: true + extra-submodule-parameters: + description: "extra submodule parameters" + required: false + default: "" + bootstrap-log-name: + description: "Bootstrap log name" + required: false + default: bootstrap-logs-${{ github.job }} +runs: + using: "composite" + steps: + - name: Maximize runner disk + uses: ./.github/actions/maximize-runner-disk + - name: Dump disk info + uses: ./.github/actions/dump-disk-info + - name: Set git safe directory for local act runs + uses: ./.github/actions/git-safe-directory + - name: Checkout submodules + uses: ./.github/actions/checkout-submodules + with: + platform: ${{ inputs.platform }} + extra-parameters: ${{ inputs.extra-submodule-parameters }} + - name: Bootstrap + uses: ./.github/actions/bootstrap + with: + platform: ${{ inputs.platform }} + bootstrap-log-name: ${{ inputs.bootstrap-log-name }} + - name: Dump disk info after checkout submodule & Bootstrap + shell: bash + run: scripts/dump_diskspace_info.sh + - name: Work around TSAN ASLR issues + if: runner.os == 'Linux' && !env.ACT + shell: bash + run: | + # See https://stackoverflow.com/a/77856955/2365113 + if [[ "$UID" == 0 ]]; then function sudo() { "$@"; }; fi + sudo sysctl vm.mmap_rnd_bits=28 diff --git a/.github/actions/checkout-submodules/action.yaml b/.github/actions/checkout-submodules/action.yaml new file mode 100644 index 0000000000..e180a8c494 --- /dev/null +++ b/.github/actions/checkout-submodules/action.yaml @@ -0,0 +1,19 @@ +name: Checkout submodules +description: Checkout submodules +inputs: + extra-parameters: + description: "extra parameters" + required: false + default: "" + platform: + description: "Platform name" + required: true +runs: + using: "composite" + steps: + - uses: Wandalen/wretry.action@v1.4.10 + name: Checkout submodules + with: + command: scripts/checkout_submodules.py --allow-changing-global-git-config --shallow --platform ${{ inputs.platform }} ${{ inputs.extra-parameters }} + attempt_limit: 3 + attempt_delay: 2000 diff --git a/.github/actions/dump-disk-info/action.yaml b/.github/actions/dump-disk-info/action.yaml new file mode 100644 index 0000000000..1f6474e54c --- /dev/null +++ b/.github/actions/dump-disk-info/action.yaml @@ -0,0 +1,20 @@ +name: Dump disk space info +description: Help debug running out of disk space on github CI +runs: + using: "composite" + steps: + - name: Collect disk info + # Unfortunately current syntax for github wrapper actions only work for + # Javascript actions, and Docker container actions, which doesn't make it + # possible to wrap a shell script like the one below. The action below + # essentially wraps the shell commands we want to run into a Javascript + # wrapped action. This allow us to get the disk info usage before a job + # is run and after the job is run regardless if the job succeeds or + # fails. + uses: pyTooling/Actions/with-post-step@v0.4.5 + if: ${{ runner.os == 'Linux' }} + with: + main: |- + exec ./scripts/dump_diskspace_info.sh + post: |- + exec ./scripts/dump_diskspace_info.sh \ No newline at end of file diff --git a/.github/actions/dynamic/action.yaml b/.github/actions/dynamic/action.yaml new file mode 100644 index 0000000000..7cee233c4f --- /dev/null +++ b/.github/actions/dynamic/action.yaml @@ -0,0 +1,38 @@ +name: Dynamic +description: Dynamically resolves another GitHub action +inputs: + action: + description: Action reference + required: true + with: + description: Action inputs as multi-line YAML string + required: false + default: "" +outputs: + outputs: + description: JSON object of outputs from the action + value: ${{ steps.run.outputs.outputs }} +runs: + using: composite + steps: + - name: Instantiate + shell: bash + run: | + # Dynamically invoke ${{ inputs.action }} + with='${{ inputs.with }}' + [[ -z "$with" ]] || with="$(echo ' with:'; sed -e 's/^/ /' <<<"$with")" + mkdir -p ./.tmp/dynamic-action-instance + cat <./.tmp/dynamic-action-instance/action.yaml + runs: + using: composite + steps: + - id: run + uses: ${{ inputs.action }} + $with + outputs: + outputs: + value: $(echo '$'){{ toJSON(steps.run.outputs) }} + END + - name: Run + id: run + uses: ./.tmp/dynamic-action-instance diff --git a/.github/actions/git-safe-directory/action.yaml b/.github/actions/git-safe-directory/action.yaml new file mode 100644 index 0000000000..1308c4ea1b --- /dev/null +++ b/.github/actions/git-safe-directory/action.yaml @@ -0,0 +1,9 @@ +name: Git safe directory +description: For running act with checkout owned by non-root user +runs: + using: "composite" + steps: + - name: Set git safe.directory to "*" + if: ${{ env.ACT }} + shell: bash + run: git config --system --add safe.directory '*' \ No newline at end of file diff --git a/.github/actions/maximize-runner-disk/action.yaml b/.github/actions/maximize-runner-disk/action.yaml new file mode 100644 index 0000000000..d71ba3646d --- /dev/null +++ b/.github/actions/maximize-runner-disk/action.yaml @@ -0,0 +1,48 @@ +name: Maximize runner disk +description: Free up disk space on the github runner +runs: + using: "composite" + steps: + - name: Free up disk space on the github runner + if: runner.os == 'Linux' && !env.ACT + shell: bash + run: | + # maximize-runner-disk + # Directories to prune to free up space. Candidates: + # 1.6G /usr/share/dotnet + # 1.1G /usr/local/lib/android/sdk/platforms + # 1000M /usr/local/lib/android/sdk/build-tools + # 8.9G /usr/local/lib/android/sdk + # This list can be amended later to change the trade-off between the amount of + # disk space freed up, and how long it takes to do so (deleting many files is slow). + prune=(/usr/share/dotnet /usr/local/lib/android/sdk/platforms /usr/local/lib/android/sdk/build-tools) + + if [[ "$UID" -eq 0 && -d /__w ]]; then + root=/runner-root-volume + if [[ ! -d "$root" ]]; then + echo "Unable to maximize disk space, job is running inside a container and $root is not mounted" + exit 0 + fi + function sudo() { "$@"; } # we're already root (and sudo is probably unavailable) + elif [[ "$UID" -ne 0 && "$RUNNER_ENVIRONMENT" == github-hosted ]]; then + root= + else + echo "Unable to maximize disk space, unknown runner environment" + exit 0 + fi + + echo "Freeing up runner disk space on ${root:-/}" + function avail() { df -k --output=avail "${root:-/}" | grep '^[0-9]*$'; } + function now() { date '+%s'; } + before="$(avail)" start="$(now)" + for dir in "${prune[@]}"; do + if [[ -d "${root}${dir}" ]]; then + echo "- $dir" + # du -sh -- "${root}${dir}" + sudo rm -rf -- "${root}${dir}" + else + echo "- $dir (not found)" + fi + done + after="$(avail)" end="$(now)" + echo "Done, freed up $(( (after - before) / 1024 ))M of disk space in $(( end - start )) seconds." diff --git a/.github/actions/perform-codeql-analysis/action.yaml b/.github/actions/perform-codeql-analysis/action.yaml new file mode 100644 index 0000000000..f1caf10dc3 --- /dev/null +++ b/.github/actions/perform-codeql-analysis/action.yaml @@ -0,0 +1,34 @@ +name: Run CodeQL Analysis +description: Run and upload CodeQL Analysis +inputs: + language: + description: "language for codeql analysis" + required: true +runs: + using: "composite" + steps: + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v2 + with: + category: "/language:${{ inputs.language }}" + upload: False + output: sarif-results + - name: filter-sarif + uses: advanced-security/filter-sarif@v1 + with: + patterns: | + -**/third_party/** + -**/scripts/** + input: "sarif-results/${{ inputs.language }}.sarif" + output: "sarif-results/${{ inputs.language }}.sarif" + + - name: Upload SARIF + uses: github/codeql-action/upload-sarif@v2 + with: + sarif_file: "sarif-results/${{ inputs.language }}.sarif" + - name: Upload loc as a Build Artifact + uses: actions/upload-artifact@v4 + with: + name: sarif-results + path: sarif-results + retention-days: 1 diff --git a/.github/actions/setup-size-reports/action.yaml b/.github/actions/setup-size-reports/action.yaml new file mode 100644 index 0000000000..511a434242 --- /dev/null +++ b/.github/actions/setup-size-reports/action.yaml @@ -0,0 +1,15 @@ +name: Setup size reports +description: Setup size reports +inputs: + gh-context: + description: "GH Context" + required: true + +runs: + using: "composite" + steps: + - name: Set up environment for size reports + shell: bash + env: + GH_CONTEXT: ${{ inputs.gh-context }} + run: scripts/tools/memory/gh_sizes_environment.py "${GH_CONTEXT}" diff --git a/.github/actions/upload-size-reports/action.yaml b/.github/actions/upload-size-reports/action.yaml new file mode 100644 index 0000000000..41fe8c820c --- /dev/null +++ b/.github/actions/upload-size-reports/action.yaml @@ -0,0 +1,17 @@ +name: upload-size-reports +description: upload-size-reports +inputs: + platform-name: + description: "Platform name Name" + required: true + +runs: + using: "composite" + steps: + - name: Uploading Size Reports + uses: actions/upload-artifact@v4 + if: ${{ !env.ACT }} + with: + name: Size,${{ inputs.platform-name }}-Examples,${{ env.GH_EVENT_PR }},${{ env.GH_EVENT_HASH }},${{ env.GH_EVENT_PARENT }},${{ github.event_name }} + path: | + /tmp/bloat_reports/ diff --git a/.github/boring-cyborg.yml b/.github/boring-cyborg.yml new file mode 100644 index 0000000000..c6fa9bcf94 --- /dev/null +++ b/.github/boring-cyborg.yml @@ -0,0 +1,132 @@ +# Copyright (c) 2020 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. +labelPRBasedOnFilePath: + ############################################################ + # Top Level Labels + ############################################################ + repo: + - ./* + + ############################################################ + # Examples + ############################################################ + examples: + - examples/* + + ############################################################ + # Documentation + ############################################################ + documentation: + - docs/* + + ############################################################ + # Tools + Development Items + ############################################################ + scripts: + - scripts/* + + integrations: + - integrations/* + + vscode: + - .vscode + - .devcontainer + + gn: + - gn/* + + github: + - .github + + workflows: + - .github/workflows/* + + tools: + - tools/* + + ############################################################ + # Source Code + ############################################################ + qr code: + - src/qrcode/* + + lwip: + - src/lwip/* + + inet: + - src/inet/* + + config: + - config/* + + lib: + - src/lib/* + + crypto: + - src/crypto/* + + controller: + - src/controller/* + + ble: + - src/ble/* + + app: + - src/app/* + + transport: + - src/transport/* + + system: + - src/system/* + + setup payload: + - src/setup_payload/* + + ############################################################ + # Platforms + ############################################################ + platform: + - src/platform/* + + darwin: + - src/platform/Darwin/* + - src/darwin/* + + efr32: + - src/platform/silabs/* + + esp32: + - src/platform/ESP32/* + + freeRTOS: + - src/platform/FreeRTOS/* + + k32w: + - src/platform/K32W/* + + linux: + - src/platform/Linux/* + + nrf connect: + - src/platform/nrfconnect/* + + openthread: + - src/platform/openthread/* + + zephyr: + - src/platform/Zephyr/* + + telink: + - src/platform/telink/* diff --git a/.github/config.yml b/.github/config.yml new file mode 100644 index 0000000000..027b4dc4e4 --- /dev/null +++ b/.github/config.yml @@ -0,0 +1,8 @@ +todo: + keyword: ["@todo", "TODO", "TODO:"] # string|string[] + bodyKeyword: ["@body", "BODY", "BODY:"] # string|string[] + blobLines: 10 # number|boolean, 0 or false to disable + autoAssign: true # string|string[]|boolean + label: ["todo"] # boolean|string|string[] + reopenClosed: true # boolean + exclude: ".*lint\\.yaml|.*/(zzz_generated|zap-generated)/.*" # string diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000000..8c618416fb --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,61 @@ +version: 2 +updates: + - package-ecosystem: "gradle" + directory: "/" + schedule: + interval: "weekly" + + - package-ecosystem: "pip" + directory: "/" + schedule: + interval: "weekly" + + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "weekly" + + - package-ecosystem: "gitsubmodule" + directory: "/" + schedule: + interval: "weekly" + allow: + - dependency-name: "third_party/pigweed/repo" + - dependency-name: "third_party/mbedtls/repo" + - dependency-name: "third_party/openthread/repo" + + - dependency-name: "third_party/ameba/repo" + - dependency-name: "third_party/android_deps/repo" + - dependency-name: "third_party/asr/repo" + - dependency-name: "third_party/boringssl/repo" + - dependency-name: "third_party/bouffalolab/repo" + - dependency-name: "third_party/cirque/repo" + - dependency-name: "third_party/editline/repo" + - dependency-name: "third_party/freertos/repo" + - dependency-name: "third_party/imgui/repo" + - dependency-name: "third_party/infineon/repo" + - dependency-name: "third_party/inipp/repo" + - dependency-name: "third_party/java_deps/repo" + - dependency-name: "third_party/jlink/repo" + - dependency-name: "third_party/jsoncpp/repo" + - dependency-name: "third_party/libwebsockets/repo" + - dependency-name: "third_party/lwip/repo" + - dependency-name: "third_party/mbed-mcu-boot/repo" + - dependency-name: "third_party/mbed-os-cypress-capsense-button/repo" + - dependency-name: "third_party/mbed-os-posix-socket/repo" + - dependency-name: "third_party/mbedtls/repo" + - dependency-name: "third_party/mt793x_sdk/repo" + - dependency-name: "third_party/mynewt-core/repo" + - dependency-name: "third_party/nanopb/repo" + - dependency-name: "third_party/nlassert/repo" + - dependency-name: "third_party/nlfaultinjection/repo" + - dependency-name: "third_party/nlio/repo" + - dependency-name: "third_party/nxp/repo" + - dependency-name: "third_party/open-iot-sdk/repo" + - dependency-name: "third_party/ot-br-posix/repo" + - dependency-name: "third_party/perfetto/repo" + - dependency-name: "third_party/qpg_sdk/repo" + - dependency-name: "third_party/silabs/repo" + - dependency-name: "third_party/simw-top-mini/repo" + - dependency-name: "third_party/ti_simplelink_sdk/repo" + - dependency-name: "third_party/tizen/repo" diff --git a/.github/issue-labeler.yml b/.github/issue-labeler.yml new file mode 100644 index 0000000000..909ef045c0 --- /dev/null +++ b/.github/issue-labeler.yml @@ -0,0 +1,54 @@ +darwin: + # Make sure we don't match random words that contain "mac" inside. + # + # Make sure we don't match random words that contain "ios" inside + # (like "kiosk" or whatnot), but do allow matching "ios8" and things + # like that. + # + # Make sure we don't trigger for the string "MAC", which almost + # certainly has nothing to do with Darwin. + # + # \\b means "word boundary" + # (?![a-z]) means "there is no next char in the range a-z". + - "/(\\b[Ii][Oo][Ss](?![a-zA-Z])|[Hh][Oo][Mm][Ee][Pp][Oo][Dd]|[Dd][Aa][Rr][Ww][Ii][Nn]|\\bm[Aa][Cc]\\b|\\bMa[Cc]\\b|\\bM[Aa]c\\b|[Mm][Aa][Cc][Oo][Ss])/" + +linux: + - "/(linux)/i" + +# Special Keywords for Cert Blockers +air purifiers: + - "(Area:AirPurifiers)" +air quality sensors: + - "(Area:AirQualitySensor)" +concentration measurement: + - "(Area:ConcentrationMeasurement)" +device appearance: + - "(Area:DeviceAppearance)" +dishwashers: + - "(Area:Dishwashers)" +door lock enhancements: + - "(Area:DoorLockEnhancements)" +event list: + - "(Area;EventList)" +icd: + - "(Area:ICDPhase2)" +icd phase 2: + - "(Area:ICDPhase2)" +mode select: + - "(Area:ModeSelect)" +operational state: + - "(Area:OperationalState)" +refrigerators: + - "(Area:Refrigerators)" +robot vacuums: + - "(Area:RobotVacuums)" +room air conditioners: + - "(Area:RoomAirConditioner)" +scenes: + - "(Area:Scenes)" +smoke & c02: + - "(Area:SmokeCO2)" +temperature controlled cabinet: + - "(Area:TemperatureControlledCabinet)" +time sync: + - "(Area:TimeSync)" diff --git a/.github/labeler.yml b/.github/labeler.yml new file mode 100644 index 0000000000..7e02fe6d36 --- /dev/null +++ b/.github/labeler.yml @@ -0,0 +1,333 @@ +# Copyright (c) 2020 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. + +############################################################ +# Top Level Labels +############################################################ +repo: + - changed-files: + - any-glob-to-any-file: + - './*' + +############################################################ +# Examples +############################################################ +examples: + - changed-files: + - any-glob-to-any-file: + - examples/* + - examples/**/* + +############################################################ +# Documentation +############################################################ +documentation: + - changed-files: + - any-glob-to-any-file: + - docs/* + - docs/**/* + - "*.md" + +############################################################ +# Tools + Development Items +############################################################ +scripts: + - changed-files: + - any-glob-to-any-file: + - scripts/* + - scripts/**/* + +integrations: + - changed-files: + - any-glob-to-any-file: + - integrations/* + - integrations/**/* + +docker: + - changed-files: + - any-glob-to-any-file: + - integrations/docker/* + - integrations/docker/**/* + +vscode: + - changed-files: + - any-glob-to-any-file: + - .vscode/* + - .vscode/**/* + - .devcontainer/* + - .devcontainer/**/* + +gn: + - changed-files: + - any-glob-to-any-file: + - build/* + - build/**/* + - build_overrides/* + - build_overrides/**/* + - .gn + - "*.gn" + - "*.gni" + +github: + - changed-files: + - any-glob-to-any-file: + - .github + - .github/* + - .github/**/* + +workflows: + - changed-files: + - any-glob-to-any-file: + - .github/workflows/* + - .github/workflows/**/* + +tools: + - changed-files: + - any-glob-to-any-file: + - src/tools/* + - src/tools/**/* + - tools/* + - tools/**/* + - examples/chip-tool/* + - examples/chip-tool/**/* + +############################################################ +# Tests +############################################################ +tests: + - changed-files: + - any-glob-to-any-file: + - src/python_testing/* + - src/python_testing/**/* + - src/app/tests/* + - src/app/tests/**/* + +test driver: + - changed-files: + - any-glob-to-any-file: + - src/test_driver/* + - src/test_driver/**/* + +# Cert tests touched: add current milestone delta-tracking label. +# TODO: Change after Aug 15, 2024 +matter-1.4-te2-script-change: + - changed-files: + - any-glob-to-any-file: + - src/python_testing/* + - src/python_testing/**/* + - src/app/tests/suites/certification/* + +############################################################ +# Source Code +############################################################ +qr code: + - changed-files: + - any-glob-to-any-file: + - src/qrcode/* + - src/qrcode/**/* + - src/qrcodetool/* + - src/qrcodetool/**/* + +lwip: + - changed-files: + - any-glob-to-any-file: + - src/lwip/* + - src/lwip/**/* + +inet: + - changed-files: + - any-glob-to-any-file: + - src/inet/* + - src/inet/**/* + +config: + - changed-files: + - any-glob-to-any-file: + - config/* + - config/**/* + +lib: + - changed-files: + - any-glob-to-any-file: + - src/lib/* + - src/lib/**/* + +core: + - changed-files: + - any-glob-to-any-file: + - src/lib/core/* + - src/lib/core/**/* + +protocols: + - changed-files: + - any-glob-to-any-file: + - src/lib/protocols/* + - src/lib/protocols/**/* + - src/protocols/* + - src/protocols/**/* + +messaging: + - changed-files: + - any-glob-to-any-file: + - src/messaging/* + - src/messaging/**/* + +shell: + - changed-files: + - any-glob-to-any-file: + - src/lib/shell/* + - src/lib/shell/**/* + +support: + - changed-files: + - any-glob-to-any-file: + - src/lib/support/* + - src/lib/support/**/* + +crypto: + - changed-files: + - any-glob-to-any-file: + - src/crypto/* + - src/crypto/**/* + +controller: + - changed-files: + - any-glob-to-any-file: + - src/controller/* + - src/controller/**/* + +ble: + - changed-files: + - any-glob-to-any-file: + - src/ble/* + - src/ble/**/* + +app: + - changed-files: + - any-glob-to-any-file: + - src/app/* + - src/app/**/* + +icd: + - changed-files: + - any-glob-to-any-file: + - src/app/icd/* + - src/app/icd/**/* + +transport: + - changed-files: + - any-glob-to-any-file: + - src/transport/* + - src/transport/**/* + +system: + - changed-files: + - any-glob-to-any-file: + - src/system/* + - src/system/**/* + +setup payload: + - changed-files: + - any-glob-to-any-file: + - src/setup_payload/* + - src/setup_payload/**/* + +############################################################ +# Platforms +############################################################ +platform: + - changed-files: + - any-glob-to-any-file: + - src/platform/* + - src/platform/**/* + - config/tizen/chip-gn/platform/* + - config/tizen/chip-gn/platform/**/* + - examples/platform/* + - examples/platform/**/* + - scripts/tools/memory/platform/* + - scripts/tools/memory/platform/**/* + - src/include/platform/* + - src/include/platform/**/* + - src/lib/dnssd/platform/* + - src/lib/dnssd/platform/**/* + +darwin: + - changed-files: + - any-glob-to-any-file: + - src/platform/Darwin/* + - src/platform/Darwin/**/* + - src/darwin/* + - src/darwin/**/* + - examples/darwin-framework-tool/* + - examples/darwin-framework-tool/**/* + +silabs: + - changed-files: + - any-glob-to-any-file: + - src/platform/silabs/* + - src/platform/silabs/**/* + +esp32: + - changed-files: + - any-glob-to-any-file: + - src/platform/ESP32/* + - src/platform/ESP32/**/* + +freeRTOS: + - changed-files: + - any-glob-to-any-file: + - src/platform/FreeRTOS/* + - src/platform/FreeRTOS/**/* + +k32w: + - changed-files: + - any-glob-to-any-file: + - src/platform/K32W/* + - src/platform/K32W/**/* + +linux: + - changed-files: + - any-glob-to-any-file: + - src/platform/Linux/* + - src/platform/Linux/**/* + +nrf connect: + - changed-files: + - any-glob-to-any-file: + - src/platform/nrfconnect/* + - src/platform/nrfconnect/**/* + +openthread: + - changed-files: + - any-glob-to-any-file: + - src/platform/openthread/* + - src/platform/openthread/**/* + +zephyr: + - changed-files: + - any-glob-to-any-file: + - src/platform/Zephyr/* + - src/platform/Zephyr/**/* + +telink: + - changed-files: + - any-glob-to-any-file: + - src/platform/telink/* + - src/platform/telink/**/* + +tizen: + - changed-files: + - any-glob-to-any-file: + - src/platform/Tizen/* + - src/platform/Tizen/**/* diff --git a/.github/release.yml b/.github/release.yml new file mode 100644 index 0000000000..d33d2a3e6d --- /dev/null +++ b/.github/release.yml @@ -0,0 +1,76 @@ +# .github/release.yml + +changelog: + exclude: + labels: + - scripts + - external dependency + - submodules + - integrations + - documentation + authors: + - restyled-io + - octocat + - pullapprove + - jira + - issue-label-bot + - github-actions + - github-labels + - buildjet + categories: + - title: Highlighted Fixes + labels: + - release note + - title: Security Fixes + labels: + - security + - title: Bug Fixes + labels: + - bug + - title: Bluetooth Related Changes + labels: + - ble + - title: Spec Alignment Changes + labels: + - spec + - title: Transport/Messaging Layer Changes + labels: + - inet + - transport + - messaging + - protocols + - lwip + - title: Crypto Changes + labels: + - crypto + - title: Core Library Changes + labels: + - lib + - title: Core Changes + labels: + - core + - title: Controller Changes + labels: + - controller + - title: System Level Changes + labels: + - system + - attestation + - title: App Level Changes + labels: + - app + - title: Platform Changes + labels: + - platform + - darwin + - android + - title: Example App Changes + labels: + - examples + - title: Test Changes + labels: + - tests + - title: Build Related Changes + labels: + - gn + - build diff --git a/.github/workflows/artifacts.yaml b/.github/workflows/artifacts.yaml new file mode 100644 index 0000000000..002d945ebc --- /dev/null +++ b/.github/workflows/artifacts.yaml @@ -0,0 +1,17 @@ +name: 'Delete old artifacts' +on: + schedule: + - cron: '0 * * * *' # every hour + +concurrency: + group: ${{ github.workflow }} + cancel-in-progress: true + +jobs: + delete-artifacts: + runs-on: ubuntu-latest + steps: + - uses: kolpav/purge-artifacts-action@v1 + with: + token: ${{ secrets.GITHUB_TOKEN }} + expire-in: 14days diff --git a/.github/workflows/bloat_check.yaml b/.github/workflows/bloat_check.yaml new file mode 100644 index 0000000000..870c5f379e --- /dev/null +++ b/.github/workflows/bloat_check.yaml @@ -0,0 +1,53 @@ +# Copyright (c) 2020 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: Bloat Check +on: + workflow_dispatch: + schedule: + - cron: "*/5 * * * *" + +concurrency: + group: ${{ github.workflow }} + # Don't cancel an already-running bloat check just because it took more + # than 5 minutes to run and our cron job is trying to schedule a new one. + cancel-in-progress: false + +jobs: + pull_request_update: + name: Report on pull requests + + # Don't run on forked repos + if: github.repository_owner == 'project-chip' + + runs-on: ubuntu-latest + + container: + image: ghcr.io/project-chip/chip-build:74 + + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Report + run: | + scripts/tools/memory/gh_report.py \ + --verbose \ + --report-increases 0.2 \ + --report-pr \ + --github-comment \ + --github-limit-artifact-pages 50 \ + --github-limit-artifacts 500 \ + --github-limit-comments 20 \ + --github-repository project-chip/connectedhomeip \ + --github-api-token "${{ secrets.GITHUB_TOKEN }}" diff --git a/.github/workflows/build-cert-bins.yaml b/.github/workflows/build-cert-bins.yaml new file mode 100644 index 0000000000..52c274193b --- /dev/null +++ b/.github/workflows/build-cert-bins.yaml @@ -0,0 +1,21 @@ +name: Build Certification Image +on: + workflow_call: + workflow_dispatch: +jobs: + build-cert-bin: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@master + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: Publish to Registry + uses: elgohr/Publish-Docker-Github-Action@v5 + with: + name: ghcr.io/project-chip/chip-cert-bins + tags: latest + dockerfile: ./integrations/docker/images/chip-cert-bins/Dockerfile + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + registry: ghcr.io + platforms: linux/amd64,linux/arm64,linux/arm diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml new file mode 100644 index 0000000000..83ecc7e00a --- /dev/null +++ b/.github/workflows/build.yaml @@ -0,0 +1,476 @@ +# 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: Builds + +on: + push: + branches-ignore: + - 'dependabot/**' + pull_request: + merge_group: + workflow_dispatch: + workflow_call: + inputs: + run-codeql: + required: false + type: boolean + +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: + build_linux_gcc_debug: + name: Build on Linux (gcc_debug) + + runs-on: ubuntu-latest + if: github.actor != 'restyled-io[bot]' + + container: + image: ghcr.io/project-chip/chip-build:74 + volumes: + - "/:/runner-root-volume" + - "/tmp/log_output:/tmp/test_logs" + options: --privileged --sysctl "net.ipv6.conf.all.disable_ipv6=0 + net.ipv4.conf.all.forwarding=1 net.ipv6.conf.all.forwarding=1" + + steps: + - name: Dump GitHub context + env: + GITHUB_CONTEXT: ${{ toJSON(github) }} + run: echo "$GITHUB_CONTEXT" + - name: Dump Concurrency context + env: + CONCURRENCY_CONTEXT: ${{ github.ref }}-${{ github.workflow }}-${{ (github.event_name == 'pull_request' && github.event.number) || (github.event_name == 'workflow_dispatch' && github.run_number) || github.sha }} + run: echo "$CONCURRENCY_CONTEXT" + - name: Checkout + uses: actions/checkout@v4 + - name: Try to ensure the directories for core dumping exist and we + can write them. + run: | + mkdir /tmp/cores || true + sysctl -w kernel.core_pattern=/tmp/cores/core.%u.%p.%t || true + - name: Checkout submodules & Bootstrap + uses: ./.github/actions/checkout-submodules-and-bootstrap + with: + platform: linux + - name: Initialize CodeQL + if: ${{ inputs.run-codeql }} + uses: github/codeql-action/init@v3 + with: + languages: "cpp" + - name: Setup Build + run: scripts/build/gn_gen.sh --args="chip_config_memory_debug_checks=true chip_config_memory_debug_dmalloc=false chip_data_model_check_die_on_failure=true" + - name: Run Build + run: scripts/run_in_build_env.sh "ninja -C ./out" + - name: Run Tests + run: scripts/tests/gn_tests.sh + # TODO Log Upload https://github.com/project-chip/connectedhomeip/issues/2227 + # TODO https://github.com/project-chip/connectedhomeip/issues/1512 + # - name: Run Code Coverage + # if: ${{ contains('main', env.BUILD_TYPE) }} + # run: scripts/tools/codecoverage.sh + # - name: Upload Code Coverage + # if: ${{ contains('main', env.BUILD_TYPE) }} + # run: bash <(curl -s https://codecov.io/bash) + - name: Set up Build Without Detail Logging + run: scripts/build/gn_gen.sh --args="chip_detail_logging=false" + - name: Run Build Without Detail Logging + run: scripts/run_in_build_env.sh "ninja -C ./out" + - name: Set up Build Without Progress Logging + run: scripts/build/gn_gen.sh --args="chip_detail_logging=false chip_progress_logging=false" + - name: Run Build Without Progress Logging + run: scripts/run_in_build_env.sh "ninja -C ./out" + - name: Set up Build Without Error Logging + run: scripts/build/gn_gen.sh --args="chip_detail_logging=false chip_progress_logging=false chip_error_logging=false" + - name: Run Build Without Error Logging + run: scripts/run_in_build_env.sh "ninja -C ./out" + - name: Set up Build Without Logging + run: scripts/build/gn_gen.sh --args="chip_logging=false" + - name: Run Build Without Logging + run: scripts/run_in_build_env.sh "ninja -C ./out" + - name: Uploading core files + uses: actions/upload-artifact@v4 + if: ${{ failure() && !env.ACT }} + with: + name: crash-core-linux-gcc-debug + path: /tmp/cores/ + # Cores are big; don't hold on to them too long. + retention-days: 5 + - name: Perform CodeQL Analysis + if: ${{ inputs.run-codeql }} + uses: ./.github/actions/perform-codeql-analysis + with: + language: cpp + # OBJDIR on linux is > 10K files and takes more than 50 minutes to upload, usually + # having the job timeout. + # + # If re-enabling, some subset of this should be picked + # + # - name: Uploading objdir for debugging + # uses: actions/upload-artifact@v4 + # if: ${{ failure() && !env.ACT }} + # with: + # name: crash-objdir-linux-gcc-debug + # path: out/ + # # objdirs are big; don't hold on to them too long. + # retention-days: 5 + + build_linux: + name: Build on Linux (fake, gcc_release, clang, simulated) + + runs-on: ubuntu-latest + if: github.actor != 'restyled-io[bot]' + + container: + image: ghcr.io/project-chip/chip-build:74 + volumes: + - "/:/runner-root-volume" + - "/tmp/log_output:/tmp/test_logs" + options: --privileged --sysctl "net.ipv6.conf.all.disable_ipv6=0 + net.ipv4.conf.all.forwarding=1 net.ipv6.conf.all.forwarding=1" + + steps: + - name: Dump GitHub context + env: + GITHUB_CONTEXT: ${{ toJSON(github) }} + run: echo "$GITHUB_CONTEXT" + - name: Dump Concurrency context + env: + CONCURRENCY_CONTEXT: ${{ github.ref }}-${{ github.workflow }}-${{ (github.event_name == 'pull_request' && github.event.number) || (github.event_name == 'workflow_dispatch' && github.run_number) || github.sha }} + run: echo "$CONCURRENCY_CONTEXT" + - name: Checkout + uses: actions/checkout@v4 + - name: Try to ensure the directories for core dumping exist and we + can write them. + run: | + mkdir /tmp/cores || true + sysctl -w kernel.core_pattern=/tmp/cores/core.%u.%p.%t || true + - name: Checkout submodules & Bootstrap + uses: ./.github/actions/checkout-submodules-and-bootstrap + with: + platform: linux + - name: Initialize CodeQL + if: ${{ inputs.run-codeql }} + uses: github/codeql-action/init@v3 + with: + languages: "cpp" + - name: Setup and Build Simulated Device + run: | + BUILD_TYPE=simulated + GN_ARGS='chip_tests_zap_config="app1" chip_project_config_include_dirs=["../../examples/placeholder/linux/apps/app1/include", "../../config/standalone"] chip_config_network_layer_ble=false' + CHIP_ROOT_PATH=examples/placeholder/linux + CHIP_ROOT_PATH="$CHIP_ROOT_PATH" BUILD_TYPE="$BUILD_TYPE" scripts/build/gn_gen.sh --args="$GN_ARGS" + scripts/run_in_build_env.sh "ninja -C ./out/$BUILD_TYPE" + - name: Setup Build, Run Build and Run Tests + run: | + BUILD_TYPE=gcc_release scripts/build/gn_gen.sh --args="is_debug=false chip_data_model_check_die_on_failure=true" + scripts/run_in_build_env.sh "ninja -C ./out/gcc_release" + BUILD_TYPE=gcc_release scripts/tests/gn_tests.sh + - name: Clean output + run: rm -rf ./out + - name: Run Tests with sanitizers + env: + LSAN_OPTIONS: detect_leaks=1 + run: | + for BUILD_TYPE in asan tsan ubsan; do + case $BUILD_TYPE in + "asan") GN_ARGS='is_clang=true is_asan=true';; + "msan") GN_ARGS='is_clang=true is_msan=true';; + "tsan") GN_ARGS='is_clang=true is_tsan=true chip_enable_wifi=false';; + "ubsan") GN_ARGS='is_clang=true is_ubsan=true';; + esac + + rm -rf ./out/sanitizers + BUILD_TYPE=sanitizers scripts/build/gn_gen.sh --args="$GN_ARGS chip_data_model_check_die_on_failure=true" --export-compile-commands + BUILD_TYPE=sanitizers scripts/tests/gn_tests.sh + done + - name: Ensure codegen is done for sanitize + run: | + ./scripts/run_in_build_env.sh "./scripts/run_codegen_targets.sh out/sanitizers" + - name: Clang-tidy validation + # NOTE: clang-tidy crashes on CodegenDataModel_Write due to Nullable/std::optional check. + # See https://github.com/llvm/llvm-project/issues/97426 + run: | + ./scripts/run_in_build_env.sh \ + "./scripts/run-clang-tidy-on-compile-commands.py \ + --compile-database out/sanitizers/compile_commands.json \ + --file-exclude-regex '/(repo|zzz_generated|lwip/standalone)/|-ReadImpl|-InvokeSubscribeImpl|CodegenDataModel_Write|QuieterReporting' \ + check \ + " + - name: Clean output + run: rm -rf ./out + - name: Build using build_examples.py + run: | + ./scripts/run_in_build_env.sh \ + "./scripts/build/build_examples.py \ + --target linux-x64-minmdns-ipv6only-clang \ + --target linux-x64-rpc-console \ + build \ + " + - name: Create a pre-generate directory and ensure compile-time codegen would fail + run: | + ./scripts/run_in_build_env.sh "./scripts/codepregen.py ./zzz_pregenerated" + mv scripts/codegen.py scripts/codegen.py.renamed + mv scripts/tools/zap/generate.py scripts/tools/zap/generate.py.renamed + - name: Clean output + run: rm -rf ./out + - name: Build using build_examples.py (pregen) + run: | + ./scripts/run_in_build_env.sh \ + "./scripts/build/build_examples.py \ + --target linux-x64-all-clusters-ipv6only-clang \ + --target linux-x64-chip-tool-ipv6only-clang \ + --pregen-dir ./zzz_pregenerated \ + build \ + " + - name: Undo code pre-generation changes (make compile time codegen work again) + run: | + rm -rf ./zzz_pregenerated + mv scripts/codegen.py.renamed scripts/codegen.py + mv scripts/tools/zap/generate.py.renamed scripts/tools/zap/generate.py + - name: Run fake linux tests with build_examples + run: | + ./scripts/run_in_build_env.sh \ + "./scripts/build/build_examples.py --target linux-fake-tests build" + - name: Perform CodeQL Analysis + if: ${{ inputs.run-codeql }} + uses: ./.github/actions/perform-codeql-analysis + with: + language: cpp + + - name: Uploading core files + uses: actions/upload-artifact@v4 + if: ${{ failure() && !env.ACT }} + with: + name: crash-core-linux + path: /tmp/cores/ + # Cores are big; don't hold on to them too long. + retention-days: 5 + # OBJDIR on linux is > 10K files and takes more than 50 minutes to upload, usually + # having the job timeout. + # + # If re-enabling, some subset of this should be picked + # + # - name: Uploading objdir for debugging + # uses: actions/upload-artifact@v4 + # if: ${{ failure() && !env.ACT }} + # with: + # name: crash-objdir-linux + # path: out/ + # # objdirs are big; don't hold on to them too long. + # retention-days: 5 + + build_linux_python_lib: + name: Build on Linux (python_lib) + + runs-on: ubuntu-latest + if: github.actor != 'restyled-io[bot]' + + container: + image: ghcr.io/project-chip/chip-build:74 + volumes: + - "/:/runner-root-volume" + - "/tmp/log_output:/tmp/test_logs" + options: --sysctl "net.ipv6.conf.all.disable_ipv6=0 + net.ipv4.conf.all.forwarding=1 net.ipv6.conf.all.forwarding=1" + + steps: + - name: Dump GitHub context + env: + GITHUB_CONTEXT: ${{ toJSON(github) }} + run: echo "$GITHUB_CONTEXT" + - name: Dump Concurrency context + env: + CONCURRENCY_CONTEXT: ${{ github.ref }}-${{ github.workflow }}-${{ (github.event_name == 'pull_request' && github.event.number) || (github.event_name == 'workflow_dispatch' && github.run_number) || github.sha }} + run: echo "$CONCURRENCY_CONTEXT" + - name: Checkout + uses: actions/checkout@v4 + - name: Checkout submodules & Bootstrap + uses: ./.github/actions/checkout-submodules-and-bootstrap + with: + platform: linux + + - name: Setup Build, Run Build and Run Tests + run: | + scripts/build/gn_gen.sh --args="enable_rtti=true chip_config_memory_debug_checks=false chip_config_memory_debug_dmalloc=false chip_generate_link_map_file=false chip_data_model_check_die_on_failure=true" + scripts/run_in_build_env.sh "ninja -C ./out" + scripts/tests/gn_tests.sh + - name: Setup test python environment + shell: bash + run: | + scripts/run_in_build_env.sh 'virtualenv pyenv' + source pyenv/bin/activate + python -m ensurepip --upgrade + python -m pip install ./out/controller/python/chip_core-0.0-cp37-abi3-linux_x86_64.whl + python -m pip install ./out/controller/python/chip_clusters-0.0-py3-none-any.whl + python -m pip install ./out/controller/python/chip_repl-0.0-py3-none-any.whl + + - name: Run Python tests + shell: bash + run: | + source pyenv/bin/activate + cd src/controller/python/test/unit_tests/ + python3 -m unittest -v + - name: Clean previous outputs + run: rm -rf out pyenv + - name: Run Python Setup Payload Generator Test + shell: bash + run: | + scripts/run_in_build_env.sh 'scripts/examples/gn_build_example.sh examples/chip-tool out/' + scripts/run_in_build_env.sh 'virtualenv pyenv' + source pyenv/bin/activate + python -m ensurepip --upgrade + python -m pip install -r scripts/setup/requirements.setuppayload.txt + python3 src/setup_payload/tests/run_python_setup_payload_test.py out/chip-tool + + build_linux_python_lighting_device: + name: Build on Linux (python lighting-app) + + runs-on: ubuntu-latest + if: github.actor != 'restyled-io[bot]' + + container: + image: ghcr.io/project-chip/chip-build:74 + volumes: + - "/:/runner-root-volume" + - "/tmp/log_output:/tmp/test_logs" + options: --sysctl "net.ipv6.conf.all.disable_ipv6=0 + net.ipv4.conf.all.forwarding=1 net.ipv6.conf.all.forwarding=1" + + steps: + - name: Dump GitHub context + env: + GITHUB_CONTEXT: ${{ toJSON(github) }} + run: echo "$GITHUB_CONTEXT" + - name: Dump Concurrency context + env: + CONCURRENCY_CONTEXT: ${{ github.ref }}-${{ github.workflow }}-${{ (github.event_name == 'pull_request' && github.event.number) || (github.event_name == 'workflow_dispatch' && github.run_number) || github.sha }} + run: echo "$CONCURRENCY_CONTEXT" + - name: Checkout + uses: actions/checkout@v4 + - name: Checkout submodules & Bootstrap + uses: ./.github/actions/checkout-submodules-and-bootstrap + with: + platform: linux + + - name: Setup Build + run: | + scripts/build_python_device.sh --chip_detail_logging true + + build_darwin: + name: Build on Darwin (clang, python_lib, simulated) + runs-on: macos-13 + if: github.actor != 'restyled-io[bot]' + + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Checkout submodules & Bootstrap + uses: ./.github/actions/checkout-submodules-and-bootstrap + with: + platform: darwin + - name: Try to ensure the directory for diagnostic log collection exists + run: | + mkdir -p ~/Library/Logs/DiagnosticReports || true + - name: Initialize CodeQL + if: ${{ inputs.run-codeql }} + uses: github/codeql-action/init@v3 + with: + languages: "cpp" + + - name: Setup and Build Simulated Device + run: | + BUILD_TYPE=simulated + GN_ARGS='chip_tests_zap_config="app1" chip_project_config_include_dirs=["../../examples/placeholder/linux/apps/app1/include", "../../config/standalone"] chip_config_network_layer_ble=false' + CHIP_ROOT_PATH=examples/placeholder/linux + CHIP_ROOT_PATH="$CHIP_ROOT_PATH" BUILD_TYPE="$BUILD_TYPE" scripts/build/gn_gen.sh --args="$GN_ARGS" + scripts/run_in_build_env.sh "ninja -C ./out/$BUILD_TYPE" + - name: Setup Build, Run Build and Run Tests + # We can't enable leak checking here in LSAN_OPTIONS, because on + # Darwin that's only supported with a new enough clang, and we're + # not building with the pigweed clang here. + run: | + for BUILD_TYPE in default python_lib; do + case $BUILD_TYPE in + # We want to build various standalone example apps + # (similar to what examples-linux-standalone.yaml + # does), so use target_os="all" to get those picked + # up as part of the "unified" build. But then to + # save CI resources we want to exclude the + # "host clang" build, which uses the pigweed + # clang. + "default") GN_ARGS='target_os="all" is_asan=true enable_host_clang_build=false';; + esac + BUILD_TYPE=$BUILD_TYPE scripts/build/gn_gen.sh --args="$GN_ARGS chip_data_model_check_die_on_failure=true" --export-compile-commands + scripts/run_in_build_env.sh "ninja -C ./out/$BUILD_TYPE" + BUILD_TYPE=$BUILD_TYPE scripts/tests/gn_tests.sh + done + - name: Ensure codegen is done for sanitize + run: | + ./scripts/run_in_build_env.sh "./scripts/run_codegen_targets.sh out/default" + - name: Clang-tidy validation + # NOTE: clang-tidy crashes on CodegenDataModel_Write due to Nullable/std::optional check. + # See https://github.com/llvm/llvm-project/issues/97426 + run: | + ./scripts/run_in_build_env.sh \ + "./scripts/run-clang-tidy-on-compile-commands.py \ + --compile-database out/default/compile_commands.json \ + --file-exclude-regex '/(repo|zzz_generated|lwip/standalone)/|CodegenDataModel_Write|QuieterReporting' \ + check \ + " + - name: Uploading diagnostic logs + uses: actions/upload-artifact@v4 + if: ${{ failure() && !env.ACT }} + with: + name: crash-log-darwin + path: ~/Library/Logs/DiagnosticReports/ + + - name: Perform CodeQL Analysis + if: ${{ inputs.run-codeql }} + uses: ./.github/actions/perform-codeql-analysis + with: + language: cpp + + # TODO Log Upload https://github.com/project-chip/connectedhomeip/issues/2227 + # TODO https://github.com/project-chip/connectedhomeip/issues/1512 + + build_linux_gcc_coverage: + name: Build on Linux (coverage) + + runs-on: ubuntu-latest + if: github.actor != 'restyled-io[bot]' + + container: + image: ghcr.io/project-chip/chip-build:74 + volumes: + - "/:/runner-root-volume" + - "/tmp/log_output:/tmp/test_logs" + options: --privileged --sysctl "net.ipv6.conf.all.disable_ipv6=0 + net.ipv4.conf.all.forwarding=1 net.ipv6.conf.all.forwarding=1" + + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Checkout submodules & Bootstrap + uses: ./.github/actions/checkout-submodules-and-bootstrap + with: + platform: linux + + - name: Run Build Coverage + run: ./scripts/build_coverage.sh diff --git a/.github/workflows/buildjet-cache-delete.yaml b/.github/workflows/buildjet-cache-delete.yaml new file mode 100644 index 0000000000..f5c4e0668b --- /dev/null +++ b/.github/workflows/buildjet-cache-delete.yaml @@ -0,0 +1,17 @@ +name: Manually Delete BuildJet Cache +on: + workflow_dispatch: + inputs: + cache_key: + description: 'BuildJet Cache Key to Delete' + required: true + type: string +jobs: + manually-delete-buildjet-cache: + runs-on: buildjet-2vcpu-ubuntu-2204 + steps: + - name: Checkout + uses: actions/checkout@v4 + - uses: buildjet/cache-delete@v1 + with: + cache_key: ${{ inputs.cache_key }} \ No newline at end of file diff --git a/.github/workflows/cert_test_checks.yaml b/.github/workflows/cert_test_checks.yaml new file mode 100644 index 0000000000..44d545a663 --- /dev/null +++ b/.github/workflows/cert_test_checks.yaml @@ -0,0 +1,35 @@ +# Copyright (c) 2024 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: Certification test checks + +on: + pull_request: + paths: + - "src/app/tests/suites/certification/**" + +jobs: + check-certification-tests: + name: Check for common problems in certification tests + runs-on: ubuntu-latest + + container: + image: ghcr.io/project-chip/chip-build + + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Run checks + run: | + python3 scripts/tests/matter_yaml_linter.py diff --git a/.github/workflows/check-data-model-directory-updates.yaml b/.github/workflows/check-data-model-directory-updates.yaml new file mode 100644 index 0000000000..305da81d9d --- /dev/null +++ b/.github/workflows/check-data-model-directory-updates.yaml @@ -0,0 +1,31 @@ +# Copyright (c) 2024 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: Check for changes to data_model directory without a sha update + +on: + pull_request: + paths: + - "data_model/**" + +jobs: + check-submodule-update-label: + name: Check for changes to data_model directory without a sha update + runs-on: ubuntu-latest + if: "git diff --name-only HEAD^..HEAD data_model/ | grep -q spec_sha" + steps: + - name: Error Message + run: echo This pull request attempts to update data_model directory, but is missing updates to spec_sha file with the latest version of the sha. Files in the data_model directory are generated automatically and should not be updated manually. + - name: Fail Job + run: exit 1 diff --git a/.github/workflows/chef.yaml b/.github/workflows/chef.yaml new file mode 100644 index 0000000000..642cdb6cf8 --- /dev/null +++ b/.github/workflows/chef.yaml @@ -0,0 +1,117 @@ +# Copyright (c) 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: Build Chef CI examples on all platforms + +on: + push: + branches-ignore: + - 'dependabot/**' + pull_request: + merge_group: + +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: + chef_linux: + name: Chef - Linux CI Examples + runs-on: ubuntu-latest + if: github.actor != 'restyled-io[bot]' + + container: + image: ghcr.io/project-chip/chip-build:74 + options: --user root + + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Checkout submodules & Bootstrap + uses: ./.github/actions/checkout-submodules-and-bootstrap + with: + platform: linux + - name: CI Examples Linux + shell: bash + run: | + ./scripts/run_in_build_env.sh "./examples/chef/chef.py --ci -t linux" + + chef_esp32: + name: Chef - ESP32 CI Examples + runs-on: ubuntu-latest + if: github.actor != 'restyled-io[bot]' + + container: + image: ghcr.io/project-chip/chip-build-esp32:74 + options: --user root + + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Checkout submodules + uses: ./.github/actions/checkout-submodules-and-bootstrap + with: + platform: esp32 + - name: CI Examples ESP32 + shell: bash + run: | + ./scripts/run_in_build_env.sh "./examples/chef/chef.py --ci -t esp32" + + chef_nrfconnect: + name: Chef - NRFConnect CI Examples + runs-on: ubuntu-latest + if: github.actor != 'restyled-io[bot]' + + container: + image: ghcr.io/project-chip/chip-build-nrf-platform:74 + options: --user root + + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Checkout submodules & Bootstrap + uses: ./.github/actions/checkout-submodules-and-bootstrap + with: + platform: nrfconnect + - name: CI Examples NRFConnect + shell: bash + run: | + ./scripts/run_in_build_env.sh "./examples/chef/chef.py --ci -t nrfconnect" + + chef_telink: + name: Chef - Telink CI Examples + runs-on: ubuntu-latest + if: github.actor != 'restyled-io[bot]' + + container: + image: ghcr.io/project-chip/chip-build-telink:74 + options: --user root + + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Checkout submodules & Bootstrap + uses: ./.github/actions/checkout-submodules-and-bootstrap + with: + platform: telink + # - name: Update Zephyr to specific revision (for developers purpose) + # shell: bash + # run: scripts/run_in_build_env.sh "python3 scripts/tools/telink/update_zephyr.py ab81a585fca6a83b30e1f4e58a021113d6a3acb8" + - name: CI Examples Telink + shell: bash + run: | + ./scripts/run_in_build_env.sh "./examples/chef/chef.py --ci -t telink" diff --git a/.github/workflows/cherry-picks.yaml b/.github/workflows/cherry-picks.yaml new file mode 100644 index 0000000000..a062aa5fcf --- /dev/null +++ b/.github/workflows/cherry-picks.yaml @@ -0,0 +1,37 @@ +name: Cherry-Pick Merges + +on: + pull_request_target: + branches: + - master + types: ["closed"] + +jobs: + cherry_pick_release_v1_0: + runs-on: ubuntu-latest + name: Cherry-Pick into SVE + if: | + (github.event.pull_request.merged == true) + && ( + (contains(github.event.pull_request.labels.*.name, 'sve')) + || (contains(github.event.pull_request.labels.*.name, 'request sve')) + || (contains(github.event.pull_request.labels.*.name, 'cert blocker')) + ) + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Cherry-Pick into sve branch + uses: carloscastrojumo/github-cherry-pick-action@v1.0.9 + with: + token: ${{ secrets.MATTER_PAT }} + branch: 1.3-sve + labels: | + sve cherry pick + reviewers: | + woody-apple + andy31415 + raju-apple +env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/cirque.yaml b/.github/workflows/cirque.yaml new file mode 100644 index 0000000000..6fe17c3558 --- /dev/null +++ b/.github/workflows/cirque.yaml @@ -0,0 +1,136 @@ +# Copyright (c) 2020-2023 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: Cirque + +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: + cirque: + name: Cirque + + env: + GITHUB_CACHE_PATH: /tmp/cirque-cache + + runs-on: ubuntu-latest + if: github.actor != 'restyled-io[bot]' + + # need to run with privilege, which isn't supported by job.XXX.contaner + # https://github.com/actions/container-action/issues/2 + # container: + # image: ghcr.io/project-chip/chip-build-cirque: + # volumes: + # - "/tmp:/tmp" + # - "/dev/pts:/dev/pts" + # env: + # LOG_DIR: /tmp/cirque_test_output/ + # CLEANUP_DOCKER_FOR_CI: 1 + # options: "--privileged" + + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Checkout submodules + uses: ./.github/actions/checkout-submodules + with: + platform: linux + + # TODO: Is what's being cached here actually compatible with a regular bootstrap? + - name: Bootstrap Cache + uses: ./.github/actions/bootstrap-cache + - name: Bootstrap Cirque + run: | + integrations/docker/images/stage-2/chip-build-cirque/run.sh \ + -- sh -c " \ + git config --global --add safe.directory '*' \ + && bash scripts/bootstrap.sh \ + && chown -R $(id -u):$(id -g) .environment \ + " + + - name: Get Cirque Bootstrap cache key + id: cirque-bootstrap-cache-key + run: echo "val=$(scripts/tests/cirque_tests.sh cachekeyhash)" >> $GITHUB_OUTPUT + - uses: Wandalen/wretry.action@v1.4.10 + name: Cirque Bootstrap cache + if: ${{ !env.ACT }} + continue-on-error: true + timeout-minutes: 10 + with: + action: buildjet/cache@v3 + attempt_limit: 3 + attempt_delay: 2000 + with: | + key: ${{ runner.os }}-cirque-${{ steps.cirque-bootstrap-cache-key.outputs.val }} + restore-keys: ${{ runner.os }}-cirque- + path: ${{ env.GITHUB_CACHE_PATH }} + - name: Cirque Bootstrap + run: | + integrations/docker/images/stage-2/chip-build-cirque/run.sh \ + --env GITHUB_ACTION_RUN=1 \ + --env GITHUB_CACHE_PATH=${{ env.GITHUB_CACHE_PATH }} \ + --volume /tmp:/tmp \ + -- sh -c " \ + git config --global --add safe.directory '*' \ + && scripts/tests/cirque_tests.sh bootstrap \ + " + + - name: Artifact suffix + id: outsuffix + uses: haya14busa/action-cond@v1 + if: ${{ !env.ACT }} + with: + cond: ${{ github.event.pull_request.number == '' }} + if_true: "${{ github.sha }}" + if_false: "pull-${{ github.event.pull_request.number }}" + - name: Build Binaries + run: | + integrations/docker/images/stage-2/chip-build-cirque/run.sh \ + -- sh -c " \ + git config --global --add safe.directory '*' \ + && scripts/build/gn_gen_cirque.sh \ + " + - name: Run Tests + run: | + integrations/docker/images/stage-2/chip-build-cirque/run.sh \ + --env LOG_DIR=/tmp/cirque_test_output \ + --env CLEANUP_DOCKER_FOR_CI=1 \ + --env GITHUB_ACTION_RUN=1 \ + --privileged \ + --volume /tmp:/tmp \ + --volume /dev/pts:/dev/pts \ + -- sh -c " \ + git config --global --add safe.directory '*' \ + && scripts/tests/cirque_tests.sh run_all_tests \ + " + + + - name: Uploading Binaries + uses: actions/upload-artifact@v4 + if: ${{ always() && !env.ACT }} + with: + name: cirque_log-${{steps.outsuffix.outputs.value}}-logs + path: /tmp/cirque_test_output/ diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml new file mode 100644 index 0000000000..6b15039778 --- /dev/null +++ b/.github/workflows/codeql.yml @@ -0,0 +1,29 @@ +# Copyright (c) 2020-2023 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: "CodeQL" + +on: + workflow_dispatch: +# push: +# branches: [ "master", "sve*", "test_event_*", "v1.*" ] +# pull_request: + schedule: + - cron: '0 5 * * *' + +jobs: + analyze: + uses: project-chip/connectedhomeip/.github/workflows/build.yaml@master + with: + run-codeql: true + diff --git a/.github/workflows/darwin-tests.yaml b/.github/workflows/darwin-tests.yaml new file mode 100644 index 0000000000..815293204b --- /dev/null +++ b/.github/workflows/darwin-tests.yaml @@ -0,0 +1,161 @@ +# Copyright (c) 2022 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 Tests + +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: + test_suites_chip_tool_darwin: + name: Test Suites - Darwin + + strategy: + matrix: + build_variant: [no-ble-asan-clang] + env: + BUILD_VARIANT: ${{matrix.build_variant}} + + # We can't use the pigweed clang to build the Darwin framework once we start using + # Swift, because it does not handle CLANG_ENABLE_MODULES correctly. + # + # But the Xcode clang does not handle LSan correctly. Since we can't easily apply + # LSAN_OPTIONS to just everything except darwin-framework-tool, instead disable asan for + # it. + BUILD_VARIANT_FRAMEWORK_TOOL: no-ble + LSAN_OPTIONS: detect_leaks=1 malloc_context_size=40 suppressions=scripts/tests/chiptest/lsan-mac-suppressions.txt + + if: github.actor != 'restyled-io[bot]' + runs-on: macos-13 + + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Setup Environment + # coreutils for stdbuf + run: brew install coreutils + - name: + Try to ensure the directories for core dumping and diagnostic + log collection exist and we can write them. + run: | + sudo chown ${USER} /cores || true + mkdir -p ~/Library/Logs/DiagnosticReports || true + mkdir objdir-clone || true + - name: Checkout submodules & Bootstrap + uses: ./.github/actions/checkout-submodules-and-bootstrap + with: + platform: darwin + bootstrap-log-name: bootstrap-logs-darwin-${{ matrix.build_variant }} + + - name: Run macOS Darwin Framework Tool Build Debug + working-directory: src/darwin/Framework + run: xcodebuild -target "darwin-framework-tool" -sdk macosx -configuration Debug + - name: Delete Defaults + run: defaults delete com.apple.dt.xctest.tool + continue-on-error: true + - name: Clean Build + run: xcodebuild clean + working-directory: src/darwin/Framework + - name: Build Apps + run: | + ./scripts/run_in_build_env.sh \ + "./scripts/build/build_examples.py \ + --target darwin-x64-darwin-framework-tool-${BUILD_VARIANT_FRAMEWORK_TOOL} \ + --target darwin-x64-all-clusters-${BUILD_VARIANT} \ + --target darwin-x64-lock-${BUILD_VARIANT} \ + --target darwin-x64-ota-provider-${BUILD_VARIANT} \ + --target darwin-x64-ota-requestor-${BUILD_VARIANT} \ + --target darwin-x64-tv-app-${BUILD_VARIANT} \ + --target darwin-x64-bridge-${BUILD_VARIANT} \ + --target darwin-x64-lit-icd-${BUILD_VARIANT} \ + --target darwin-x64-microwave-oven-${BUILD_VARIANT} \ + --target darwin-x64-rvc-${BUILD_VARIANT} \ + --target darwin-x64-network-manager-${BUILD_VARIANT} \ + build \ + --copy-artifacts-to objdir-clone \ + " + - name: Run Tests + run: | + ./scripts/run_in_build_env.sh \ + "./scripts/tests/run_test_suite.py \ + --runner darwin_framework_tool_python \ + --chip-tool ./out/darwin-x64-darwin-framework-tool-${BUILD_VARIANT_FRAMEWORK_TOOL}/darwin-framework-tool \ + --target-skip-glob '{TestAccessControlConstraints}' \ + run \ + --iterations 1 \ + --test-timeout-seconds 120 \ + --all-clusters-app ./out/darwin-x64-all-clusters-${BUILD_VARIANT}/chip-all-clusters-app \ + --lock-app ./out/darwin-x64-lock-${BUILD_VARIANT}/chip-lock-app \ + --ota-provider-app ./out/darwin-x64-ota-provider-${BUILD_VARIANT}/chip-ota-provider-app \ + --ota-requestor-app ./out/darwin-x64-ota-requestor-${BUILD_VARIANT}/chip-ota-requestor-app \ + --tv-app ./out/darwin-x64-tv-app-${BUILD_VARIANT}/chip-tv-app \ + --bridge-app ./out/darwin-x64-bridge-${BUILD_VARIANT}/chip-bridge-app \ + --microwave-oven-app ./out/darwin-x64-microwave-oven-${BUILD_VARIANT}/chip-microwave-oven-app \ + --rvc-app ./out/darwin-x64-rvc-${BUILD_VARIANT}/chip-rvc-app \ + --network-manager-app ./out/darwin-x64-network-manager-${BUILD_VARIANT}/matter-network-manager-app \ + " + - name: Run OTA Test + run: | + ./scripts/run_in_build_env.sh \ + "./scripts/tests/run_darwin_framework_ota_test.py \ + run \ + --darwin-framework-tool ./out/darwin-x64-darwin-framework-tool-${BUILD_VARIANT_FRAMEWORK_TOOL}/darwin-framework-tool \ + --ota-requestor-app ./out/darwin-x64-ota-requestor-${BUILD_VARIANT}/chip-ota-requestor-app \ + --ota-data-file /tmp/rawImage \ + --ota-image-file /tmp/otaImage \ + --ota-destination-file /tmp/downloadedImage \ + --ota-candidate-file /tmp/otaCandidateJSON \ + " + - name: Uploading core files + uses: actions/upload-artifact@v4 + if: ${{ failure() && !env.ACT }} + with: + name: crash-core-darwin-${{ matrix.build_variant }} + path: /cores/ + # Cores are big; don't hold on to them too long. + retention-days: 5 + - name: Uploading diagnostic logs + uses: actions/upload-artifact@v4 + if: ${{ failure() && !env.ACT }} + with: + name: crash-log-darwin-${{ matrix.build_variant }} + path: ~/Library/Logs/DiagnosticReports/ + - name: Uploading framework build log + uses: actions/upload-artifact@v4 + if: ${{ failure() && !env.ACT }} + with: + name: framework-build-log-darwin-${BUILD_VARIANT_FRAMEWORK_TOOL} + path: out/darwin-x64-darwin-framework-tool-${BUILD_VARIANT_FRAMEWORK_TOOL}/darwin_framework_build.log + - name: Uploading objdir for debugging + uses: actions/upload-artifact@v4 + if: ${{ failure() && !env.ACT }} + with: + name: crash-objdir-darwin-${{ matrix.build_variant }} + path: objdir-clone/ + # objdirs are big; don't hold on to them too long. + retention-days: 5 diff --git a/.github/workflows/darwin.yaml b/.github/workflows/darwin.yaml new file mode 100644 index 0000000000..9eeac9118e --- /dev/null +++ b/.github/workflows/darwin.yaml @@ -0,0 +1,134 @@ +# 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 + # 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 + 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 diff --git a/.github/workflows/docbuild.yaml b/.github/workflows/docbuild.yaml new file mode 100644 index 0000000000..2d28a2a537 --- /dev/null +++ b/.github/workflows/docbuild.yaml @@ -0,0 +1,54 @@ +name: Documentation Build + +on: + pull_request: + types: [opened, synchronize, reopened] + branches: + - master + paths: + - '.github/workflows/docbuild.yaml' + - '**.md' + - 'docs/**' + push: + branches: + - master + +permissions: + contents: write + +jobs: + build-and-publish: + runs-on: ubuntu-latest + + steps: + - name: Checkout the code + uses: actions/checkout@v4 + with: + path: matter + fetch-depth: 0 + - name: Install Python + uses: actions/setup-python@v5 + with: + python-version: 3.8 + cache-dependency-path: matter/docs/requirements.txt + cache: pip + - name: Install base dependencies + working-directory: matter + run: | + sudo pip3 install -U pip + pip3 install -r docs/requirements.txt + - name: Build documentation + working-directory: matter/docs + run: | + mkdir -p _build/src + make html + touch _build/html/.nojekyll + - name: Deploy to gh-pages + if: github.repository == 'project-chip/connectedhomeip' && github.event_name == 'push' && github.ref_name == 'master' + uses: peaceiris/actions-gh-pages@v3 + with: + deploy_key: ${{ secrets.DOXYGEN_DEPLOY_KEY }} + external_repository: project-chip/connectedhomeip-doc + publish_dir: matter/docs/_build/html + # Keep only the latest version of the documentation + force_orphan: true diff --git a/.github/workflows/docker_img.yaml b/.github/workflows/docker_img.yaml new file mode 100644 index 0000000000..05594606a6 --- /dev/null +++ b/.github/workflows/docker_img.yaml @@ -0,0 +1,171 @@ +# 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: Docker CHIP images + +on: + workflow_call: + inputs: + push_images: + required: false + type: boolean + default: false + push: + paths: + - "integrations/docker/**" + pull_request: + paths: + - "integrations/docker/**" + workflow_dispatch: + inputs: + push_images: + required: false + type: boolean + default: false + +jobs: + build_images_base: + name: Build Docker CHIP Build images - base + runs-on: ubuntu-latest + if: github.actor != 'restyled-io[bot]' + strategy: + fail-fast: false + matrix: + img: + - "" + - "-minimal" + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Build & Push images using project bash script + if: ${{ inputs.push_images == true }} + run: | + cd integrations/docker/images/base/chip-build${{ matrix.img }} + ./build.sh --latest --push + - name: Build images using project bash script + if: ${{ inputs.push_images == false }} + run: | + cd integrations/docker/images/base/chip-build${{ matrix.img }} + ./build.sh --latest + build_images_stage_1: + needs: [build_images_base] + name: Build Docker CHIP Build images - stage 1 + runs-on: ubuntu-latest + if: github.actor != 'restyled-io[bot]' + strategy: + fail-fast: false + matrix: + img: + - "-crosscompile" + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Build & Push images using project bash script + if: ${{ inputs.push_images == true }} + run: | + cd integrations/docker/images/stage-1/chip-build${{ matrix.img }} + ./build.sh --latest --push + - name: Build images using project bash script + if: ${{ inputs.push_images == false }} + run: | + cd integrations/docker/images/stage-1/chip-build${{ matrix.img }} + ./build.sh --latest + build_images_stage_2: + needs: [build_images_base, build_images_stage_1] + name: Build Docker CHIP Build images - stage 2 + runs-on: ubuntu-latest + if: github.actor != 'restyled-io[bot]' + strategy: + fail-fast: false + matrix: + img: + - "-ameba" + - "-asr" + - "-bouffalolab" + - "-doxygen" + - "-efr32" + - "-esp32" + - "-infineon" + # NOTE: imx image requires too much space for GitHub-hosted runners. It fails with: + # ApplyLayer exit status 1 stdout: stderr: write /opt/fsl-imx-xwayland/5.15-kirkstone/sysroots/armv8a-poky-linux/opt/ltp/testcases/bin/fanotify15: no space left on device + # - "-imx" + - "-java" + - "-k32w" + - "-nrf-platform" + - "-telink" + - "-ti" + - "-tizen" + - "-openiotsdk" + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Build & Push images using project bash script + if: ${{ inputs.push_images == true }} + run: | + cd integrations/docker/images/stage-2/chip-build${{ matrix.img }} + ./build.sh --latest --push + - name: Build images using project bash script + if: ${{ inputs.push_images == false }} + run: | + cd integrations/docker/images/stage-2/chip-build${{ matrix.img }} + ./build.sh --latest + + build_images_stage_3: + needs: [build_images_base, build_images_stage_1, build_images_stage_2] + name: Build Docker CHIP Build images - stage 3 + runs-on: ubuntu-latest + if: github.actor != 'restyled-io[bot]' + strategy: + fail-fast: false + matrix: + img: + - "-android" + - "-esp32-qemu" + - "-tizen-qemu" + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Build & Push images using project bash script + if: ${{ inputs.push_images == true }} + run: | + cd integrations/docker/images/stage-3/chip-build${{ matrix.img }} + ./build.sh --latest --push + - name: Build images using project bash script + if: ${{ inputs.push_images == false }} + run: | + cd integrations/docker/images/stage-3/chip-build${{ matrix.img }} + ./build.sh --latest + build_images_vscode: + needs: [build_images_base, build_images_stage_1, build_images_stage_2, build_images_stage_3] + name: Build Docker CHIP Build images - vscode + runs-on: ubuntu-latest + if: github.actor != 'restyled-io[bot]' && false + strategy: + fail-fast: false + matrix: + img: + - "-vscode" + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Build & Push images using project bash script + if: ${{ inputs.push_images == true }} + run: | + cd integrations/docker/images/vscode/chip-build${{ matrix.img }} + ./build.sh --latest --push + - name: Build images using project bash script + if: ${{ inputs.push_images == false }} + run: | + cd integrations/docker/images/vscode-3/chip-build${{ matrix.img }} + ./build.sh --latest diff --git a/.github/workflows/doxygen.yaml b/.github/workflows/doxygen.yaml new file mode 100644 index 0000000000..d29b620c37 --- /dev/null +++ b/.github/workflows/doxygen.yaml @@ -0,0 +1,107 @@ +# Copyright (c) 2020 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: Doxygen + +on: + push: + paths: + - "**.do[xc]" + - "**.c[cs]?" + - "**.cxx" + - "**.cpp" + - "**.c\\+\\+" + - "**.ii" + - "**.ixx" + - "**.ipp" + - "**.i\\+\\+" + - "**.inl" + - "**.[hH]" + - "**.hh" + - "**.HH" + - "**.hxx" + - "**.hpp" + - "**.h\\+\\+" + - "**.mm" + - "**.txt" + - "**.[ido]dl" + - "**.java" + - "**.d" + - "**.php[45]?" + - "**.inc" + - "**.phtml" + - "**.[mM]" + pull_request: + paths: + - "**.do[xc]" + - "**.c[cs]?" + - "**.cxx" + - "**.cpp" + - "**.c\\+\\+" + - "**.ii" + - "**.ixx" + - "**.ipp" + - "**.i\\+\\+" + - "**.inl" + - "**.[hH]" + - "**.hh" + - "**.HH" + - "**.hxx" + - "**.hpp" + - "**.h\\+\\+" + - "**.mm" + - "**.txt" + - "**.[ido]dl" + - "**.java" + - "**.d" + - "**.php[45]?" + - "**.inc" + - "**.phtml" + - "**.[mM]" + 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: + doxygen: + name: Build Doxygen + + runs-on: ubuntu-latest + container: + image: ghcr.io/project-chip/chip-build-doxygen:74 + + if: github.actor != 'restyled-io[bot]' + + steps: + - name: "Print Actor" + run: echo ${{github.actor}} + - name: Checkout + uses: actions/checkout@v4 + - name: Generate + run: scripts/helpers/doxygen.sh + - name: Extract branch name + shell: bash + run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF##*/})" + id: extract_branch + - name: Deploy if master + if: steps.extract_branch.outputs.branch == 'master' && github.repository == 'project-chip/connectedhomeip' + uses: peaceiris/actions-gh-pages@v3 + with: + deploy_key: ${{ secrets.DOXYGEN_DEPLOY_KEY }} + external_repository: project-chip/connectedhomeip-doc + publish_dir: ./docs/html + # Keep only the latest version of the documentation + force_orphan: true diff --git a/.github/workflows/example-tv-casting-darwin.yaml b/.github/workflows/example-tv-casting-darwin.yaml new file mode 100644 index 0000000000..d9d9ef8f37 --- /dev/null +++ b/.github/workflows/example-tv-casting-darwin.yaml @@ -0,0 +1,49 @@ +# 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: TV Casting Example - 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: + tv-casting-bridge: + name: Build TV Casting Bridge example + if: github.actor != 'restyled-io[bot]' + runs-on: macos-13 + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Checkout submodules & Bootstrap + uses: ./.github/actions/checkout-submodules-and-bootstrap + with: + platform: darwin + - name: Build + working-directory: examples/tv-casting-app/darwin/MatterTvCastingBridge + run: xcodebuild -target "MatterTvCastingBridge" -sdk iphoneos diff --git a/.github/workflows/examples-ameba.yaml b/.github/workflows/examples-ameba.yaml new file mode 100644 index 0000000000..62a3bf5511 --- /dev/null +++ b/.github/workflows/examples-ameba.yaml @@ -0,0 +1,60 @@ +# Copyright (c) 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: Build example - Ameba + +on: + push: + branches-ignore: + - 'dependabot/**' + pull_request: + merge_group: + +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: + ameba: + name: Ameba + env: + BUILD_TYPE: ameba + + runs-on: ubuntu-latest + if: github.actor != 'restyled-io[bot]' + + container: + image: ghcr.io/project-chip/chip-build-ameba:74 + options: --user root + + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Checkout submodules & Bootstrap + uses: ./.github/actions/checkout-submodules-and-bootstrap + with: + platform: ameba + - name: Build example Ameba All Clusters App + run: | + ./scripts/run_in_build_env.sh \ + "./scripts/build/build_examples.py \ + --target ameba-amebad-all-clusters \ + --target ameba-amebad-all-clusters-minimal \ + --target ameba-amebad-light \ + --target ameba-amebad-pigweed \ + build \ + " diff --git a/.github/workflows/examples-asr.yaml b/.github/workflows/examples-asr.yaml new file mode 100644 index 0000000000..840811d13d --- /dev/null +++ b/.github/workflows/examples-asr.yaml @@ -0,0 +1,65 @@ +# Copyright (c) 2023 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: Build example - ASR + +on: + push: + branches-ignore: + - 'dependabot/**' + pull_request: + merge_group: + +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: + asr: + name: ASR + + runs-on: ubuntu-latest + if: github.actor != 'restyled-io[bot]' + + container: + image: ghcr.io/project-chip/chip-build-asr:74 + options: --user root + + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Checkout submodules & Bootstrap + uses: ./.github/actions/checkout-submodules-and-bootstrap + with: + platform: asr + - name: Build all ASR582X examples + run: | + ./scripts/run_in_build_env.sh \ + "./scripts/build/build_examples.py \ + --target asr-asr582x-all-clusters \ + --target asr-asr582x-all-clusters-minimal \ + --target asr-asr582x-lighting-ota \ + --target asr-asr582x-light-switch-shell \ + --target asr-asr582x-lock-no_logging \ + --target asr-asr582x-ota-requestor \ + --target asr-asr582x-bridge-factory \ + --target asr-asr582x-temperature-measurement-rotating_id \ + --target asr-asr582x-thermostat-rio \ + --target asr-asr582x-dishwasher \ + --target asr-asr582x-refrigerator \ + build \ + " diff --git a/.github/workflows/examples-bouffalolab.yaml b/.github/workflows/examples-bouffalolab.yaml new file mode 100644 index 0000000000..af20a4c5b0 --- /dev/null +++ b/.github/workflows/examples-bouffalolab.yaml @@ -0,0 +1,147 @@ +# Copyright (c) 2020 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: Build example - BouffaloLab + +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: + bouffalolab: + name: Bouffalo Lab + + runs-on: ubuntu-latest + if: github.actor != 'restyled-io[bot]' + + container: + image: ghcr.io/project-chip/chip-build-bouffalolab:74 + volumes: + - "/tmp/bloat_reports:/tmp/bloat_reports" + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Checkout submodules & Bootstrap + uses: ./.github/actions/checkout-submodules-and-bootstrap + with: + platform: bouffalolab + extra-submodule-parameters: " --recursive" + - name: Set up environment for size reports + uses: ./.github/actions/setup-size-reports + if: ${{ !env.ACT }} + with: + gh-context: ${{ toJson(github) }} + - name: Build example BL602 Lighting App + run: | + ./scripts/run_in_build_env.sh \ + "./scripts/build/build_examples.py \ + --target bouffalolab-bl602-night-light-light \ + --target bouffalolab-bl602-night-light-light-mfd \ + --target bouffalolab-bl602-iot-matter-v1-light-115200-rpc \ + build \ + --copy-artifacts-to out/artifacts \ + " + - name: Prepare some bloat report from the previous builds + run: | + .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ + bl602 bl602 lighting-app \ + out/artifacts/bouffalolab-bl602-night-light-light/chip-bl602-lighting-example.out \ + /tmp/bloat_reports/ + .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ + bl602 bl602+mfd lighting-app \ + out/artifacts/bouffalolab-bl602-night-light-light-mfd/chip-bl602-lighting-example.out \ + /tmp/bloat_reports/ + .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ + bl602 bl602+rpc lighting-app \ + out/artifacts/bouffalolab-bl602-iot-matter-v1-light-115200-rpc/chip-bl602-lighting-example.out \ + /tmp/bloat_reports/ + - name: Clean out build output + run: rm -rf ./out + + - name: Build example BL702 Lighting App + run: | + ./scripts/run_in_build_env.sh \ + "./scripts/build/build_examples.py \ + --target bouffalolab-bl706-night-light-light \ + --target bouffalolab-bl706-night-light-light-mfd \ + --target bouffalolab-bl706dk-light-ethernet \ + --target bouffalolab-bl706dk-light-wifi-fp \ + --target bouffalolab-xt-zb6-devkit-light-115200-rpc \ + build \ + --copy-artifacts-to out/artifacts \ + " + - name: Prepare some bloat report from the previous builds + run: | + .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ + bl702 bl702 lighting-app \ + out/artifacts/bouffalolab-bl706-night-light-light/chip-bl702-lighting-example.out \ + /tmp/bloat_reports/ + .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ + bl702 bl702+mfd lighting-app \ + out/artifacts/bouffalolab-bl706-night-light-light-mfd/chip-bl702-lighting-example.out \ + /tmp/bloat_reports/ + .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ + bl702 bl706-eth lighting-app \ + out/artifacts/bouffalolab-bl706dk-light-ethernet/chip-bl702-lighting-example.out \ + /tmp/bloat_reports/ + .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ + bl702 bl706-wifi lighting-app \ + out/artifacts/bouffalolab-bl706dk-light-wifi-fp/chip-bl702-lighting-example.out \ + /tmp/bloat_reports/ + .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ + bl702 bl702+rpc lighting-app \ + out/artifacts/bouffalolab-xt-zb6-devkit-light-115200-rpc/chip-bl702-lighting-example.out \ + /tmp/bloat_reports/ + - name: Clean out build output + run: rm -rf ./out + + - name: Build example BL702L Lighting App + timeout-minutes: 30 + run: | + ./scripts/run_in_build_env.sh \ + "./scripts/build/build_examples.py \ + --target bouffalolab-bl704ldk-light \ + --target bouffalolab-bl704ldk-light-mfd \ + build \ + --copy-artifacts-to out/artifacts \ + " + - name: Prepare some bloat report from the previous builds + run: | + .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ + bl702l bl702l lighting-app \ + out/artifacts/bouffalolab-bl704ldk-light/chip-bl702l-lighting-example.out \ + /tmp/bloat_reports/ + .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ + bl702l bl702l+mfd lighting-app \ + out/artifacts/bouffalolab-bl704ldk-light-mfd/chip-bl702l-lighting-example.out \ + /tmp/bloat_reports/ + - name: Clean out build output + run: rm -rf ./out + + - name: Uploading Size Reports + uses: ./.github/actions/upload-size-reports + if: ${{ !env.ACT }} + with: + platform-name: BouffaloLab diff --git a/.github/workflows/examples-cc13xx_26xx.yaml b/.github/workflows/examples-cc13xx_26xx.yaml new file mode 100644 index 0000000000..53c813d0b4 --- /dev/null +++ b/.github/workflows/examples-cc13xx_26xx.yaml @@ -0,0 +1,114 @@ +# Copyright (c) 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: Build example - TI CC13XX_26XX + +on: + workflow_dispatch: + # Temporarely disabled: + # - TI CI runs out of disk space + # - Image should be updated to an Ubuntu 24.04 or higher based one (move from :54 version) + # push: + # branches-ignore: + # - 'dependabot/**' + # pull_request: + # merge_group: + +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: + cc13xx_26xx: + name: cc13xx_26xx + + env: + BUILD_TYPE: gn_cc13xx_26xx + + runs-on: ubuntu-latest + if: github.actor != 'restyled-io[bot]' + + container: + image: ghcr.io/project-chip/chip-build-ti:74 + volumes: + - "/tmp/bloat_reports:/tmp/bloat_reports" + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Checkout submodules & Bootstrap + uses: ./.github/actions/checkout-submodules-and-bootstrap + with: + platform: cc13xx_26xx + extra-submodule-parameters: " --recursive" + - name: Set up environment for size reports + uses: ./.github/actions/setup-size-reports + if: ${{ !env.ACT }} + with: + gh-context: ${{ toJson(github) }} + + - name: Build examples + run: | + scripts/run_in_build_env.sh "\ + ./scripts/build/build_examples.py \ + --target ti-cc13x4_26x4-lighting-ftd \ + --target ti-cc13x4_26x4-lighting-mtd \ + --target ti-cc13x4_26x4-lock-ftd \ + --target ti-cc13x4_26x4-lock-mtd \ + --target ti-cc13x4_26x4-pump-mtd \ + --target ti-cc13x4_26x4-pump-ftd \ + --target ti-cc13x4_26x4-pump-controller-mtd \ + --target ti-cc13x4_26x4-pump-controller-ftd \ + build \ + --copy-artifacts-to out/artifacts \ + " + - name: Get lock FTD size stats + run: | + .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ + cc13x4_26x4 LP_EM_CC1354P10_6 lock-ftd \ + out/artifacts/ti-cc13x4_26x4-lock-ftd/chip-LP_EM_CC1354P10_6-lock-example.out \ + /tmp/bloat_reports/ + - name: Get lock MTD size stats + run: | + .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ + cc13x4_26x4 LP_EM_CC1354P10_6 lock-mtd \ + out/artifacts/ti-cc13x4_26x4-lock-mtd/chip-LP_EM_CC1354P10_6-lock-example.out \ + /tmp/bloat_reports/ + - name: Get Pump App size stats + run: | + .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ + cc13x4_26x4 LP_EM_CC1354P10_6 pump-app \ + out/artifacts/ti-cc13x4_26x4-pump-mtd/chip-LP_EM_CC1354P10_6-pump-example.out \ + /tmp/bloat_reports/ + - name: Get Pump Controller MTD size stats + run: | + .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ + cc13x4_26x4 LP_EM_CC1354P10_6 pump-controller-app \ + out/artifacts/ti-cc13x4_26x4-pump-controller-mtd/chip-LP_EM_CC1354P10_6-pump-controller-example.out \ + /tmp/bloat_reports/ + - name: Get Lighting FTD size stats + run: | + .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ + cc13x4_26x4 LP_EM_CC1354P10_6 lighting-app \ + out/artifacts/ti-cc13x4_26x4-lighting-ftd/chip-LP_EM_CC1354P10_6-lighting-example.out \ + /tmp/bloat_reports/ + - name: Uploading Size Reports + uses: ./.github/actions/upload-size-reports + if: ${{ !env.ACT }} + with: + platform-name: cc13x4_26x4 diff --git a/.github/workflows/examples-cc32xx.yaml b/.github/workflows/examples-cc32xx.yaml new file mode 100644 index 0000000000..091a5eeabc --- /dev/null +++ b/.github/workflows/examples-cc32xx.yaml @@ -0,0 +1,87 @@ +# Copyright (c) 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: Build example - TI CC32XX + +on: + workflow_dispatch: + # Temporarely disabled: + # - TI CI runs out of disk space + # - Image should be updated to an Ubuntu 24.04 or higher based one (move from :54 version) + # push: + # branches-ignore: + # - 'dependabot/**' + # pull_request: + # merge_group: + +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: + cc32xx: + name: cc32xx + + env: + BUILD_TYPE: gn_cc32xx + + runs-on: ubuntu-latest + if: github.actor != 'restyled-io[bot]' + + container: + image: ghcr.io/project-chip/chip-build-ti:74 + volumes: + - "/tmp/bloat_reports:/tmp/bloat_reports" + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Checkout submodules & Bootstrap + uses: ./.github/actions/checkout-submodules-and-bootstrap + with: + platform: cc32xx + - name: Set up environment for size reports + uses: ./.github/actions/setup-size-reports + if: ${{ !env.ACT }} + with: + gh-context: ${{ toJson(github) }} + + - name: Build examples + run: | + scripts/run_in_build_env.sh "\ + ./scripts/build/build_examples.py \ + --target cc32xx-lock --target cc32xx-air-purifier build \ + --copy-artifacts-to out/artifacts \ + " + - name: Get lock app size stats + run: | + .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ + cc32xx CC3235SF_LAUNCHXL lock \ + out/artifacts/cc32xx-lock/chip-CC3235SF_LAUNCHXL-lock-example.out \ + /tmp/bloat_reports/ + + - name: Get air purifier app size stats + run: | + .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ + cc32xx CC3235SF_LAUNCHXL air-purifier \ + out/artifacts/cc32xx-air-purifier/chip-CC3235SF_LAUNCHXL-air-purifier-example.out \ + /tmp/bloat_reports/ + + - name: Uploading Size Reports + uses: ./.github/actions/upload-size-reports + if: ${{ !env.ACT }} + with: + platform-name: cc32xx diff --git a/.github/workflows/examples-efr32.yaml b/.github/workflows/examples-efr32.yaml new file mode 100644 index 0000000000..c236b4ca3d --- /dev/null +++ b/.github/workflows/examples-efr32.yaml @@ -0,0 +1,148 @@ +# Copyright (c) 2020 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: Build example - EFR32 + +on: + push: + branches-ignore: + - 'dependabot/**' + pull_request: + merge_group: + +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: + efr32: + name: EFR32 + + env: + SILABS_BOARD: BRD4187C + BUILD_TYPE: gn_efr32 + + runs-on: ubuntu-latest + if: github.actor != 'restyled-io[bot]' + + container: + image: ghcr.io/project-chip/chip-build-efr32:74 + volumes: + - "/tmp/bloat_reports:/tmp/bloat_reports" + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Checkout submodules & Bootstrap + uses: ./.github/actions/checkout-submodules-and-bootstrap + with: + platform: silabs_docker + + - name: Set up environment for size reports + uses: ./.github/actions/setup-size-reports + if: ${{ !env.ACT }} + with: + gh-context: ${{ toJson(github) }} + + - name: Test SLC gen + timeout-minutes: 30 + run: | + scripts/examples/gn_silabs_example.sh examples/lighting-app/silabs ./out/light-app BRD4187C --slc_generate --docker + rm -rf ./out/ + - name: Build some BRD4187C variants (1) + run: | + ./scripts/run_in_build_env.sh \ + "./scripts/build/build_examples.py \ + --enable-flashbundle \ + --target efr32-brd4187c-thermostat-openthread-mtd \ + --target efr32-brd4187c-switch-shell-use-ot-coap-lib \ + --target efr32-brd4187c-unit-test \ + build \ + --copy-artifacts-to out/artifacts \ + " + - name: Clean out build output + run: rm -rf ./out + - name: Build some BRD4187C variants (2) + run: | + ./scripts/run_in_build_env.sh \ + "./scripts/build/build_examples.py \ + --enable-flashbundle \ + --target efr32-brd4187c-light-use-ot-lib \ + --target efr32-brd4187c-pump \ + --target efr32-brd4187c-lock-shell-heap-monitoring \ + build \ + --copy-artifacts-to out/artifacts \ + " + - name: Clean out build output + run: rm -rf ./out + - name: Build BRD4187C variants (3) + run: | + ./scripts/run_in_build_env.sh \ + "./scripts/build/build_examples.py \ + --enable-flashbundle \ + --target efr32-brd4187c-window-covering-additional-data-advertising \ + --target efr32-brd4187c-light-rpc \ + build \ + --copy-artifacts-to out/artifacts \ + " + - name: Prepare some bloat report from the previous builds + run: | + .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ + efr32 BRD4187C lighting-app \ + out/efr32-brd4187c-light-rpc/matter-silabs-lighting-example.out \ + /tmp/bloat_reports/ + .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ + efr32 BRD4187C window-app \ + out/efr32-brd4187c-window-covering-additional-data-advertising/matter-silabs-window-example.out \ + /tmp/bloat_reports/ + - name: Clean out build output + run: rm -rf ./out + - name: Build BRD4338A WiFi Soc variants + run: | + ./scripts/run_in_build_env.sh \ + "./scripts/build/build_examples.py \ + --enable-flashbundle \ + --target efr32-brd4338a-light-skip-rps-generation \ + --target efr32-brd4338a-lock-skip-rps-generation \ + build \ + --copy-artifacts-to out/artifacts \ + " + - name: Prepare bloat report for brd4338a lock app + run: | + .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ + efr32 BRD4338a lock-app \ + out/efr32-brd4338a-lock-skip-rps-generation/matter-silabs-lock-example.out \ + /tmp/bloat_reports/ + - name: Clean out build output + run: rm -rf ./out + - name: Build EFR32 with WiFi NCP + run: | + ./scripts/run_in_build_env.sh \ + "./scripts/build/build_examples.py \ + --enable-flashbundle \ + --target efr32-brd4187c-lock-wifi-siwx917 \ + --target efr32-brd4187c-light-wifi-rs9116 \ + --target efr32-brd4187c-lock-wifi-wf200 \ + build \ + --copy-artifacts-to out/artifacts \ + " + - name: Clean out build output + run: rm -rf ./out + - name: Uploading Size Reports + uses: ./.github/actions/upload-size-reports + if: ${{ !env.ACT }} + with: + platform-name: EFR32 diff --git a/.github/workflows/examples-esp32.yaml b/.github/workflows/examples-esp32.yaml new file mode 100644 index 0000000000..5d84540eda --- /dev/null +++ b/.github/workflows/examples-esp32.yaml @@ -0,0 +1,169 @@ +# Copyright (c) 2020 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: Build example - ESP32 + +on: + push: + branches-ignore: + - 'dependabot/**' + pull_request: + merge_group: + +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: + esp32: + name: ESP32 + + runs-on: ubuntu-latest + if: github.actor != 'restyled-io[bot]' + + container: + image: ghcr.io/project-chip/chip-build-esp32:74 + volumes: + - "/tmp/bloat_reports:/tmp/bloat_reports" + + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Checkout submodules + uses: ./.github/actions/checkout-submodules-and-bootstrap + with: + platform: esp32 + + - name: Set up environment for size reports + uses: ./.github/actions/setup-size-reports + if: ${{ !env.ACT }} + with: + gh-context: ${{ toJson(github) }} + + - name: Build some M5Stack variations + run: | + ./scripts/run_in_build_env.sh \ + "./scripts/build/build_examples.py \ + --enable-flashbundle \ + --target esp32-m5stack-all-clusters \ + build \ + --copy-artifacts-to out/artifacts \ + " + - name: Prepare bloat report + run: | + .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ + esp32 m5stack all-clusters-app \ + out/esp32-m5stack-all-clusters/chip-all-clusters-app.elf \ + /tmp/bloat_reports/ + - name: Prepare code pregen and ensure compile time pregen not possible + run: | + ./scripts/run_in_build_env.sh "./scripts/codepregen.py ./zzz_pregenerated" + mv scripts/codegen.py scripts/codegen.py.renamed + mv scripts/tools/zap/generate.py scripts/tools/zap/generate.py.renamed + - name: Clean output + run: rm -rf ./out + - name: Build some M5Stack variations with pregen + run: | + ./scripts/run_in_build_env.sh \ + "./scripts/build/build_examples.py \ + --enable-flashbundle \ + --target esp32-m5stack-all-clusters-minimal \ + --target esp32-m5stack-all-clusters-rpc-ipv6only \ + --pregen-dir ./zzz_pregenerated \ + build \ + --copy-artifacts-to out/artifacts \ + " + - name: Undo code pregeneration changes + run: | + rm -rf ./zzz_pregenerated + mv scripts/codegen.py.renamed scripts/codegen.py + mv scripts/tools/zap/generate.py.renamed scripts/tools/zap/generate.py + - name: Build example All Clusters App(Target:ESP32C3) + run: scripts/examples/esp_example.sh all-clusters-app sdkconfig.defaults.esp32c3 esp32c3 + - name: Copy aside build products + run: | + mkdir -p example_binaries/esp32-build + cp examples/all-clusters-app/esp32/build/chip-all-clusters-app.elf \ + example_binaries/esp32-build/chip-all-clusters-app.elf + .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ + esp32 c3devkit all-clusters-app \ + example_binaries/esp32-build/chip-all-clusters-app.elf \ + /tmp/bloat_reports/ + + - name: Build example Pigweed App + run: scripts/examples/esp_example.sh pigweed-app sdkconfig.defaults + + - name: Build example Lighting App (Target:ESP32H2) + run: scripts/examples/esp_example.sh lighting-app sdkconfig.defaults.esp32h2 esp32h2 + + - name: Build example Lock App (Target:ESP32C6) + run: scripts/examples/esp_example.sh lock-app sdkconfig.defaults.esp32c6 esp32c6 + + - name: Uploading Size Reports + uses: ./.github/actions/upload-size-reports + if: ${{ !env.ACT }} + with: + platform-name: ESP32 + + esp32_1: + name: ESP32_1 + + runs-on: ubuntu-latest + if: github.actor != 'restyled-io[bot]' + + container: + image: ghcr.io/project-chip/chip-build-esp32:74 + volumes: + - "/tmp/bloat_reports:/tmp/bloat_reports" + + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Checkout submodules & Bootstrap + uses: ./.github/actions/checkout-submodules-and-bootstrap + with: + platform: esp32 + + - name: Build example Bridge App + run: scripts/examples/esp_example.sh bridge-app + + - name: Build example Persistent Storage App + run: scripts/examples/esp_example.sh persistent-storage sdkconfig.defaults + + - name: Build example Shell App + run: scripts/examples/esp_example.sh shell sdkconfig.defaults + + - name: Build example Temperature Measurement App + run: scripts/examples/esp_example.sh temperature-measurement-app sdkconfig.optimize.defaults + + - name: Build example OTA Requestor App + run: scripts/examples/esp_example.sh ota-requestor-app sdkconfig.defaults + + - name: Build example OTA Provider App + run: scripts/examples/esp_example.sh ota-provider-app sdkconfig.defaults + + - name: Build example Light Switch App (Target:ESP32C3) + run: scripts/examples/esp_example.sh light-switch-app sdkconfig.defaults.esp32c3 esp32c3 + + - name: Build example Lighting App (external platform) + run: scripts/examples/esp_example.sh lighting-app sdkconfig.ext_plat.defaults + + - name: Build example Energy Management App + run: scripts/examples/esp_example.sh energy-management-app sdkconfig.defaults + + - name: Build example LIT ICD App (Target:ESP32H2) + run: scripts/examples/esp_example.sh lit-icd-app sdkconfig.defaults esp32h2 diff --git a/.github/workflows/examples-infineon.yaml b/.github/workflows/examples-infineon.yaml new file mode 100644 index 0000000000..0fcfac2ce7 --- /dev/null +++ b/.github/workflows/examples-infineon.yaml @@ -0,0 +1,226 @@ +# Copyright (c) 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: Build example - Infineon + +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: + infineon: + name: Infineon examples building + + runs-on: ubuntu-latest + if: github.actor != 'restyled-io[bot]' + + container: + image: ghcr.io/project-chip/chip-build-infineon:74 + env: + # TODO: this should probably be part of the dockerfile itself + CY_TOOLS_PATHS: /opt/Tools/ModusToolbox/tools_3.2 + volumes: + - "/tmp/bloat_reports:/tmp/bloat_reports" + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Checkout submodules & Bootstrap + uses: ./.github/actions/checkout-submodules-and-bootstrap + with: + platform: infineon + + - name: Set up environment for size reports + uses: ./.github/actions/setup-size-reports + if: ${{ !env.ACT }} + with: + gh-context: ${{ toJson(github) }} + + - name: Build PSoC6 lock-app example + run: | + scripts/run_in_build_env.sh \ + "scripts/build/build_examples.py \ + --enable-flashbundle \ + --target infineon-psoc6-lock \ + build \ + --copy-artifacts-to out/artifacts \ + " + .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ + psoc6 cy8ckit_062s2_43012 lock \ + out/artifacts/infineon-psoc6-lock/chip-psoc6-lock-example.out \ + /tmp/bloat_reports/ + - name: Build PSoC6 all-clusters-app example + run: | + scripts/run_in_build_env.sh \ + "scripts/build/build_examples.py \ + --enable-flashbundle \ + --target infineon-psoc6-all-clusters \ + build \ + --copy-artifacts-to out/artifacts \ + " + .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ + psoc6 cy8ckit_062s2_43012 all-clusters \ + out/artifacts/infineon-psoc6-all-clusters/chip-psoc6-clusters-example.out \ + /tmp/bloat_reports/ + - name: Build PSoC6 all-clusters-minimal-app example + run: | + scripts/run_in_build_env.sh \ + "scripts/build/build_examples.py \ + --enable-flashbundle \ + --target infineon-psoc6-all-clusters-minimal \ + build \ + --copy-artifacts-to out/artifacts \ + " + .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ + psoc6 cy8ckit_062s2_43012 all-clusters-minimal \ + out/artifacts/infineon-psoc6-all-clusters-minimal/chip-psoc6-clusters-minimal-example.out \ + /tmp/bloat_reports/ + - name: Build PSoC6 lighting-app example + run: | + scripts/run_in_build_env.sh \ + "scripts/build/build_examples.py \ + --enable-flashbundle \ + --target infineon-psoc6-light \ + build \ + --copy-artifacts-to out/artifacts \ + " + .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ + psoc6 cy8ckit_062s2_43012 light \ + out/artifacts/infineon-psoc6-light/chip-psoc6-lighting-example.out \ + /tmp/bloat_reports/ + + - name: Build CYW30739 Lighting App + run: | + ./scripts/run_in_build_env.sh \ + "./scripts/build/build_examples.py \ + --target cyw30739-cyw30739b2_p5_evk_01-light \ + --target cyw30739-cyw30739b2_p5_evk_02-light \ + --target cyw30739-cyw30739b2_p5_evk_03-light \ + --target cyw30739-cyw930739m2evb_02-light \ + build \ + --copy-artifacts-to out/artifacts \ + " + - name: Get light size stats + run: | + .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ + cyw30739 CYW30739B2-P5-EVK-01 light \ + out/artifacts/cyw30739-cyw30739b2_p5_evk_01-light/lighting_app-CYW30739B2-P5-EVK-01.elf \ + /tmp/bloat_reports/ + .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ + cyw30739 CYW30739B2-P5-EVK-02 light \ + out/artifacts/cyw30739-cyw30739b2_p5_evk_02-light/lighting_app-CYW30739B2-P5-EVK-02.elf \ + /tmp/bloat_reports/ + .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ + cyw30739 CYW30739B2-P5-EVK-03 light \ + out/artifacts/cyw30739-cyw30739b2_p5_evk_03-light/lighting_app-CYW30739B2-P5-EVK-03.elf \ + /tmp/bloat_reports/ + .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ + cyw30739 CYW930739M2EVB-02 light \ + out/artifacts/cyw30739-cyw930739m2evb_02-light/lighting_app-CYW930739M2EVB-02.elf \ + /tmp/bloat_reports/ + - name: Clean out build output + run: rm -rf ./out + - name: Build CYW30739 Light Switch App + run: | + ./scripts/run_in_build_env.sh \ + "./scripts/build/build_examples.py \ + --target cyw30739-cyw30739b2_p5_evk_01-light-switch \ + --target cyw30739-cyw30739b2_p5_evk_02-light-switch \ + --target cyw30739-cyw30739b2_p5_evk_03-light-switch \ + build \ + --copy-artifacts-to out/artifacts \ + " + - name: Get light-switch size stats + run: | + .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ + cyw30739 CYW30739B2-P5-EVK-01 light-switch \ + out/artifacts/cyw30739-cyw30739b2_p5_evk_01-light-switch/light_switch_app-CYW30739B2-P5-EVK-01.elf \ + /tmp/bloat_reports/ + .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ + cyw30739 CYW30739B2-P5-EVK-02 light-switch \ + out/artifacts/cyw30739-cyw30739b2_p5_evk_02-light-switch/light_switch_app-CYW30739B2-P5-EVK-02.elf \ + /tmp/bloat_reports/ + .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ + cyw30739 CYW30739B2-P5-EVK-03 light-switch \ + out/artifacts/cyw30739-cyw30739b2_p5_evk_03-light-switch/light_switch_app-CYW30739B2-P5-EVK-03.elf \ + /tmp/bloat_reports/ + - name: Clean out build output + run: rm -rf ./out + - name: Build CYW30739 Lock App + run: | + ./scripts/run_in_build_env.sh \ + "./scripts/build/build_examples.py \ + --target cyw30739-cyw30739b2_p5_evk_01-lock \ + --target cyw30739-cyw30739b2_p5_evk_02-lock \ + --target cyw30739-cyw30739b2_p5_evk_03-lock \ + build \ + --copy-artifacts-to out/artifacts \ + " + - name: Get lock size stats + run: | + .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ + cyw30739 CYW30739B2-P5-EVK-01 lock \ + out/artifacts/cyw30739-cyw30739b2_p5_evk_01-lock/lock_app-CYW30739B2-P5-EVK-01.elf \ + /tmp/bloat_reports/ + .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ + cyw30739 CYW30739B2-P5-EVK-02 lock \ + out/artifacts/cyw30739-cyw30739b2_p5_evk_02-lock/lock_app-CYW30739B2-P5-EVK-02.elf \ + /tmp/bloat_reports/ + .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ + cyw30739 CYW30739B2-P5-EVK-03 lock \ + out/artifacts/cyw30739-cyw30739b2_p5_evk_03-lock/lock_app-CYW30739B2-P5-EVK-03.elf \ + /tmp/bloat_reports/ + - name: Clean out build output + run: rm -rf ./out + - name: Build CYW30739 Thermostat App + run: | + ./scripts/run_in_build_env.sh \ + "./scripts/build/build_examples.py \ + --target cyw30739-cyw30739b2_p5_evk_01-thermostat \ + --target cyw30739-cyw30739b2_p5_evk_02-thermostat \ + --target cyw30739-cyw30739b2_p5_evk_03-thermostat \ + build \ + --copy-artifacts-to out/artifacts \ + " + - name: Get thermostat size stats + run: | + .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ + cyw30739 CYW30739B2-P5-EVK-01 thermostat \ + out/artifacts/cyw30739-cyw30739b2_p5_evk_01-thermostat/thermostat-CYW30739B2-P5-EVK-01.elf \ + /tmp/bloat_reports/ + .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ + cyw30739 CYW30739B2-P5-EVK-02 thermostat \ + out/artifacts/cyw30739-cyw30739b2_p5_evk_02-thermostat/thermostat-CYW30739B2-P5-EVK-02.elf \ + /tmp/bloat_reports/ + .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ + cyw30739 CYW30739B2-P5-EVK-03 thermostat \ + out/artifacts/cyw30739-cyw30739b2_p5_evk_03-thermostat/thermostat-CYW30739B2-P5-EVK-03.elf \ + /tmp/bloat_reports/ + - name: Clean out build output + run: rm -rf ./out + - name: Uploading Size Reports + uses: ./.github/actions/upload-size-reports + if: ${{ !env.ACT }} + with: + platform-name: Infineon diff --git a/.github/workflows/examples-linux-arm.yaml b/.github/workflows/examples-linux-arm.yaml new file mode 100644 index 0000000000..41fe245651 --- /dev/null +++ b/.github/workflows/examples-linux-arm.yaml @@ -0,0 +1,90 @@ +# Copyright (c) 2020 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: Build example - Linux ARM + +on: + push: + branches-ignore: + - 'dependabot/**' + pull_request: + merge_group: + +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: + arm_crosscompile: + name: Linux ARM Cross compile + + runs-on: ubuntu-latest + if: github.actor != 'restyled-io[bot]' + + container: + image: ghcr.io/project-chip/chip-build-crosscompile:74 + volumes: + - "/tmp/bloat_reports:/tmp/bloat_reports" + + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Checkout submodules & Bootstrap + uses: ./.github/actions/checkout-submodules-and-bootstrap + with: + platform: linux + + - name: Set up environment for size reports + uses: ./.github/actions/setup-size-reports + if: ${{ !env.ACT }} + with: + gh-context: ${{ toJson(github) }} + + - name: Build Some samples + run: | + ./scripts/run_in_build_env.sh \ + "./scripts/build/build_examples.py \ + --target linux-arm64-chip-cert-clang \ + --target linux-arm64-all-clusters-clang \ + --target linux-arm64-chip-tool-ipv6only-clang \ + --target linux-arm64-chip-tool-nodeps-ipv6only \ + --target linux-arm64-lock-clang \ + --target linux-arm64-minmdns-clang \ + --target linux-arm64-light-rpc-ipv6only-clang \ + --target linux-arm64-thermostat-no-ble-clang \ + --target linux-arm64-lit-icd-no-ble-clang \ + --target linux-arm64-fabric-admin-clang-rpc \ + --target linux-arm64-fabric-bridge-no-ble-clang-rpc \ + build \ + " + - name: Bloat report - chip-tool + run: | + .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ + linux arm64 chip-tool-ipv6only \ + out/linux-arm64-chip-tool-ipv6only-clang/chip-tool \ + /tmp/bloat_reports/ + - name: Bloat report - thermostat + run: | + .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ + linux arm64 thermostat-no-ble \ + out/linux-arm64-thermostat-no-ble-clang/thermostat-app \ + /tmp/bloat_reports/ + - name: Uploading Size Reports + uses: ./.github/actions/upload-size-reports + if: ${{ !env.ACT }} + with: + platform-name: Linux diff --git a/.github/workflows/examples-linux-imx.yaml b/.github/workflows/examples-linux-imx.yaml new file mode 100644 index 0000000000..6ad5f4c9d9 --- /dev/null +++ b/.github/workflows/examples-linux-imx.yaml @@ -0,0 +1,96 @@ +# Copyright (c) 2022 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: Build example - i.MX Linux + +on: + push: + branches-ignore: + - 'dependabot/**' + pull_request: + merge_group: + +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: + imx: + name: Linux i.MX Build + + runs-on: ubuntu-latest + if: github.actor != 'restyled-io[bot]' + + container: + image: ghcr.io/project-chip/chip-build-imx:74 + + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Checkout submodules & Bootstrap + uses: ./.github/actions/checkout-submodules-and-bootstrap + with: + platform: linux + + - name: Build lighting-app + run: | + ./scripts/run_in_build_env.sh \ + "./scripts/build/build_examples.py \ + --target imx-lighting-app \ + build" + - name: Clean out build output + run: rm -rf ./out + - name: Build chip-tool + run: | + ./scripts/run_in_build_env.sh \ + "./scripts/build/build_examples.py \ + --target imx-chip-tool \ + build" + - name: Clean out build output + run: rm -rf ./out + - name: Build thermostat + run: | + ./scripts/run_in_build_env.sh \ + "./scripts/build/build_examples.py \ + --target imx-thermostat \ + build" + - name: Clean out build output + run: rm -rf ./out + - name: Build all-cluster + run: | + ./scripts/run_in_build_env.sh \ + "./scripts/build/build_examples.py \ + --target imx-all-clusters-app \ + build" + - name: Clean out build output + run: rm -rf ./out + - name: Build all-cluster-minimal + run: | + ./scripts/run_in_build_env.sh \ + "./scripts/build/build_examples.py \ + --target imx-all-clusters-minimal-app \ + build" + - name: Clean out build output + run: rm -rf ./out + - name: Build ota-provider-app + run: | + ./scripts/run_in_build_env.sh \ + "./scripts/build/build_examples.py \ + --target imx-ota-provider-app \ + build" + - name: Clean out build output + run: rm -rf ./out diff --git a/.github/workflows/examples-linux-standalone.yaml b/.github/workflows/examples-linux-standalone.yaml new file mode 100644 index 0000000000..aa4051ea30 --- /dev/null +++ b/.github/workflows/examples-linux-standalone.yaml @@ -0,0 +1,225 @@ +# Copyright (c) 2020 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: Build example - Linux Standalone + +on: + push: + branches-ignore: + - 'dependabot/**' + pull_request: + merge_group: + +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: + linux_standalone: + name: Linux Standalone + + runs-on: ubuntu-latest + if: github.actor != 'restyled-io[bot]' + + container: + image: ghcr.io/project-chip/chip-build:74 + volumes: + - "/tmp/bloat_reports:/tmp/bloat_reports" + + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Checkout submodules & Bootstrap + uses: ./.github/actions/checkout-submodules-and-bootstrap + with: + platform: linux + + - name: Set up environment for size reports + uses: ./.github/actions/setup-size-reports + if: ${{ !env.ACT }} + with: + gh-context: ${{ toJson(github) }} + + - name: Build Standalone cert tool + run: | + ./scripts/run_in_build_env.sh \ + "./scripts/build/build_examples.py \ + --target linux-x64-chip-cert \ + build" + - name: Build minmdns example with platform dns + run: | + ./scripts/run_in_build_env.sh \ + "./scripts/build/build_examples.py \ + --target linux-x64-address-resolve-tool-platform-mdns-ipv6only \ + build" + - name: Build example Standalone chip tool + run: | + ./scripts/run_in_build_env.sh \ + "./scripts/build/build_examples.py \ + --target linux-x64-chip-tool \ + build" + .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ + linux debug chip-tool \ + out/linux-x64-chip-tool/chip-tool \ + /tmp/bloat_reports/ + - name: Build example Standalone Shell + run: | + ./scripts/run_in_build_env.sh \ + "./scripts/build/build_examples.py \ + --target linux-x64-shell \ + build" + .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ + linux debug shell \ + out/linux-x64-shell/chip-shell \ + /tmp/bloat_reports/ + - name: Build example Standalone All Clusters Server + run: | + ./scripts/run_in_build_env.sh \ + "./scripts/build/build_examples.py \ + --target linux-x64-all-clusters \ + build" + .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ + linux debug all-clusters-app \ + out/linux-x64-all-clusters/chip-all-clusters-app \ + /tmp/bloat_reports/ + - name: Clean out build output + run: rm -rf ./out + - name: Build example Standalone All Clusters Minimal Server + run: | + ./scripts/run_in_build_env.sh \ + "./scripts/build/build_examples.py \ + --target linux-x64-all-clusters-minimal \ + build" + .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ + linux debug all-clusters-minimal-app \ + out/linux-x64-all-clusters-minimal/chip-all-clusters-minimal-app \ + /tmp/bloat_reports/ + - name: Build example TV app + run: | + ./scripts/run_in_build_env.sh \ + "./scripts/build/build_examples.py \ + --target linux-x64-tv-app \ + build" + .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ + linux debug tv-app \ + out/linux-x64-tv-app/chip-tv-app \ + /tmp/bloat_reports/ + - name: Build example Standalone TV Casting App + run: | + ./scripts/run_in_build_env.sh \ + "./scripts/build/build_examples.py \ + --target linux-x64-tv-casting-app \ + build" + .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ + linux debug tv-casting-app \ + out/linux-x64-tv-casting-app/chip-tv-casting-app \ + /tmp/bloat_reports/ + - name: Build example lighting app with RPCs and UI + run: | + ./scripts/run_in_build_env.sh \ + "./scripts/build/build_examples.py \ + --target linux-x64-light-rpc-with-ui \ + build" + .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ + linux debug+rpc+ui lighting-app \ + out/linux-x64-light-rpc-with-ui/chip-lighting-app \ + /tmp/bloat_reports/ + - name: Clean out build output + run: rm -rf ./out + - name: Build example Standalone Bridge + run: | + ./scripts/run_in_build_env.sh \ + "./scripts/build/build_examples.py \ + --target linux-x64-bridge \ + build" + .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ + linux debug bridge-app \ + out/linux-x64-bridge/chip-bridge-app \ + /tmp/bloat_reports/ + - name: Build example OTA Provider + run: | + ./scripts/run_in_build_env.sh \ + "./scripts/build/build_examples.py \ + --target linux-x64-ota-provider \ + build" + .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ + linux debug ota-provider-app \ + out/linux-x64-ota-provider/chip-ota-provider-app \ + /tmp/bloat_reports/ + - name: Build example OTA Requestor + run: | + ./scripts/run_in_build_env.sh \ + "./scripts/build/build_examples.py \ + --target linux-x64-ota-requestor \ + build" + .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ + linux debug ota-requestor-app \ + out/linux-x64-ota-requestor/chip-ota-requestor-app \ + /tmp/bloat_reports/ + - name: Clean out build output + run: rm -rf ./out + - name: Build example Standalone Lock App + run: | + ./scripts/run_in_build_env.sh \ + "./scripts/build/build_examples.py \ + --target linux-x64-lock-no-thread \ + build" + .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ + linux debug lock-app \ + out/linux-x64-lock-no-thread/chip-lock-app \ + /tmp/bloat_reports/ + - name: Build example contact sensor with UI + run: | + ./scripts/run_in_build_env.sh \ + "./scripts/build/build_examples.py \ + --target linux-x64-contact-sensor-no-ble-with-ui \ + build" + - name: Build example Air Purifier + run: | + ./scripts/run_in_build_env.sh \ + "./scripts/build/build_examples.py \ + --target linux-x64-air-purifier \ + build" + .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ + linux debug air-purifier-app \ + out/linux-x64-air-purifier/chip-air-purifier-app \ + /tmp/bloat_reports/ + - name: Build example Fabric Admin + run: | + ./scripts/run_in_build_env.sh \ + "./scripts/build/build_examples.py \ + --target linux-x64-fabric-admin-rpc \ + build" + .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ + linux debug fabric-admin \ + out/linux-x64-fabric-admin-rpc/fabric-admin \ + /tmp/bloat_reports/ + - name: Build example Fabric Bridge App + run: | + ./scripts/run_in_build_env.sh \ + "./scripts/build/build_examples.py \ + --target linux-x64-fabric-bridge-no-ble-rpc \ + build" + .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ + linux debug fabric-bridge-app \ + out/linux-x64-fabric-bridge-no-ble-rpc/fabric-bridge-app \ + /tmp/bloat_reports/ + - name: Uploading Size Reports + uses: ./.github/actions/upload-size-reports + if: ${{ !env.ACT }} + with: + platform-name: Linux-Standalone diff --git a/.github/workflows/examples-linux-tv-casting-app.yaml b/.github/workflows/examples-linux-tv-casting-app.yaml new file mode 100644 index 0000000000..e2ff0f9f66 --- /dev/null +++ b/.github/workflows/examples-linux-tv-casting-app.yaml @@ -0,0 +1,89 @@ +# Copyright (c) 2024 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: Test TV Casting Example + +on: + push: + branches-ignore: + - "dependabot/**" + pull_request: + merge_group: + +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: + Linux-test: + name: Linux Test + + runs-on: ubuntu-latest + if: github.actor != 'restyled-io[bot]' + + container: + image: ghcr.io/project-chip/chip-build:74 + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Checkout submodules & Bootstrap + uses: ./.github/actions/checkout-submodules-and-bootstrap + with: + platform: linux + + - name: Set Up Environment for Size Reports + uses: ./.github/actions/setup-size-reports + if: ${{ !env.ACT }} + with: + gh-context: ${{ toJson(github) }} + + - name: Build Linux tv-app + run: | + ./scripts/run_in_build_env.sh \ + "scripts/examples/gn_build_example.sh examples/tv-app/linux/ out/tv-app" + + - name: Build Linux tv-casting-app + run: | + ./scripts/run_in_build_env.sh \ + "scripts/examples/gn_build_example.sh examples/tv-casting-app/linux/ out/tv-casting-app chip_casting_simplified=true" + + - name: + Test casting from Linux tv-casting-app to Linux tv-app - + Commissionee Generated Passcode + run: | + ./scripts/run_in_build_env.sh \ + "python3 ./scripts/tests/run_tv_casting_test.py" + timeout-minutes: 2 # Comment this out to debug if GitHub Action times out. + + # TODO: this test is flaky and was disabled + # https://github.com/project-chip/connectedhomeip/issues/34598 + # + # - name: + # Test casting from Linux tv-casting-app to Linux tv-app - + # Commissioner Generated Passcode + # run: | + # ./scripts/run_in_build_env.sh \ + # "python3 ./scripts/tests/run_tv_casting_test.py --commissioner-generated-passcode=True" + # timeout-minutes: 2 # Comment this out to debug if GitHub Action times out. + + - name: Uploading Size Reports + uses: ./.github/actions/upload-size-reports + if: ${{ !env.ACT }} + with: + platform-name: Linux diff --git a/.github/workflows/examples-mw320.yaml b/.github/workflows/examples-mw320.yaml new file mode 100644 index 0000000000..04664c28cf --- /dev/null +++ b/.github/workflows/examples-mw320.yaml @@ -0,0 +1,71 @@ +# 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: Build example - MW320 + +on: + push: + branches-ignore: + - 'dependabot/**' + pull_request: + merge_group: + +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: + mw320: + name: MW320 + + env: + BUILD_TYPE: gn_mw320 + + runs-on: ubuntu-latest + if: github.actor != 'restyled-io[bot]' + + container: + image: ghcr.io/project-chip/chip-build:74 + volumes: + - "/tmp/bloat_reports:/tmp/bloat_reports" + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Checkout submodules & Bootstrap + uses: ./.github/actions/checkout-submodules-and-bootstrap + with: + platform: mw320 + + - name: Set up environment for size reports + uses: ./.github/actions/setup-size-reports + if: ${{ !env.ACT }} + with: + gh-context: ${{ toJson(github) }} + + - name: Build MW320 all clusters example app + run: | + ./scripts/run_in_build_env.sh \ + "./scripts/build/build_examples.py \ + --target 'mw320-all-clusters-app' \ + build \ + --copy-artifacts-to out/artifacts \ + " + - name: Uploading Size Reports + uses: ./.github/actions/upload-size-reports + if: ${{ !env.ACT }} + with: + platform-name: MW320 diff --git a/.github/workflows/examples-nrfconnect.yaml b/.github/workflows/examples-nrfconnect.yaml new file mode 100644 index 0000000000..13b0ae9c69 --- /dev/null +++ b/.github/workflows/examples-nrfconnect.yaml @@ -0,0 +1,211 @@ +# Copyright (c) 2020 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: Build example - nRF Connect SDK + +on: + push: + branches-ignore: + - 'dependabot/**' + pull_request: + merge_group: + +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: + nrfconnect: + name: nRF Connect SDK + + env: + BUILD_TYPE: nrfconnect + + runs-on: ubuntu-latest + if: github.actor != 'restyled-io[bot]' + + container: + image: ghcr.io/project-chip/chip-build-nrf-platform:74 + volumes: + - "/tmp/bloat_reports:/tmp/bloat_reports" + + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Checkout submodules & Bootstrap + uses: ./.github/actions/checkout-submodules-and-bootstrap + with: + platform: nrfconnect + - name: Detect changed paths + uses: dorny/paths-filter@v3 + id: changed_paths + with: + filters: | + nrfconnect: + - '**/nrfconnect/**' + - '**/Zephyr/**' + - '**/zephyr/**' + tests: + - '**/tests/**' + shell: + - 'examples/shell/nrfconnect/**' + - name: Set up environment for size reports + uses: ./.github/actions/setup-size-reports + if: ${{ !env.ACT }} + with: + gh-context: ${{ toJson(github) }} + + - name: Check nRF Connect SDK revision. + run: scripts/run_in_build_env.sh "python3 scripts/setup/nrfconnect/update_ncs.py --check" + - name: Run unit tests of factory data generation script + run: | + scripts/run_in_build_env.sh 'pip3 install -r scripts/setup/requirements.nrfconnect.txt' + scripts/run_in_build_env.sh "./scripts/tools/nrfconnect/tests/test_generate_factory_data.py" + - name: Build example nRF Connect SDK Lock App on nRF52840 DK + if: github.event_name == 'push' || steps.changed_paths.outputs.nrfconnect == 'true' + run: | + scripts/examples/nrfconnect_example.sh lock-app nrf52840dk/nrf52840 + .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ + nrfconnect nrf52840dk_nrf52840 lock-app \ + examples/lock-app/nrfconnect/build/nrfconnect/zephyr/zephyr.elf \ + /tmp/bloat_reports/ + - name: Build example nRF Connect SDK Lighting App on nRF52840 Dongle + if: github.event_name == 'push' || steps.changed_paths.outputs.nrfconnect == 'true' + run: | + scripts/examples/nrfconnect_example.sh lighting-app nrf52840dongle/nrf52840 -DCONFIG_CHIP_ROTATING_DEVICE_ID=y + .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ + nrfconnect nrf52840dongle_nrf52840 lighting-app \ + examples/lighting-app/nrfconnect/build/nrfconnect/zephyr/zephyr.elf \ + /tmp/bloat_reports/ + - name: Build example nRF Connect SDK Lighting App on nRF52840 DK with RPC + if: github.event_name == 'push' || steps.changed_paths.outputs.nrfconnect == 'true' + run: | + scripts/examples/nrfconnect_example.sh lighting-app nrf52840dk/nrf52840 -DOVERLAY_CONFIG=rpc.overlay + .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ + nrfconnect nrf52840dk_nrf52840+rpc lighting-app \ + examples/lighting-app/nrfconnect/build/nrfconnect/zephyr/zephyr.elf \ + /tmp/bloat_reports/ + - name: Build example nRF Connect SDK Light Switch App on nRF52840 DK + if: github.event_name == 'push' || steps.changed_paths.outputs.nrfconnect == 'true' + run: | + scripts/examples/nrfconnect_example.sh light-switch-app nrf52840dk/nrf52840 + .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ + nrfconnect nrf52840dk_nrf52840 light-switch-app \ + examples/light-switch-app/nrfconnect/build/nrfconnect/zephyr/zephyr.elf \ + /tmp/bloat_reports/ + - name: Build example nRF Connect SDK Shell on nRF52840 DK + if: github.event_name == 'push' || steps.changed_paths.outputs.shell == 'true' + run: | + scripts/examples/nrfconnect_example.sh shell nrf52840dk/nrf52840 + .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ + nrfconnect nrf52840dk_nrf52840 shell \ + examples/shell/nrfconnect/build/nrfconnect/zephyr/zephyr.elf \ + /tmp/bloat_reports/ + - name: Build example nRF Connect SDK Pump App on nRF52840 DK + if: github.event_name == 'push' || steps.changed_paths.outputs.nrfconnect == 'true' + run: | + scripts/examples/nrfconnect_example.sh pump-app nrf52840dk/nrf52840 + .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ + nrfconnect nrf52840dk_nrf52840 pump-app \ + examples/pump-app/nrfconnect/build/nrfconnect/zephyr/zephyr.elf \ + /tmp/bloat_reports/ + - name: Build example nRF Connect SDK Pump Controller App on nRF52840 DK + if: github.event_name == 'push' || steps.changed_paths.outputs.nrfconnect == 'true' + run: | + scripts/examples/nrfconnect_example.sh pump-controller-app nrf52840dk/nrf52840 + .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ + nrfconnect nrf52840dk_nrf52840 pump-controller-app \ + examples/pump-controller-app/nrfconnect/build/nrfconnect/zephyr/zephyr.elf \ + /tmp/bloat_reports/ + - name: Build example nRF Connect SDK All Clusters App on nRF52840 DK + run: | + scripts/examples/nrfconnect_example.sh all-clusters-app nrf52840dk/nrf52840 + .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ + nrfconnect nrf52840dk_nrf52840 all-clusters-app \ + examples/all-clusters-app/nrfconnect/build/nrfconnect/zephyr/zephyr.elf \ + /tmp/bloat_reports/ + - name: Build example nRF Connect SDK All Clusters Minimal App on nRF52840 DK + run: | + scripts/examples/nrfconnect_example.sh all-clusters-minimal-app nrf52840dk/nrf52840 -DFILE_SUFFIX=dfu + .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ + nrfconnect nrf52840dk_nrf52840 all-clusters-minimal-app \ + examples/all-clusters-minimal-app/nrfconnect/build/nrfconnect/zephyr/zephyr.elf \ + /tmp/bloat_reports/ + - name: Build example nRF Connect SDK Lock App on nRF5340 DK + if: github.event_name == 'push' || steps.changed_paths.outputs.nrfconnect == 'true' + run: | + scripts/examples/nrfconnect_example.sh lock-app nrf5340dk/nrf5340/cpuapp + .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ + nrfconnect nrf5340dk_nrf5340_cpuapp lock-app \ + examples/lock-app/nrfconnect/build/nrfconnect/zephyr/zephyr.elf \ + /tmp/bloat_reports/ + - name: Build example nRF Connect SDK Lighting App on nRF5340 DK + if: github.event_name == 'push' || steps.changed_paths.outputs.nrfconnect == 'true' + run: | + scripts/examples/nrfconnect_example.sh lighting-app nrf5340dk/nrf5340/cpuapp + .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ + nrfconnect nrf5340dk_nrf5340_cpuapp lighting-app \ + examples/lighting-app/nrfconnect/build/nrfconnect/zephyr/zephyr.elf \ + /tmp/bloat_reports/ + - name: Build example nRF Connect SDK Lock App on nRF7002 PDK + if: github.event_name == 'push' || steps.changed_paths.outputs.nrfconnect == 'true' + run: | + scripts/examples/nrfconnect_example.sh lock-app nrf7002dk/nrf5340/cpuapp + .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ + nrfconnect nrf7002dk_nrf5340_cpuapp lock-app \ + examples/lock-app/nrfconnect/build/nrfconnect/zephyr/zephyr.elf \ + /tmp/bloat_reports/ + - name: Build example nRF Connect SDK Light Switch App on nRF7002 PDK + if: github.event_name == 'push' || steps.changed_paths.outputs.nrfconnect == 'true' + run: | + scripts/examples/nrfconnect_example.sh light-switch-app nrf7002dk/nrf5340/cpuapp + .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ + nrfconnect nrf7002dk_nrf5340_cpuapp light-switch-app \ + examples/light-switch-app/nrfconnect/build/nrfconnect/zephyr/zephyr.elf \ + /tmp/bloat_reports/ + - name: Build example nRF Connect SDK Lighting App on nRF7002 PDK + if: github.event_name == 'push' || steps.changed_paths.outputs.nrfconnect == 'true' + run: | + scripts/examples/nrfconnect_example.sh lighting-app nrf7002dk/nrf5340/cpuapp + .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ + nrfconnect nrf7002dk_nrf5340_cpuapp lighting-app \ + examples/light-switch-app/nrfconnect/build/nrfconnect/zephyr/zephyr.elf \ + /tmp/bloat_reports/ + - name: Build example nRF Connect SDK All Clusters App on nRF7002 PDK + run: | + scripts/examples/nrfconnect_example.sh all-clusters-app nrf7002dk/nrf5340/cpuapp -DFILE_SUFFIX=release + .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ + nrfconnect nrf7002dk_nrf5340_cpuapp all-clusters-app \ + examples/all-clusters-app/nrfconnect/build/nrfconnect/zephyr/zephyr.elf \ + /tmp/bloat_reports/ + - name: Run unit tests for Zephyr native_posix_64 platform + if: github.event_name == 'push' || steps.changed_paths.outputs.tests == 'true' || steps.changed_paths.outputs.nrfconnect == 'true' + run: | + scripts/run_in_build_env.sh "./scripts/build/build_examples.py --target nrf-native-posix-64-tests build" + - name: Uploading Failed Test Logs + uses: actions/upload-artifact@v4 + if: ${{ failure() && !env.ACT }} + with: + name: test-log + path: | + src/test_driver/nrfconnect/build/Testing/Temporary/LastTest.log + + - name: Uploading Size Reports + uses: ./.github/actions/upload-size-reports + if: ${{ !env.ACT }} + with: + platform-name: nRFConnect diff --git a/.github/workflows/examples-nuttx.yaml b/.github/workflows/examples-nuttx.yaml new file mode 100644 index 0000000000..d1bf7594b0 --- /dev/null +++ b/.github/workflows/examples-nuttx.yaml @@ -0,0 +1,55 @@ +# Copyright (c) 2024 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: Build example - NuttX + +on: + push: + 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: + nuttx: + name: NuttX + + runs-on: ubuntu-latest + if: github.actor != 'restyled-io[bot]' + + container: + image: ghcr.io/project-chip/chip-build-nuttx:74 + volumes: + - "/tmp/bloat_reports:/tmp/bloat_reports" + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Checkout submodules & Bootstrap + uses: ./.github/actions/checkout-submodules-and-bootstrap + with: + platform: nuttx + extra-submodule-parameters: " --recursive" + - name: Build example simulator NuttX Lighting App + run: | + ./scripts/run_in_build_env.sh \ + "./scripts/build/build_examples.py \ + --target nuttx-x64-light \ + build \ + " diff --git a/.github/workflows/examples-nxp.yaml b/.github/workflows/examples-nxp.yaml new file mode 100644 index 0000000000..d09e893f29 --- /dev/null +++ b/.github/workflows/examples-nxp.yaml @@ -0,0 +1,287 @@ +# Copyright (c) 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: Build example - NXP + +on: + push: + branches-ignore: + - 'dependabot/**' + pull_request: + merge_group: + +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: + k32w0: + name: K32W0 + + env: + BUILD_TYPE: gn_k32w + + runs-on: ubuntu-latest + if: github.actor != 'restyled-io[bot]' + + container: + image: ghcr.io/project-chip/chip-build-k32w:74 + volumes: + - "/tmp/bloat_reports:/tmp/bloat_reports" + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Checkout submodules & Bootstrap + uses: ./.github/actions/checkout-submodules-and-bootstrap + with: + platform: nxp + + - name: Set up environment for size reports + uses: ./.github/actions/setup-size-reports + if: ${{ !env.ACT }} + with: + gh-context: ${{ toJson(github) }} + + - name: Build examples + run: | + scripts/run_in_build_env.sh "\ + ./scripts/build/build_examples.py \ + --target nxp-k32w0-freertos-lighting \ + --target nxp-k32w0-freertos-lighting-factory \ + --target nxp-k32w0-freertos-lighting-rotating-id \ + --target nxp-k32w0-freertos-contact-sensor \ + --target nxp-k32w0-freertos-contact-sensor-low-power \ + --target nxp-k32w0-freertos-contact-sensor-low-power-factory \ + build \ + --copy-artifacts-to out/artifacts \ + " + - name: Get lighting app size stats + run: | + .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ + nxp k32w0+release light \ + out/artifacts/nxp-k32w0-freertos-lighting/chip-k32w0x-light-example.elf \ + /tmp/bloat_reports/ + - name: Get contact sensor size stats + run: | + .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ + nxp k32w0+release contact \ + out/artifacts/nxp-k32w0-freertos-contact-sensor-low-power/chip-k32w0x-contact-example.elf \ + /tmp/bloat_reports/ + - name: Uploading Size Reports + uses: ./.github/actions/upload-size-reports + if: ${{ !env.ACT }} + with: + platform-name: K32W0 + k32w1: + name: K32W1 + + env: + BUILD_TYPE: gn_k32w + + runs-on: ubuntu-latest + if: github.actor != 'restyled-io[bot]' + + container: + image: ghcr.io/project-chip/chip-build-nxp:71 + volumes: + - "/tmp/bloat_reports:/tmp/bloat_reports" + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Checkout submodules & Bootstrap + uses: ./.github/actions/checkout-submodules-and-bootstrap + with: + platform: nxp + extra-submodule-parameters: --recursive + + - name: Set up environment for size reports + uses: ./.github/actions/setup-size-reports + if: ${{ !env.ACT }} + with: + gh-context: ${{ toJson(github) }} + + - name: Build examples + run: | + scripts/run_in_build_env.sh "\ + ./scripts/build/build_examples.py \ + --target nxp-k32w1-freertos-lighting \ + --target nxp-k32w1-freertos-contact-sensor-low-power \ + build \ + --copy-artifacts-to out/artifacts \ + " + - name: Get lighting app size stats + run: | + .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ + nxp k32w1+release light \ + out/artifacts/nxp-k32w1-freertos-lighting/chip-k32w1-light-example.elf \ + /tmp/bloat_reports/ + - name: Get contact sensor size stats + run: | + .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ + nxp k32w1+release contact \ + out/artifacts/nxp-k32w1-freertos-contact-sensor-low-power/chip-k32w1-contact-example.elf \ + /tmp/bloat_reports/ + - name: Uploading Size Reports + uses: ./.github/actions/upload-size-reports + if: ${{ !env.ACT }} + with: + platform-name: K32W1 + mcxw71: + name: MCXW71 + + env: + BUILD_TYPE: gn_k32w + + runs-on: ubuntu-latest + if: github.actor != 'restyled-io[bot]' + + container: + image: ghcr.io/project-chip/chip-build-nxp:71 + volumes: + - "/tmp/bloat_reports:/tmp/bloat_reports" + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Checkout submodules & Bootstrap + uses: ./.github/actions/checkout-submodules-and-bootstrap + with: + platform: nxp + extra-submodule-parameters: --recursive + + - name: Set up environment for size reports + uses: ./.github/actions/setup-size-reports + if: ${{ !env.ACT }} + with: + gh-context: ${{ toJson(github) }} + + - name: Build examples + run: | + scripts/run_in_build_env.sh "\ + ./scripts/build/build_examples.py \ + --target nxp-mcxw71-freertos-lighting \ + --target nxp-mcxw71-freertos-contact-sensor-low-power \ + build \ + --copy-artifacts-to out/artifacts \ + " + - name: Get lighting app size stats + run: | + .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ + nxp mcxw71+release light \ + out/artifacts/nxp-mcxw71-freertos-lighting/chip-mcxw71-light-example.elf \ + /tmp/bloat_reports/ + - name: Get contact sensor size stats + run: | + .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ + nxp mcxw71+release contact \ + out/artifacts/nxp-mcxw71-freertos-contact-sensor-low-power/chip-mcxw71-contact-example.elf \ + /tmp/bloat_reports/ + - name: Uploading Size Reports + uses: ./.github/actions/upload-size-reports + if: ${{ !env.ACT }} + with: + platform-name: MCXW71 + rw61x: + name: RW61X + + env: + BUILD_TYPE: gn_rw61x + + runs-on: ubuntu-latest + if: github.actor != 'restyled-io[bot]' + + container: + image: ghcr.io/project-chip/chip-build-nxp:74 + volumes: + - "/tmp/bloat_reports:/tmp/bloat_reports" + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Checkout submodules & Bootstrap + uses: ./.github/actions/checkout-submodules-and-bootstrap + with: + platform: nxp + extra-submodule-parameters: --recursive + + - name: Set up environment for size reports + uses: ./.github/actions/setup-size-reports + if: ${{ !env.ACT }} + with: + gh-context: ${{ toJson(github) }} + + - name: Build RW61X all clusters example app + run: | + scripts/run_in_build_env.sh "\ + ./scripts/build/build_examples.py \ + --target nxp-rw61x-freertos-all-clusters-wifi \ + --target nxp-rw61x-freertos-all-clusters-thread \ + --target nxp-rw61x-freertos-all-clusters-thread-wifi \ + build \ + --copy-artifacts-to out/artifacts \ + " + + - name: Build RW61X thermostat example app + run: | + scripts/run_in_build_env.sh "\ + ./scripts/build/build_examples.py \ + --target nxp-rw61x-freertos-thermostat-wifi \ + --target nxp-rw61x-freertos-thermostat-thread \ + --target nxp-rw61x-freertos-thermostat-thread-wifi \ + build \ + --copy-artifacts-to out/artifacts \ + " + + - name: Build RW61X laundry-washer example app + run: | + scripts/run_in_build_env.sh "\ + ./scripts/build/build_examples.py \ + --target nxp-rw61x-freertos-laundry-washer-wifi \ + --target nxp-rw61x-freertos-laundry-washer-thread \ + --target nxp-rw61x-freertos-laundry-washer-thread-wifi \ + build \ + --copy-artifacts-to out/artifacts \ + " + - name: Uploading Size Reports + uses: ./.github/actions/upload-size-reports + if: ${{ !env.ACT }} + with: + platform-name: RW61X + zephyr: + name: ZEPHYR_RW61X + + runs-on: ubuntu-latest + if: github.actor != 'restyled-io[bot]' + + container: + image: ghcr.io/project-chip/chip-build-nxp-zephyr:74 + + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Checkout submodules & Bootstrap + uses: ./.github/actions/checkout-submodules-and-bootstrap + with: + platform: nxp + + - name: Build RW61x Zephyr examples + run: | + scripts/run_in_build_env.sh "\ + ./scripts/build/build_examples.py \ + --target nxp-rw61x-zephyr-all-clusters \ + --target nxp-rw61x-zephyr-thermostat \ + --target nxp-rw61x-zephyr-laundry-washer-factory \ + build \ + " diff --git a/.github/workflows/examples-openiotsdk.yaml b/.github/workflows/examples-openiotsdk.yaml new file mode 100644 index 0000000000..d85a789a0b --- /dev/null +++ b/.github/workflows/examples-openiotsdk.yaml @@ -0,0 +1,220 @@ +# Copyright (c) 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: Build example - Open IoT SDK + +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: + openiotsdk: + name: Open IoT SDK examples building + + env: + TEST_NETWORK_NAME: OIStest + + runs-on: ubuntu-latest + if: github.actor != 'restyled-io[bot]' + + container: + image: ghcr.io/project-chip/chip-build-openiotsdk:74 + volumes: + - "/tmp/bloat_reports:/tmp/bloat_reports" + options: --privileged + + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Checkout submodules & Bootstrap + uses: ./.github/actions/checkout-submodules-and-bootstrap + with: + platform: openiotsdk linux + extra-submodule-parameters: " --recursive" + + - name: Set up environment for size reports + uses: ./.github/actions/setup-size-reports + if: ${{ !env.ACT }} + with: + gh-context: ${{ toJson(github) }} + + - name: Build and install Python controller + run: | + scripts/run_in_build_env.sh './scripts/build_python.sh --install_virtual_env out/venv' + scripts/run_in_python_env.sh out/venv 'pip install -r scripts/setup/requirements.openiotsdk.txt' + + - name: Build shell example + id: build_shell + run: | + scripts/examples/openiotsdk_example.sh shell + .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ + openiotsdk release shell \ + examples/shell/openiotsdk/build/chip-openiotsdk-shell-example.elf \ + /tmp/bloat_reports/ + + - name: "Test: shell example" + if: github.event_name == 'workflow_dispatch' && steps.build_shell.outcome == 'success' + run: | + scripts/run_in_python_env.sh out/venv \ + 'scripts/examples/openiotsdk_example.sh --no-activate -C test shell' + + - name: Clean shell output + run: rm -rf examples/shell/openiotsdk/build + + - name: Build lock-app example (mbedtls) + # Disabled being tracked here: https://github.com/project-chip/connectedhomeip/issues/28026 + if: false + id: build_lock_app_mbedtls + run: | + scripts/examples/openiotsdk_example.sh -b mbedtls lock-app + .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ + openiotsdk release lock-app-mbedtls \ + examples/lock-app/openiotsdk/build/chip-openiotsdk-lock-app-example.elf \ + /tmp/bloat_reports/ + + - name: Build tv-app example + id: build_tv_app + timeout-minutes: 10 + run: | + scripts/examples/openiotsdk_example.sh tv-app + .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ + openiotsdk release tv-app \ + examples/tv-app/openiotsdk/build/chip-openiotsdk-tv-app-example.elf \ + /tmp/bloat_reports/ + + - name: "Test: tv-app example" + if: github.event_name == 'workflow_dispatch' && steps.build_tv_app.outcome == 'success' + timeout-minutes: 10 + run: | + scripts/setup/openiotsdk/network_setup.sh -n $TEST_NETWORK_NAME up + scripts/run_in_python_env.sh out/venv \ + 'scripts/run_in_ns.sh ${TEST_NETWORK_NAME}ns scripts/examples/openiotsdk_example.sh --no-activate -C test -n ${TEST_NETWORK_NAME}tap tv-app' + scripts/setup/openiotsdk/network_setup.sh -n $TEST_NETWORK_NAME down + + - name: Clean tv-app output + run: rm -rf examples/tv-app/openiotsdk/build + + - name: Build all-clusters-app example + id: build_all_clusters_app + timeout-minutes: 10 + run: | + scripts/examples/openiotsdk_example.sh all-clusters-app + .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ + openiotsdk release all-clusters-app \ + examples/all-clusters-app/openiotsdk/build/chip-openiotsdk-all-clusters-app-example.elf \ + /tmp/bloat_reports/ + + - name: "Test: all-clusters-app example" + if: github.event_name == 'workflow_dispatch' && steps.build_all_clusters_app.outcome == 'success' + timeout-minutes: 5 + run: | + scripts/setup/openiotsdk/network_setup.sh -n $TEST_NETWORK_NAME up + scripts/run_in_python_env.sh out/venv \ + 'scripts/run_in_ns.sh ${TEST_NETWORK_NAME}ns scripts/examples/openiotsdk_example.sh --no-activate -C test -n ${TEST_NETWORK_NAME}tap all-clusters-app' + scripts/setup/openiotsdk/network_setup.sh -n $TEST_NETWORK_NAME down + + - name: Clean all-clusters-app output + run: rm -rf examples/all-clusters-app/openiotsdk/build + + - name: Build ota-requestor-app example + id: build_ota_requestor_app + timeout-minutes: 10 + run: | + scripts/examples/openiotsdk_example.sh -v 1 -V 0.0.1 ota-requestor-app + .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ + openiotsdk release ota-requestor-app \ + examples/ota-requestor-app/openiotsdk/build/chip-openiotsdk-ota-requestor-app-example.elf \ + /tmp/bloat_reports/ + + - name: Build unit tests (mbedtls) + # Disabled being tracked here: https://github.com/project-chip/connectedhomeip/issues/28026 + if: false + id: build_unit_tests_mbedtls + run: | + scripts/examples/openiotsdk_example.sh -b mbedtls unit-tests + + - name: Build the OTA provider (Linux) + id: build_ota_provider_app + if: steps.build_ota_requestor_app.outcome == 'success' + timeout-minutes: 10 + run: | + scripts/examples/gn_build_example.sh examples/ota-provider-app/linux/ out/ota-provider chip_config_network_layer_ble=false + + - name: "Test: lock-app example (mbedtls)" + if: github.event_name == 'workflow_dispatch' && steps.build_lock_app_mbedtls.outcome == 'success' + run: | + scripts/setup/openiotsdk/network_setup.sh -n $TEST_NETWORK_NAME up + scripts/run_in_python_env.sh out/venv \ + 'scripts/run_in_ns.sh ${TEST_NETWORK_NAME}ns scripts/examples/openiotsdk_example.sh --no-activate -C test -n ${TEST_NETWORK_NAME}tap lock-app' + scripts/setup/openiotsdk/network_setup.sh -n $TEST_NETWORK_NAME down + + - name: "Test: ota-requestor-app example" + if: github.event_name == 'workflow_dispatch' && steps.build_ota_requestor_app.outcome == 'success' && steps.build_ota_provider_app.outcome == 'success' + timeout-minutes: 30 + run: | + mkdir out/binaries + cp examples/ota-requestor-app/openiotsdk/build/chip-openiotsdk-ota-requestor-app-example.elf out/binaries/ + scripts/examples/openiotsdk_example.sh -c -v 2 -V 0.0.2 ota-requestor-app + cp examples/ota-requestor-app/openiotsdk/build/chip-openiotsdk-ota-requestor-app-example.ota out/binaries/ + scripts/setup/openiotsdk/network_setup.sh -n $TEST_NETWORK_NAME up + scripts/run_in_python_env.sh out/venv \ + 'scripts/run_in_ns.sh ${TEST_NETWORK_NAME}ns scripts/examples/openiotsdk_example.sh --no-activate -p out/binaries -v 2 -V 0.0.2 -C test -n ${TEST_NETWORK_NAME}tap ota-requestor-app' + scripts/setup/openiotsdk/network_setup.sh -n $TEST_NETWORK_NAME down + + - name: "Test: unit-tests (mbedtls)" + if: github.event_name == 'workflow_dispatch' && steps.build_unit_tests_mbedtls.outcome == 'success' + run: | + scripts/run_in_python_env.sh out/venv \ + 'scripts/examples/openiotsdk_example.sh --no-activate -C test unit-tests' + + - name: Build lock-app example (psa) + # Disabled being tracked here: https://github.com/project-chip/connectedhomeip/issues/28026 + if: false + id: build_lock_app_psa + run: | + scripts/examples/openiotsdk_example.sh -c -b psa lock-app + .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ + openiotsdk release lock-app-psa \ + examples/lock-app/openiotsdk/build/chip-openiotsdk-lock-app-example.elf \ + /tmp/bloat_reports/ + + - name: "Test: lock-app example (psa)" + if: github.event_name == 'workflow_dispatch' && steps.build_lock_app_psa.outcome == 'success' + run: | + scripts/setup/openiotsdk/network_setup.sh -n $TEST_NETWORK_NAME up + scripts/run_in_python_env.sh out/venv \ + 'scripts/run_in_ns.sh ${TEST_NETWORK_NAME}ns scripts/examples/openiotsdk_example.sh --no-activate -C test -n ${TEST_NETWORK_NAME}tap lock-app' + scripts/setup/openiotsdk/network_setup.sh -n $TEST_NETWORK_NAME down + + - name: Build unit tests (psa) + id: build_unit_tests_psa + run: | + scripts/examples/openiotsdk_example.sh -b psa unit-tests + + - name: "Test: unit-tests (psa)" + if: github.event_name == 'workflow_dispatch' && steps.build_unit_tests_psa.outcome == 'success' + run: | + scripts/run_in_python_env.sh out/venv \ + 'scripts/examples/openiotsdk_example.sh --no-activate -C test unit-tests' diff --git a/.github/workflows/examples-qpg.yaml b/.github/workflows/examples-qpg.yaml new file mode 100644 index 0000000000..18d47cf8ef --- /dev/null +++ b/.github/workflows/examples-qpg.yaml @@ -0,0 +1,89 @@ +# 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: Build example - QPG + +on: + push: + branches-ignore: + - 'dependabot/**' + pull_request: + merge_group: + +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: + qpg: + name: QPG + + env: + BUILD_TYPE: gn_qpg + + runs-on: ubuntu-latest + if: github.actor != 'restyled-io[bot]' + + container: + image: ghcr.io/project-chip/chip-build:74 + volumes: + - "/tmp/bloat_reports:/tmp/bloat_reports" + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Checkout submodules & Bootstrap + uses: ./.github/actions/checkout-submodules-and-bootstrap + with: + platform: qpg + + - name: Set up environment for size reports + uses: ./.github/actions/setup-size-reports + if: ${{ !env.ACT }} + with: + gh-context: ${{ toJson(github) }} + + - name: Build QPG6105 example apps + run: | + ./scripts/run_in_build_env.sh \ + "./scripts/build/build_examples.py \ + --enable-flashbundle \ + --target qpg-qpg6105-lock \ + --target qpg-qpg6105-light \ + --target qpg-qpg6105-light-switch \ + --target qpg-qpg6105-thermostat \ + build \ + --copy-artifacts-to out/artifacts \ + " + - name: Build Matter SDK library + run: | + config/qpg/chip-gn/build.sh + + - name: Prepare some bloat report from the previous builds + run: | + .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ + qpg qpg6105+debug lighting-app \ + out/qpg-qpg6105-light/chip-qpg6105-lighting-example.out \ + /tmp/bloat_reports/ + .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ + qpg qpg6105+debug lock-app \ + out/qpg-qpg6105-lock/chip-qpg6105-lock-example.out \ + /tmp/bloat_reports/ + - name: Uploading Size Reports + uses: ./.github/actions/upload-size-reports + if: ${{ !env.ACT }} + with: + platform-name: QPG diff --git a/.github/workflows/examples-stm32.yaml b/.github/workflows/examples-stm32.yaml new file mode 100644 index 0000000000..6c4fa05864 --- /dev/null +++ b/.github/workflows/examples-stm32.yaml @@ -0,0 +1,79 @@ +# 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: Build example - stm32 + +on: + push: + branches-ignore: + - 'dependabot/**' + pull_request: + merge_group: + +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: + stm32: + name: stm32 + timeout-minutes: 60 + + env: + BUILD_TYPE: gn_stm32 + + runs-on: ubuntu-latest + if: github.actor != 'restyled-io[bot]' + + container: + image: ghcr.io/project-chip/chip-build:74 + volumes: + - "/tmp/bloat_reports:/tmp/bloat_reports" + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Checkout submodules & Bootstrap + uses: ./.github/actions/checkout-submodules-and-bootstrap + with: + platform: stm32 + extra-submodule-parameters: --recursive + - name: Set up environment for size reports + uses: ./.github/actions/setup-size-reports + if: ${{ !env.ACT }} + with: + gh-context: ${{ toJson(github) }} + + - name: Build stm32 example apps + timeout-minutes: 20 + run: | + ./scripts/run_in_build_env.sh \ + "./scripts/build/build_examples.py \ + --target stm32-STM32WB5MM-DK-light build \ + " + + - name: Gather size reports + run: | + .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ + stm32 STM32WB5MM-DK light \ + out/stm32-stm32wb5mm-dk-light/chip-stm32-lighting-example.elf \ + /tmp/bloat_reports/ + + - name: Uploading Size Reports + uses: ./.github/actions/upload-size-reports + if: ${{ !env.ACT }} + with: + platform-name: stm32 diff --git a/.github/workflows/examples-telink.yaml b/.github/workflows/examples-telink.yaml new file mode 100644 index 0000000000..904ae98fbc --- /dev/null +++ b/.github/workflows/examples-telink.yaml @@ -0,0 +1,280 @@ +# Copyright (c) 2022-2024 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: Build example - Telink + +on: + push: + branches-ignore: + - 'dependabot/**' + pull_request: + merge_group: + +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: + telink: + name: Telink + env: + BUILD_TYPE: telink + + runs-on: ubuntu-latest + if: github.actor != 'restyled-io[bot]' + + container: + image: ghcr.io/project-chip/chip-build-telink:74 + volumes: + - "/tmp/bloat_reports:/tmp/bloat_reports" + + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Checkout submodules & Bootstrap + uses: ./.github/actions/checkout-submodules-and-bootstrap + with: + platform: telink + + - name: Set up environment for size reports + uses: ./.github/actions/setup-size-reports + if: ${{ !env.ACT }} + with: + gh-context: ${{ toJson(github) }} + + # - name: Update Zephyr to specific revision (for developers purpose) + # run: scripts/run_in_build_env.sh "python3 scripts/tools/telink/update_zephyr.py ab81a585fca6a83b30e1f4e58a021113d6a3acb8" + + - name: Build example Telink (B92 retention) Air Quality Sensor App + run: | + ./scripts/run_in_build_env.sh \ + "./scripts/build/build_examples.py --target 'telink-tlsr9528a_retention-air-quality-sensor' build" + .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ + telink tlsr9528a_retention air-quality-sensor-app \ + out/telink-tlsr9528a_retention-air-quality-sensor/zephyr/zephyr.elf \ + /tmp/bloat_reports/ + + - name: clean out build output + run: rm -rf ./out + + - name: Build example Telink (W91) All Clusters App + run: | + ./scripts/run_in_build_env.sh \ + "./scripts/build/build_examples.py --target 'telink-tlsr9118bdk40d-all-clusters' build" + .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ + telink tlsr9118bdk40d all-clusters-app \ + out/telink-tlsr9118bdk40d-all-clusters/zephyr/zephyr.elf \ + /tmp/bloat_reports/ + + - name: clean out build output + run: rm -rf ./out + + - name: Build example Telink (B92) All Clusters Minimal App + run: | + ./scripts/run_in_build_env.sh \ + "./scripts/build/build_examples.py --target 'telink-tlsr9528a-all-clusters-minimal' build" + .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ + telink tlsr9528a all-clusters-minimal-app \ + out/telink-tlsr9528a-all-clusters-minimal/zephyr/zephyr.elf \ + /tmp/bloat_reports/ + + - name: clean out build output + run: rm -rf ./out + + - name: Build example Telink (B95) Bridge App + run: | + ./scripts/run_in_build_env.sh \ + "./scripts/build/build_examples.py --target 'telink-tlsr9258a-bridge' build" + .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ + telink tlsr9258a bridge-app \ + out/telink-tlsr9258a-bridge/zephyr/zephyr.elf \ + /tmp/bloat_reports/ + + - name: clean out build output + run: rm -rf ./out + + - name: Build example Telink (B92 retention) Contact Sensor App + run: | + ./scripts/run_in_build_env.sh \ + "./scripts/build/build_examples.py --target 'telink-tlsr9528a_retention-contact-sensor' build" + .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ + telink tlsr9528a_retention contact-sensor-app \ + out/telink-tlsr9528a_retention-contact-sensor/zephyr/zephyr.elf \ + /tmp/bloat_reports/ + + - name: clean out build output + run: rm -rf ./out + + - name: Build tools required for Factory Data + run: | + ./scripts/checkout_submodules.py --allow-changing-global-git-config --shallow --platform linux + ./scripts/build/gn_gen.sh + ./scripts/run_in_build_env.sh "ninja -C ./out/$BUILD_TYPE chip-cert chip-tool spake2p" + mv ./out/$BUILD_TYPE/chip-cert ./out/$BUILD_TYPE/chip-tool ./out/$BUILD_TYPE/spake2p ./out + + - name: clean out build output (keep tools) + run: rm -rf ./out/telink* + + - name: Build example Telink (W91) Lighting App with OTA, Factory Data + run: | + ./scripts/run_in_build_env.sh \ + "./scripts/build/build_examples.py --target 'telink-tlsr9118bdk40d-light-ota-factory-data' build" + .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ + telink tlsr9118bdk40d lighting-app-ota-factory-data \ + out/telink-tlsr9118bdk40d-light-ota-factory-data/zephyr/zephyr.elf \ + /tmp/bloat_reports/ + + - name: clean out build output (keep tools) + run: rm -rf ./out/telink* + + - name: Build example Telink (B91) Lighting App with OTA, RPC, Factory Data and 4Mb flash + run: | + ./scripts/run_in_build_env.sh \ + "./scripts/build/build_examples.py --target 'telink-tlsr9518adk80d-light-ota-rpc-factory-data-4mb' build" + .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ + telink tlsr9518adk80d lighting-app-ota-rpc-factory-data-4mb \ + out/telink-tlsr9518adk80d-light-ota-rpc-factory-data-4mb/zephyr/zephyr.elf \ + /tmp/bloat_reports/ + + - name: clean out build output (keep tools) + run: rm -rf ./out/telink* + + - name: Build example Telink (B92) Light Switch App with OTA, Shell, Factory Data + run: | + ./scripts/run_in_build_env.sh \ + "./scripts/build/build_examples.py --target 'telink-tlsr9528a-light-switch-ota-shell-factory-data' build" + .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ + telink tlsr9528a light-switch-app-ota-shell-factory-data \ + out/telink-tlsr9528a-light-switch-ota-shell-factory-data/zephyr/zephyr.elf \ + /tmp/bloat_reports/ + + - name: clean out build output + run: rm -rf ./out + + - name: Build example Telink (B92) Lock App with DFU + run: | + ./scripts/run_in_build_env.sh \ + "./scripts/build/build_examples.py --target 'telink-tlsr9528a-lock-dfu' build" + .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ + telink tlsr9528a lock-app-dfu \ + out/telink-tlsr9528a-lock-dfu/zephyr/zephyr.elf \ + /tmp/bloat_reports/ + + - name: clean out build output + run: rm -rf ./out + + - name: Build example Telink (B95) OTA Requestor App + run: | + ./scripts/run_in_build_env.sh \ + "./scripts/build/build_examples.py --target 'telink-tlsr9258a-ota-requestor' build" + .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ + telink tlsr9258a ota-requestor-app \ + out/telink-tlsr9258a-ota-requestor/zephyr/zephyr.elf \ + /tmp/bloat_reports/ + + - name: clean out build output + run: rm -rf ./out + + - name: Build example Telink (B91 USB) Pump App + run: | + ./scripts/run_in_build_env.sh \ + "./scripts/build/build_examples.py --target 'telink-tlsr9518adk80d-pump-usb' build" + .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ + telink tlsr9518adk80d pump-app-usb \ + out/telink-tlsr9518adk80d-pump-usb/zephyr/zephyr.elf \ + /tmp/bloat_reports/ + + - name: clean out build output + run: rm -rf ./out + + - name: Build example Telink (B91) Pump Controller App + run: | + ./scripts/run_in_build_env.sh \ + "./scripts/build/build_examples.py --target 'telink-tlsr9518adk80d-pump-controller' build" + .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ + telink tlsr9518adk80d pump-controller-app \ + out/telink-tlsr9518adk80d-pump-controller/zephyr/zephyr.elf \ + /tmp/bloat_reports/ + + - name: clean out build output + run: rm -rf ./out + + - name: Build example Telink (B91) Shell App + run: | + ./scripts/run_in_build_env.sh \ + "./scripts/build/build_examples.py --target 'telink-tlsr9518adk80d-shell' build" + .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ + telink tlsr9518adk80d shell \ + out/telink-tlsr9518adk80d-shell/zephyr/zephyr.elf \ + /tmp/bloat_reports/ + + - name: clean out build output + run: rm -rf ./out + + - name: Build example Telink (B92 retention) Smoke CO Alarm App + run: | + ./scripts/run_in_build_env.sh \ + "./scripts/build/build_examples.py --target 'telink-tlsr9528a_retention-smoke-co-alarm' build" + .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ + telink tlsr9528a_retention smoke_co_alarm-app \ + out/telink-tlsr9528a_retention-smoke-co-alarm/zephyr/zephyr.elf \ + /tmp/bloat_reports/ + + - name: clean out build output + run: rm -rf ./out + + - name: Build example Telink (B91 Mars) Temperature Measurement App with OTA + run: | + ./scripts/run_in_build_env.sh \ + "./scripts/build/build_examples.py --target 'telink-tlsr9518adk80d-temperature-measurement-mars-ota' build" + .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ + telink tlsr9518adk80d temperature-measurement-app-mars-ota \ + out/telink-tlsr9518adk80d-temperature-measurement-mars-ota/zephyr/zephyr.elf \ + /tmp/bloat_reports/ + + - name: clean out build output + run: rm -rf ./out + + - name: Build example Telink (B91) Thermostat App + run: | + ./scripts/run_in_build_env.sh \ + "./scripts/build/build_examples.py --target 'telink-tlsr9518adk80d-thermostat' build" + .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ + telink tlsr9518adk80d thermostat \ + out/telink-tlsr9518adk80d-thermostat/zephyr/zephyr.elf \ + /tmp/bloat_reports/ + + - name: clean out build output + run: rm -rf ./out + + - name: Build example Telink (W91) Window Covering App + run: | + ./scripts/run_in_build_env.sh \ + "./scripts/build/build_examples.py --target 'telink-tlsr9118bdk40d-window-covering' build" + .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ + telink tlsr9118bdk40d window-covering \ + out/telink-tlsr9118bdk40d-window-covering/zephyr/zephyr.elf \ + /tmp/bloat_reports/ + + - name: clean out build output + run: rm -rf ./out + + - name: Uploading Size Reports + uses: ./.github/actions/upload-size-reports + if: ${{ !env.ACT }} + with: + platform-name: Telink diff --git a/.github/workflows/examples-tizen.yaml b/.github/workflows/examples-tizen.yaml new file mode 100644 index 0000000000..f6571342a8 --- /dev/null +++ b/.github/workflows/examples-tizen.yaml @@ -0,0 +1,86 @@ +# Copyright (c) 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: Build example - Tizen + +on: + push: + branches-ignore: + - 'dependabot/**' + pull_request: + merge_group: + +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: + tizen: + name: Tizen + + runs-on: ubuntu-latest + if: github.actor != 'restyled-io[bot]' + + container: + image: ghcr.io/project-chip/chip-build-tizen:74 + options: --user root + volumes: + - "/tmp/bloat_reports:/tmp/bloat_reports" + - "/tmp/output_binaries:/tmp/output_binaries" + + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Checkout submodules & Bootstrap + uses: ./.github/actions/checkout-submodules-and-bootstrap + with: + platform: tizen + + - name: Set up environment for size reports + uses: ./.github/actions/setup-size-reports + if: ${{ !env.ACT }} + with: + gh-context: ${{ toJson(github) }} + + - name: Build Tizen examples + run: | + ./scripts/run_in_build_env.sh \ + "./scripts/build/build_examples.py \ + --enable-flashbundle \ + --target tizen-arm-all-clusters \ + --target tizen-arm-chip-tool-ubsan \ + --target tizen-arm-light-with-ui \ + build \ + --copy-artifacts-to out/artifacts \ + " + + - name: Bloat report - chip-tool + run: | + .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ + tizen arm chip-tool-ubsan out/tizen-arm-chip-tool-ubsan/chip-tool \ + /tmp/bloat_reports/ + - name: Bloat report - all-clusters-app + run: | + .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ + tizen arm all-clusters-app out/tizen-arm-all-clusters/chip-all-clusters-app \ + /tmp/bloat_reports/ + + - name: Uploading Size Reports + uses: ./.github/actions/upload-size-reports + if: ${{ !env.ACT }} + with: + platform-name: Tizen diff --git a/.github/workflows/full-android.yaml b/.github/workflows/full-android.yaml new file mode 100644 index 0000000000..43aee09a82 --- /dev/null +++ b/.github/workflows/full-android.yaml @@ -0,0 +1,117 @@ +# Copyright (c) 2020 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: Full builds - Android + +on: + push: + branches-ignore: + - 'dependabot/**' + workflow_dispatch: + +concurrency: + group: full-${{ 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: + full_android: + name: Run + + env: + JAVA_HOME: /usr/lib/jvm/java-8-openjdk-amd64/ + + runs-on: ubuntu-latest + if: github.actor != 'restyled-io[bot]' + + container: + image: ghcr.io/project-chip/chip-build-android:74 + volumes: + - "/tmp/log_output:/tmp/test_logs" + + steps: + - uses: actions/checkout@v4 + name: Checkout + with: + token: ${{ github.token }} + # To use act like: + # act -j full_android + # + # Note you likely still need to have non submodules setup for the + # local machine, like: + # git submodule deinit --all + - uses: actions/checkout@v4 + if: ${{ env.ACT }} + name: Checkout (ACT for local build) + - name: Checkout submodules & Bootstrap + uses: ./.github/actions/checkout-submodules-and-bootstrap + with: + platform: android + + - name: Cleanup pigweed CIPD packages + # This should not generally be needed, however android CI runs out of space + # We do not need pigweed cross compile here because we use android NDK + # compilers. Removing this package saves a significant amount of space. + continue-on-error: true + run: | + du -sh .environment/cipd/packages/arm + rm -rf .environment/cipd/packages/arm + - name: Build Android arm-chip-tool + run: | + ./scripts/run_in_build_env.sh \ + "./scripts/build/build_examples.py --target android-arm-chip-tool build" + - name: Clean out build output + run: rm -rf ./out examples/android/CHIPTool/app/libs/jniLibs/* examples/android/CHIPTool/app/libs/*.jar + - name: Build Android arm-tv-casting-app + run: | + ./scripts/run_in_build_env.sh \ + "./scripts/build/build_examples.py --target android-arm-tv-casting-app build" + - name: Clean out build output + run: rm -rf ./out examples/tv-casting-app/android/App/app/libs/jniLibs/* examples/tv-casting-app/android/App/app/libs/*.jar + - name: Build Android arm-tv-server + run: | + ./scripts/run_in_build_env.sh \ + "./scripts/build/build_examples.py --target android-arm-tv-server build" + - name: Clean out build output + run: rm -rf ./out examples/tv-app/android/App/app/libs/jniLibs/* examples/tv-app/android/App/app/libs/*.jar + - name: Build Android arm64-tv-casting-app + run: | + ./scripts/run_in_build_env.sh \ + "./scripts/build/build_examples.py --target android-arm64-tv-casting-app build" + - name: Clean out build output + run: rm -rf ./out examples/tv-casting-app/android/app/libs/jniLibs/* examples/android/CHIPTool/app/libs/*.jar + - name: Build Android arm64-tv-server + run: | + ./scripts/run_in_build_env.sh \ + "./scripts/build/build_examples.py --target android-arm64-tv-server build" + - name: Clean out build output + run: rm -rf ./out examples/tv-app/android/App/app/libs/jniLibs/* examples/tv-app/android/App/app/libs/*.jar + - name: Build Android arm64-chip-tool + run: | + ./scripts/run_in_build_env.sh \ + "./scripts/build/build_examples.py --target android-arm64-chip-tool build" + - name: Run Android build rule tests + run: | + ./scripts/run_in_build_env.sh \ + "ninja -C out/android-arm64-chip-tool build/chip/java/tests:java_build_test" + - name: Clean out build output + run: rm -rf ./out examples/android/CHIPTool/app/libs/jniLibs/* examples/android/CHIPTool/app/libs/*.jar + - name: Build Android arm64-chip-test + run: | + ./scripts/run_in_build_env.sh \ + "./scripts/build/build_examples.py --target android-arm64-chip-test build" + - name: Clean out build output + run: rm -rf ./out examples/android/CHIPTest/app/libs/jniLibs/* examples/android/CHIPTest/app/libs/*.jar diff --git a/.github/workflows/fuzzing-build.yaml b/.github/workflows/fuzzing-build.yaml new file mode 100644 index 0000000000..d839317bc4 --- /dev/null +++ b/.github/workflows/fuzzing-build.yaml @@ -0,0 +1,101 @@ +# Copyright (c) 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: Fuzzing Builds + +on: + # For now, only manual triggers. + 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: + build_linux_fuzzing: + name: Build on Linux + + runs-on: ubuntu-latest + if: github.actor != 'restyled-io[bot]' + + container: + image: ghcr.io/project-chip/chip-build:74 + volumes: + - "/tmp/log_output:/tmp/test_logs" + + steps: + - name: Checkout + uses: actions/checkout@v4 + - run: apt-get update + - run: apt-get install --fix-missing llvm-10 clang-10 + - name: Try to ensure the objdir-clone dir exists + run: | + mkdir objdir-clone || true + + - name: Bootstrap + uses: ./.github/actions/bootstrap + + - name: Build all-clusters-app + run: | + ./scripts/run_in_build_env.sh \ + "./scripts/build/build_examples.py \ + --target linux-x64-all-clusters-no-ble-libfuzzer \ + build \ + --copy-artifacts-to objdir-clone \ + " + - name: Uploading binaries + uses: actions/upload-artifact@v4 + if: ${{ !env.ACT }} + with: + name: objdir-linux + path: objdir-clone/ + # objdirs are big; don't hold on to them too long. + retention-days: 5 + + build_darwin_fuzzing: + name: Build on Darwin + runs-on: macos-13 + if: github.actor != 'restyled-io[bot]' + + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Setup Environment + run: brew install llvm + - name: Try to ensure the objdir-clone dir exists + run: | + mkdir objdir-clone || true + + - name: Bootstrap + uses: ./.github/actions/bootstrap + + - name: Build all-clusters-app + run: | + ./scripts/run_in_build_env.sh \ + "./scripts/build/build_examples.py \ + --target darwin-x64-all-clusters-no-ble-asan-libfuzzer-clang \ + build \ + --copy-artifacts-to objdir-clone \ + " + - name: Uploading binaries + uses: actions/upload-artifact@v4 + if: ${{ !env.ACT }} + with: + name: crash-darwin + path: objdir-clone/ + # objdirs are big; don't hold on to them too long. + retention-days: 5 diff --git a/.github/workflows/gradle-wrapper-validation.yml b/.github/workflows/gradle-wrapper-validation.yml new file mode 100644 index 0000000000..ab3f499423 --- /dev/null +++ b/.github/workflows/gradle-wrapper-validation.yml @@ -0,0 +1,20 @@ +name: "Validate Gradle Wrapper" +on: + push: + branches-ignore: + - 'dependabot/**' + pull_request: + +jobs: + validation: + name: "Validation" + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: Wandalen/wretry.action@v1.4.5 + name: Gradle Validation + continue-on-error: true + with: + action: gradle/wrapper-validation-action@v1 + attempt_limit: 3 + attempt_delay: 2000 diff --git a/.github/workflows/issue-labeler.yaml b/.github/workflows/issue-labeler.yaml new file mode 100644 index 0000000000..a92a4c212d --- /dev/null +++ b/.github/workflows/issue-labeler.yaml @@ -0,0 +1,20 @@ +name: "Issue Labeler" +on: + issues: + types: [opened, edited] + +permissions: + issues: write + contents: read + +jobs: + triage: + runs-on: ubuntu-latest + steps: + - uses: github/issue-labeler@v3.4 #May not be the latest version + with: + configuration-path: .github/issue-labeler.yml + not-before: 2020-01-15T02:54:34Z + enable-versioned-regex: 0 + sync-labels: 1 + repo-token: ${{ github.token }} \ No newline at end of file diff --git a/.github/workflows/java-tests.yaml b/.github/workflows/java-tests.yaml new file mode 100644 index 0000000000..a43fdfb7f4 --- /dev/null +++ b/.github/workflows/java-tests.yaml @@ -0,0 +1,308 @@ +# Copyright (c) 2023 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: Java Tests + +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: + java_tests_linux: + name: Linux + + env: + TSAN_OPTIONS: "halt_on_error=1 suppressions=scripts/tests/chiptest/tsan-linux-suppressions.txt" + + if: github.actor != 'restyled-io[bot]' + runs-on: ubuntu-latest + + container: + image: ghcr.io/project-chip/chip-build-java:74 + options: --privileged --sysctl "net.ipv6.conf.all.disable_ipv6=0 + net.ipv4.conf.all.forwarding=0 net.ipv6.conf.all.forwarding=0" + + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Checkout submodules & Bootstrap + uses: ./.github/actions/checkout-submodules-and-bootstrap + with: + platform: linux + bootstrap-log-name: bootstrap-logs-linux-${{ matrix.build_variant }}${{ matrix.chip_tool }} + - name: Try to ensure the directories for core dumping exist and we + can write them. + run: | + mkdir /tmp/cores || true + sysctl -w kernel.core_pattern=/tmp/cores/core.%u.%p.%t || true + mkdir objdir-clone || true + - name: Generate unit tests + run: | + scripts/run_in_build_env.sh \ + './scripts/build/build_examples.py \ + --target linux-x64-tests \ + gen \ + ' + - name: Build unit tests + run: scripts/run_in_build_env.sh 'ninja -C out/linux-x64-tests src:java_controller_tests' + + - name: Run unit tests + # TODO: this direct path loading is not maintainable. Our build system should define and + # support test classes. + run: | + $JAVA_PATH/bin/java \ + -cp 'third_party/java_deps/artifacts/*:out/linux-x64-tests/lib/src/controller/java/*' \ + org.junit.runner.JUnitCore \ + matter.tlv.TlvWriterTest \ + matter.tlv.TlvReadWriteTest \ + matter.tlv.TlvReaderTest \ + matter.jsontlv.JsonToTlvToJsonTest \ + matter.onboardingpayload.ManualCodeTest \ + matter.onboardingpayload.QRCodeTest + - name: Build Java Matter Controller and all clusters app + run: | + scripts/run_in_build_env.sh './scripts/build_python.sh --install_virtual_env out/venv' + scripts/run_in_python_env.sh out/venv 'pip install -r scripts/setup/requirements.build.txt' + scripts/run_in_python_env.sh out/venv 'pip install colorama' + ./scripts/run_in_build_env.sh \ + "./scripts/build/build_examples.py \ + --target linux-x64-all-clusters-ipv6only-no-ble-no-wifi-tsan-clang-test \ + --target linux-x64-java-matter-controller \ + --target linux-x64-lit-icd-ipv6only \ + build \ + " + - name: Build Kotlin Matter Controller + run: | + ./scripts/run_in_build_env.sh \ + "./scripts/build/build_examples.py \ + --target linux-x64-kotlin-matter-controller \ + build \ + " + - name: Run Discover Commissionables Test + run: | + scripts/run_in_python_env.sh out/venv \ + './scripts/tests/run_java_test.py \ + --app out/linux-x64-all-clusters-ipv6only-no-ble-no-wifi-tsan-clang-test/chip-all-clusters-app \ + --app-args "--discriminator 3840 --interface-id -1" \ + --tool-path out/linux-x64-java-matter-controller \ + --tool-cluster "discover" \ + --tool-args "commissionables" \ + --factoryreset \ + ' + - name: Run Pairing Onnetwork Test + run: | + scripts/run_in_python_env.sh out/venv \ + './scripts/tests/run_java_test.py \ + --app out/linux-x64-all-clusters-ipv6only-no-ble-no-wifi-tsan-clang-test/chip-all-clusters-app \ + --app-args "--discriminator 3840 --interface-id -1" \ + --tool-path out/linux-x64-java-matter-controller \ + --tool-cluster "pairing" \ + --tool-args "onnetwork-long --nodeid 1 --setup-pin-code 20202021 --discriminator 3840 -t 1000" \ + --factoryreset \ + ' + - name: Run IM Invoke Test + run: | + scripts/run_in_python_env.sh out/venv \ + './scripts/tests/run_java_test.py \ + --app out/linux-x64-all-clusters-ipv6only-no-ble-no-wifi-tsan-clang-test/chip-all-clusters-app \ + --app-args "--discriminator 3840 --interface-id -1" \ + --tool-path out/linux-x64-java-matter-controller \ + --tool-cluster "im" \ + --tool-args "onnetwork-long-im-invoke --nodeid 1 --setup-pin-code 20202021 --discriminator 3840 -t 1000" \ + --factoryreset \ + ' + - name: Run IM Extendable Invoke Test + run: | + scripts/run_in_python_env.sh out/venv \ + './scripts/tests/run_java_test.py \ + --app out/linux-x64-all-clusters-ipv6only-no-ble-no-wifi-tsan-clang-test/chip-all-clusters-app \ + --app-args "--discriminator 3840 --interface-id -1" \ + --tool-path out/linux-x64-java-matter-controller \ + --tool-cluster "im" \ + --tool-args "onnetwork-long-im-extendable-invoke --nodeid 1 --setup-pin-code 20202021 --discriminator 3840 -t 1000" \ + --factoryreset \ + ' + - name: Run IM Read Test + run: | + scripts/run_in_python_env.sh out/venv \ + './scripts/tests/run_java_test.py \ + --app out/linux-x64-all-clusters-ipv6only-no-ble-no-wifi-tsan-clang-test/chip-all-clusters-app \ + --app-args "--discriminator 3840 --interface-id -1" \ + --tool-path out/linux-x64-java-matter-controller \ + --tool-cluster "im" \ + --tool-args "onnetwork-long-im-read --nodeid 1 --setup-pin-code 20202021 --discriminator 3840 -t 3000" \ + --factoryreset \ + ' + - name: Run IM Write Test + run: | + scripts/run_in_python_env.sh out/venv \ + './scripts/tests/run_java_test.py \ + --app out/linux-x64-all-clusters-ipv6only-no-ble-no-wifi-tsan-clang-test/chip-all-clusters-app \ + --app-args "--discriminator 3840 --interface-id -1" \ + --tool-path out/linux-x64-java-matter-controller \ + --tool-cluster "im" \ + --tool-args "onnetwork-long-im-write --nodeid 1 --setup-pin-code 20202021 --discriminator 3840 -t 1000" \ + --factoryreset \ + ' + - name: Run IM Subscribe Test + run: | + scripts/run_in_python_env.sh out/venv \ + './scripts/tests/run_java_test.py \ + --app out/linux-x64-all-clusters-ipv6only-no-ble-no-wifi-tsan-clang-test/chip-all-clusters-app \ + --app-args "--discriminator 3840 --interface-id -1" \ + --tool-path out/linux-x64-java-matter-controller \ + --tool-cluster "im" \ + --tool-args "onnetwork-long-im-subscribe --nodeid 1 --setup-pin-code 20202021 --discriminator 3840 -t 3000" \ + --factoryreset \ + ' + - name: Run Pairing AlreadyDiscovered Test + run: | + scripts/run_in_python_env.sh out/venv \ + './scripts/tests/run_java_test.py \ + --app out/linux-x64-all-clusters-ipv6only-no-ble-no-wifi-tsan-clang-test/chip-all-clusters-app \ + --app-args "--discriminator 3840 --interface-id -1" \ + --tool-path out/linux-x64-java-matter-controller \ + --tool-cluster "pairing" \ + --tool-args "already-discovered --nodeid 1 --setup-pin-code 20202021 --address ::1 --port 5540 -t 1000" \ + --factoryreset \ + ' + # Disabled due to failure: https://github.com/project-chip/connectedhomeip/issues/27361 + # - name: Run Pairing Address-PaseOnly Test + # run: | + # scripts/run_in_python_env.sh out/venv \ + # './scripts/tests/run_java_test.py \ + # --app out/linux-x64-all-clusters-ipv6only-no-ble-no-wifi-tsan-clang-test/chip-all-clusters-app \ + # --app-args "--discriminator 3840 --interface-id -1" \ + # --tool-path out/linux-x64-java-matter-controller \ + # --tool-cluster "pairing" \ + # --tool-args "address-paseonly --nodeid 1 --setup-pin-code 20202021 --address ::1 --port 5540 -t 1000" \ + # --factoryreset \ + # ' + - name: Run Pairing SetupQRCode Test + run: | + scripts/run_in_python_env.sh out/venv \ + './scripts/tests/run_java_test.py \ + --app out/linux-x64-all-clusters-ipv6only-no-ble-no-wifi-tsan-clang-test/chip-all-clusters-app \ + --app-args "--discriminator 3840 --interface-id -1" \ + --tool-path out/linux-x64-java-matter-controller \ + --tool-cluster "pairing" \ + --tool-args "code --nodeid 1 --setup-payload MT:-24J0AFN00KA0648G00 --discover-once 1 --use-only-onnetwork-discovery 0 -t 1000" \ + --factoryreset \ + ' + - name: Run Pairing ManualCode Test + run: | + scripts/run_in_python_env.sh out/venv \ + './scripts/tests/run_java_test.py \ + --app out/linux-x64-all-clusters-ipv6only-no-ble-no-wifi-tsan-clang-test/chip-all-clusters-app \ + --app-args "--discriminator 3840 --interface-id -1" \ + --tool-path out/linux-x64-java-matter-controller \ + --tool-cluster "pairing" \ + --tool-args "code --nodeid 1 --setup-payload 34970112332 --discover-once 1 --use-only-onnetwork-discovery 0 -t 1000" \ + --factoryreset \ + ' + - name: Run Pairing ICD Onnetwork Test + run: | + scripts/run_in_python_env.sh out/venv \ + './scripts/tests/run_java_test.py \ + --app out/linux-x64-lit-icd-ipv6only/lit-icd-app \ + --app-args "--discriminator 3840 --interface-id -1" \ + --tool-path out/linux-x64-java-matter-controller \ + --tool-cluster "pairing" \ + --tool-args "onnetwork-long --nodeid 1 --setup-pin-code 20202021 --discriminator 3840 -t 1000" \ + --factoryreset \ + ' + - name: Run Pairing Onnetwork Test + run: | + scripts/run_in_python_env.sh out/venv \ + './scripts/tests/run_kotlin_test.py \ + --app out/linux-x64-all-clusters-ipv6only-no-ble-no-wifi-tsan-clang-test/chip-all-clusters-app \ + --app-args "--discriminator 3840 --interface-id -1" \ + --tool-path out/linux-x64-kotlin-matter-controller \ + --tool-cluster "pairing" \ + --tool-args "onnetwork-long --nodeid 1 --setup-pin-code 20202021 --discriminator 3840 -t 1000" \ + --factoryreset \ + ' + - name: Run Kotlin IM Invoke Test + run: | + scripts/run_in_python_env.sh out/venv \ + './scripts/tests/run_kotlin_test.py \ + --app out/linux-x64-all-clusters-ipv6only-no-ble-no-wifi-tsan-clang-test/chip-all-clusters-app \ + --app-args "--discriminator 3840 --interface-id -1" \ + --tool-path out/linux-x64-kotlin-matter-controller \ + --tool-cluster "im" \ + --tool-args "onnetwork-long-im-invoke --nodeid 1 --setup-pin-code 20202021 --discriminator 3840 -t 1000" \ + --factoryreset \ + ' + - name: Run Kotlin IM Read Test + run: | + scripts/run_in_python_env.sh out/venv \ + './scripts/tests/run_kotlin_test.py \ + --app out/linux-x64-all-clusters-ipv6only-no-ble-no-wifi-tsan-clang-test/chip-all-clusters-app \ + --app-args "--discriminator 3840 --interface-id -1" \ + --tool-path out/linux-x64-kotlin-matter-controller \ + --tool-cluster "im" \ + --tool-args "onnetwork-long-im-read --nodeid 1 --setup-pin-code 20202021 --discriminator 3840 -t 3000" \ + --factoryreset \ + ' + - name: Run Kotlin IM Write Test + run: | + scripts/run_in_python_env.sh out/venv \ + './scripts/tests/run_kotlin_test.py \ + --app out/linux-x64-all-clusters-ipv6only-no-ble-no-wifi-tsan-clang-test/chip-all-clusters-app \ + --app-args "--discriminator 3840 --interface-id -1" \ + --tool-path out/linux-x64-kotlin-matter-controller \ + --tool-cluster "im" \ + --tool-args "onnetwork-long-im-write --nodeid 1 --setup-pin-code 20202021 --discriminator 3840 -t 1000" \ + --factoryreset \ + ' + - name: Run Kotlin IM Subscribe Test + run: | + scripts/run_in_python_env.sh out/venv \ + './scripts/tests/run_kotlin_test.py \ + --app out/linux-x64-all-clusters-ipv6only-no-ble-no-wifi-tsan-clang-test/chip-all-clusters-app \ + --app-args "--discriminator 3840 --interface-id -1" \ + --tool-path out/linux-x64-kotlin-matter-controller \ + --tool-cluster "im" \ + --tool-args "onnetwork-long-im-subscribe --nodeid 1 --setup-pin-code 20202021 --discriminator 3840 -t 3000" \ + --factoryreset \ + ' + - name: Uploading core files + uses: actions/upload-artifact@v4 + if: ${{ failure() && !env.ACT }} + with: + name: crash-core-linux-java-controller + path: /tmp/cores/ + # Cores are big; don't hold on to them too long. + retention-days: 5 + - name: Uploading objdir for debugging + uses: actions/upload-artifact@v4 + if: ${{ failure() && !env.ACT }} + with: + name: crash-objdir-linux-java-controller + path: objdir-clone/ + # objdirs are big; don't hold on to them too long. + retention-days: 5 diff --git a/.github/workflows/kotlin-style.yaml b/.github/workflows/kotlin-style.yaml new file mode 100644 index 0000000000..a8d3282689 --- /dev/null +++ b/.github/workflows/kotlin-style.yaml @@ -0,0 +1,70 @@ +name: Kotlin + +on: + pull_request: + paths: + - "**/*.kt" + - ".github/workflows/kotlin-style.yaml" + - "kotlin-detect-config.yaml" + +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: + detekt: + name: Static code analysis + runs-on: ubuntu-latest + + steps: + - name: "checkout" + uses: actions/checkout@v4 + + - name: "detekt" + uses: natiginfo/action-detekt-all@1.23.6 + # Detekt seems not to like circular symlinks, so we set up + # explicit paths below + # + # In particular, if symlinks exist and recurse, detekt tries to + # follow, so for example `examples/android/CHIPTest` as a path + # will never end (and eventually run out of HEAP) because + # `examples/android/CHIPTest/third_party/connectedhomeip` is + # circular + with: + args: --parallel --build-upon-default-config --config kotlin-detect-config.yaml --input examples/android/CHIPTest/app,examples/android/CHIPTool,examples/java-matter-controller/java,src/controller/java + + ktlint: + name: "Format check" + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-java@v4 + with: + distribution: 'adopt' + java-version: '17' + + - name: Download ktfmt + run: | + cd /tmp + wget "https://repo1.maven.org/maven2/com/facebook/ktfmt/0.44/ktfmt-0.44-jar-with-dependencies.jar" + + - name: Format kotlin files + run: | + find src examples -name '*.kt' \ + | xargs java -jar /tmp/ktfmt-0.44-jar-with-dependencies.jar --google-style + + - name: Ensure git works in current working directory + run: git config --global --add safe.directory `pwd` + + - name: Check for uncommited changes + run: | + git add . + # Show the full diff + git diff-index -p HEAD -- + # Also show just the files that are different, to make it easy + # to tell at a glance what might be going on. And throw in + # --exit-code to make this job fail if there is a difference. + git diff-index --exit-code HEAD -- diff --git a/.github/workflows/labeler.yaml b/.github/workflows/labeler.yaml new file mode 100644 index 0000000000..59f56fdb54 --- /dev/null +++ b/.github/workflows/labeler.yaml @@ -0,0 +1,15 @@ +name: "Pull Request Labeler" +on: +- pull_request_target + +jobs: + triage: + name: Label Triage + permissions: + contents: read + pull-requests: write + runs-on: ubuntu-latest + steps: + - uses: actions/labeler@v5 + with: + repo-token: "${{ secrets.GITHUB_TOKEN }}" diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000000..15004c5aca --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,347 @@ +# 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: Lint Code Base + +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 + +jobs: + code-lints: + runs-on: ubuntu-latest + if: github.actor != 'restyled-io[bot]' + + container: + image: ghcr.io/project-chip/chip-build:74 + + steps: + - name: Checkout + uses: actions/checkout@v4 + + # Bootstrap and checkout for internal scripts (like idl_lint) + # to run + - name: Checkout submodules & Bootstrap + uses: ./.github/actions/checkout-submodules-and-bootstrap + with: + platform: linux + + - name: Check for orphaned gn files + if: always() + # We should enforce that ALL new files are referenced in our build scripts. + # Several things do not have a clear fix path: + # - various platform implementations (including darwin-specific files as they + # are not using GN) + # - app/clusters (they are fetched dynamically - this should probably be fixed) + # + # All the rest of the exceptions should be driven down to 0: chip should fully + # be defined in build rules. + # + # This check enforces that for any newly added file, it must be part of some + # BUILD.gn file + run: | + ./scripts/run_in_build_env.sh "./scripts/tools/not_known_to_gn.py \ + src \ + --skip-dir app/clusters \ + --skip-dir darwin \ + --skip-dir include \ + --skip-dir platform/Ameba \ + --skip-dir platform/android \ + --skip-dir platform/ASR \ + --skip-dir platform/Beken \ + --skip-dir platform/bouffalolab \ + --skip-dir platform/cc13xx_26xx \ + --skip-dir platform/cc32xx \ + --skip-dir platform/Darwin \ + --skip-dir platform/ESP32 \ + --skip-dir platform/fake \ + --skip-dir platform/FreeRTOS \ + --skip-dir platform/Infineon \ + --skip-dir platform/Linux \ + --skip-dir platform/mbed \ + --skip-dir platform/mt793x \ + --skip-dir platform/nxp \ + --skip-dir platform/OpenThread \ + --skip-dir platform/qpg \ + --skip-dir platform/silabs \ + --skip-dir platform/telink \ + --skip-dir platform/webos \ + --skip-dir platform/Zephyr \ + --skip-dir test_driver \ + --skip-dir platform/NuttX \ + --known-failure app/app-platform/ContentApp.cpp \ + --known-failure app/app-platform/ContentApp.h \ + --known-failure app/app-platform/ContentAppPlatform.cpp \ + --known-failure app/app-platform/ContentAppPlatform.h \ + --known-failure controller/ExamplePersistentStorage.cpp \ + --known-failure controller/ExamplePersistentStorage.h \ + --known-failure app/AttributeAccessToken.h \ + --known-failure app/CommandResponseSender.h \ + --known-failure app/CommandSenderLegacyCallback.h \ + --known-failure app/ReadHandler.h \ + --known-failure app/reporting/reporting.cpp \ + --known-failure app/reporting/tests/MockReportScheduler.cpp \ + --known-failure app/reporting/tests/MockReportScheduler.h \ + --known-failure app/util/attribute-storage.cpp \ + --known-failure app/util/attribute-storage-detail.h \ + --known-failure app/util/attribute-storage.h \ + --known-failure app/util/attribute-table.cpp \ + --known-failure app/util/attribute-table-detail.h \ + --known-failure app/util/attribute-table.h \ + --known-failure app/util/binding-table.cpp \ + --known-failure app/util/binding-table.h \ + --known-failure app/util/config.h \ + --known-failure app/util/DataModelHandler.cpp \ + --known-failure app/util/DataModelHandler.h \ + --known-failure app/util/ember-compatibility-functions.cpp \ + --known-failure app/util/ember-compatibility-functions.h \ + --known-failure app/util/ember-global-attribute-access-interface.cpp \ + --known-failure app/util/ember-global-attribute-access-interface.h \ + --known-failure app/util/ember-io-storage.cpp \ + --known-failure app/util/ember-io-storage.h \ + --known-failure app/util/endpoint-config-api.h \ + --known-failure app/util/generic-callbacks.h \ + --known-failure app/util/generic-callback-stubs.cpp \ + --known-failure app/util/im-client-callbacks.h \ + --known-failure app/util/IMClusterCommandHandler.h \ + --known-failure app/util/util.cpp \ + --known-failure app/util/util.h \ + --known-failure app/WriteHandler.h \ + --known-failure platform/DeviceSafeQueue.cpp \ + --known-failure platform/DeviceSafeQueue.h \ + --known-failure platform/GLibTypeDeleter.h \ + --known-failure platform/SingletonConfigurationManager.cpp \ + " + + - name: Check for matter lint errors + if: always() + run: | + for idl_file in $(find . -name '*.matter'); do + # TODO: all these conformance failures should be fixed + # Issues exist for most of them: + # https://github.com/project-chip/connectedhomeip/issues/19176 + # https://github.com/project-chip/connectedhomeip/issues/19175 + # https://github.com/project-chip/connectedhomeip/issues/19173 + if [ "$idl_file" = './examples/log-source-app/log-source-common/log-source-app.matter' ]; then continue; fi + if [ "$idl_file" = './examples/placeholder/linux/apps/app1/config.matter' ]; then continue; fi + if [ "$idl_file" = './examples/placeholder/linux/apps/app2/config.matter' ]; then continue; fi + if [ "$idl_file" = './examples/thermostat/thermostat-common/thermostat.matter' ]; then continue; fi + if [ "$idl_file" = './examples/window-app/common/window-app.matter' ]; then continue; fi + # Example is intentionally not spe compliant for use in cert testing + if [ "$idl_file" = './examples/lighting-app-data-mode-no-unique-id/lighting-common/lighting-app.matter' ]; then continue; fi + + # Test files are intentionally small and not spec-compilant, just parse-compliant + if [ "$idl_file" = "./scripts/py_matter_idl/matter_idl/tests/inputs/cluster_struct_attribute.matter" ]; then continue; fi + if [ "$idl_file" = "./scripts/py_matter_idl/matter_idl/tests/inputs/global_struct_attribute.matter" ]; then continue; fi + if [ "$idl_file" = "./scripts/py_matter_idl/matter_idl/tests/inputs/optional_argument.matter" ]; then continue; fi + if [ "$idl_file" = "./scripts/py_matter_idl/matter_idl/tests/inputs/several_clusters.matter" ]; then continue; fi + if [ "$idl_file" = "./scripts/py_matter_idl/matter_idl/tests/inputs/simple_attribute.matter" ]; then continue; fi + if [ "$idl_file" = "./scripts/py_matter_idl/matter_idl/tests/inputs/large_lighting_app.matter" ]; then continue; fi + if [ "$idl_file" = "./scripts/py_matter_idl/matter_idl/tests/inputs/large_all_clusters_app.matter" ]; then continue; fi + + ./scripts/run_in_build_env.sh "./scripts/idl_lint.py --log-level warn $idl_file" >/dev/null || exit 1 + done + + - name: Check broken links + # On-push disabled until the job can run fully green + # At that point the step should be enabled. + if: github.event_name == 'workflow_dispatch' + uses: gaurav-nelson/github-action-markdown-link-check@v1 + + # git grep exits with 0 if it finds a match, but we want + # to fail (exit nonzero) on match. And we want to exclude this file, + # to avoid our grep regexp matching itself. + - name: Check for incorrect error use in VerifyOrExit + if: always() + run: | + git grep -I -n "VerifyOrExit(.*, [A-Za-z]*_ERROR" -- './*' ':(exclude).github/workflows/lint.yml' && exit 1 || exit 0 + + # git grep exits with 0 if it finds a match, but we want + # to fail (exit nonzero) on match. And we want to exclude this file, + # to avoid our grep regexp matching itself. + - name: + Check for use of PRI*8, which are not supported on some libcs. + if: always() + run: | + git grep -I -n "PRI.8" -- './*' ':(exclude).github/workflows/lint.yml' ':(exclude)third_party/lwip/repo/lwip/src/include/lwip/arch.h' && exit 1 || exit 0 + + # git grep exits with 0 if it finds a match, but we want + # to fail (exit nonzero) on match. And we want to exclude this file, + # to avoid our grep regexp matching itself. + - name: + Check for use of PRI*16, which are not supported on some + libcs. + if: always() + run: | + git grep -I -n "PRI.16" -- './*' ':(exclude).github/workflows/lint.yml' ':(exclude)third_party/lwip/repo/lwip/src/include/lwip/arch.h' && exit 1 || exit 0 + + # git grep exits with 0 if it finds a match, but we want + # to fail (exit nonzero) on match. And we want to exclude this file, + # to avoid our grep regexp matching itself. + - name: + Check for use of PRI*64, which are not supported on some + libcs. + if: always() + run: | + # TODO: MessageDefHelper should ideally not be excluded here. + # TODO: chip_im_initiatore should ideally not be excluded here. + # TODO: TLVDebug should ideally not be excluded here. + # TODO: protocol_decoder.cpp should ideally not be excluded here. + # TODO: PersistentStorageMacros.h should ideally not be excluded here. + git grep -I -n "PRI.64" -- './*' ':(exclude).github/workflows/lint.yml' ':(exclude)examples/chip-tool' ':(exclude)examples/tv-casting-app' ':(exclude)src/app/MessageDef/MessageDefHelper.cpp' ':(exclude)src/app/tests/integration/chip_im_initiator.cpp' ':(exclude)src/lib/core/TLVDebug.cpp' ':(exclude)src/lib/dnssd/tests/TestTxtFields.cpp' ':(exclude)src/lib/format/protocol_decoder.cpp' ':(exclude)src/lib/support/PersistentStorageMacros.h' ':(exclude)src/messaging/tests/echo/echo_requester.cpp' ':(exclude)src/platform/Linux' ':(exclude)src/platform/Ameba' ':(exclude)src/platform/ESP32' ':(exclude)src/platform/Darwin' ':(exclude)src/darwin' ':(exclude)src/platform/webos' ':(exclude)zzz_generated/chip-tool' ':(exclude)src/tools/chip-cert/Cmd_PrintCert.cpp' ':(exclude)src/platform/NuttX' && exit 1 || exit 0 + + # git grep exits with 0 if it finds a match, but we want + # to fail (exit nonzero) on match. And we want to exclude this file, + # to avoid our grep regexp matching itself. + - name: Check for use of %zu, which are not supported on some libcs. + if: always() + run: | + git grep -I -n "%zu" -- './*' ':(exclude).github/workflows/lint.yml' && exit 1 || exit 0 + + # Comments like '{{! ... }}' should be used in zap files + - name: Do not allow TODO in generated files + if: always() + run: | + git grep -n 'TODO:' -- ./zzz_generated './*/zap-generated/*' && exit 1 || exit 0 + + - name: Check for disallowed include files + if: always() + run: scripts/tools/check_includes.sh + + - name: Check for zcl.json and extension sync status + if: always() + run: scripts/tools/check_zcl_file_sync.py . + + - name: Ensure all PICS are set for tests (to true or false) + if: always() + run: | + scripts/tools/check_test_pics.py src/app/tests/suites/certification/ci-pics-values src/app/tests/suites/certification/PICS.yaml + + # git grep exits with 0 if it finds a match, but we want + # to fail (exit nonzero) on match. And we want to exclude this file, + # to avoid our grep regexp matching itself. + - name: + Check for use of 0x%u and the like, which lead to misleading + output. + if: always() + run: | + git grep -I -n '0x%[0-9l.*-]*[^xX"0-9l.*-]' -- './*' ':(exclude).github/workflows/lint.yml' && exit 1 || exit 0 + + # git grep exits with 0 if it finds a match, but we want + # to fail (exit nonzero) on match. And we want to exclude this file, + # to avoid our grep regexp matching itself. + - name: + Check for use of '"0x" PRIu*' and the like, which lead to + misleading output. + if: always() + run: | + git grep -I -n '0x%[0-9-]*" *PRI[^xX]' -- './*' ':(exclude).github/workflows/lint.yml' && exit 1 || exit 0 + + # git grep exits with 0 if it finds a match, but we want + # to fail (exit nonzero) on match. + - name: + Check for use of NSLog instead of Matter logging in Matter + framework + if: always() + run: | + git grep -n 'NSLog(' -- src/darwin/Framework/CHIP && exit 1 || exit 0 + + # git grep exits with 0 if it finds a match, but we want + # to fail (exit nonzero) on match. And we want to exclude this file, + # to avoid our grep regexp matching itself, as well as excluding the files + # that implement the type-safe accessors + - name: + Check for use of 'emberAfReadAttribute' instead of the + type-safe getters + if: always() + run: | + git grep -I -n 'emberAfReadAttribute' -- './*' ':(exclude).github/workflows/lint.yml' ':(exclude)src/app/util/attribute-table.h' ':(exclude)zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp' ':(exclude)src/app/zap-templates/templates/app/attributes/Accessors-src.zapt' ':(exclude)src/app/util/attribute-table.cpp' && exit 1 || exit 0 + + # git grep exits with 0 if it finds a match, but we want + # to fail (exit nonzero) on match. And we want to exclude this file, + # to avoid our grep regexp matching itself, as well as excluding the files + # that implement the type-safe accessors, attribute writing from the wire, and some + # Pigweed RPC code that seems hard to update. + - name: + Check for use of 'emberAfWriteAttribute' instead of the + type-safe setters + if: always() + run: | + git grep -I -n 'emberAfWriteAttribute' -- './*' \ + ':(exclude).github/workflows/lint.yml' \ + ':(exclude)examples/common/pigweed/rpc_services/Attributes.h' \ + ':(exclude)src/app/codegen-data-model-provider/CodegenDataModelProvider_Write.cpp' \ + ':(exclude)src/app/codegen-data-model-provider/tests/EmberReadWriteOverride.cpp' \ + ':(exclude)src/app/util/attribute-table.cpp' \ + ':(exclude)src/app/util/attribute-table.h' \ + ':(exclude)src/app/util/ember-compatibility-functions.cpp' \ + ':(exclude)src/app/util/mock/CodegenEmberMocks.cpp' \ + ':(exclude)src/app/zap-templates/templates/app/attributes/Accessors-src.zapt' \ + ':(exclude)zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp' \ + && exit 1 || exit 0 + + # Run ruff python linter + - name: Check for errors using ruff Python linter + if: always() + run: | + ruff check + + # git grep exits with 0 if it finds a match, but we want + # to fail (exit nonzero) on match. And we want to exclude this file, + # to avoid our grep regexp matching itself. + - name: + Check for use of "SuccessOrExit(CHIP_ERROR_*)", which should + probably be "SuccessOrExit(err = CHIP_ERROR_*)" + if: always() + run: | + git grep -I -n 'SuccessOrExit(CHIP_ERROR' -- './*' ':(exclude).github/workflows/lint.yml' && exit 1 || exit 0 + + # git grep exits with 0 if it finds a match, but we want + # to fail (exit nonzero) on match. And we want to exclude this file, + # to avoid our grep regexp matching itself. + - name: + Check for use of + "SuccessOrExit(something-without-assignment(", which should + probably be "SuccessOrExit(err = something(" + if: always() + run: | + git grep -I -n 'SuccessOrExit([^=)]*(' -- './*' ':(exclude).github/workflows/lint.yml' && exit 1 || exit 0 + + # git grep exits with 0 if it finds a match, but we want + # to fail (exit nonzero) on match. + - name: + Check for use of "using namespace" outside of a class/function + in headers. + if: always() + run: | + # Various platforms have `using namespace chip::Ble` in their BLEManager* headers; just exclude those for now. + # + # Exclude platform openiotsdk bits that do this in their persistent storage header. + # + # Also exclude examples (for now) and third_party, which have various instances of this. + # + # Ignore uses of `System::Clock::Literals`, because that's the only way to have things using _ms32 or whatnot + # in a header file. + git grep -I -n -e '^using namespace' --and --not -e 'System::Clock::Literals' -- './**/*.h' ':(exclude)src/platform/*/BLEManager*.h' ':(exclude)src/platform/openiotsdk/KVPsaPsStore.h' ':(exclude)./examples' ':(exclude)./third_party' && exit 1 || exit 0 diff --git a/.github/workflows/minimal-build.yaml b/.github/workflows/minimal-build.yaml new file mode 100644 index 0000000000..ade1bd56ea --- /dev/null +++ b/.github/workflows/minimal-build.yaml @@ -0,0 +1,71 @@ +# Copyright (c) 2023 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: Minimal Build (Linux / configure) + +on: + push: + branches-ignore: + - "dependabot/**" + pull_request: + merge_group: + +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: + minimal-all-clusters: + name: Linux / configure build of all-clusters-app + + if: github.actor != 'restyled-io[bot]' + runs-on: ubuntu-latest + + container: + image: ghcr.io/project-chip/chip-build-minimal:74 + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Checkout submodules # but don't bootstrap! + uses: ./.github/actions/checkout-submodules + with: + platform: linux + + - name: Configure and build All Clusters App + run: | + CC=gcc CXX=g++ scripts/configure --project=examples/all-clusters-app/linux --enable-recommended=no && ./ninja-build + + minimal-network-manager: + name: Linux / configure build of network-manager-app + + if: github.actor != 'restyled-io[bot]' + runs-on: ubuntu-latest + + container: + image: ghcr.io/project-chip/chip-build-minimal:74 + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Checkout submodules # but don't bootstrap! + uses: ./.github/actions/checkout-submodules + with: + platform: linux + + - name: Configure and build Network Manager App + run: | + CC=gcc CXX=g++ scripts/configure --project=examples/network-manager-app/linux --enable-recommended=no && ./ninja-build diff --git a/.github/workflows/protocol_compatibility.yaml b/.github/workflows/protocol_compatibility.yaml new file mode 100644 index 0000000000..6c8960072e --- /dev/null +++ b/.github/workflows/protocol_compatibility.yaml @@ -0,0 +1,49 @@ +# 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: Backwards compatibility check +on: + pull_request: + paths: + - "src/controller/data_model/controller-clusters.matter" + +jobs: + check_clusters_matter: + name: Check controller-clusters.matter backwards compatibility + runs-on: ubuntu-latest + if: github.event.pull_request && !(contains(github.event.pull_request.labels.*.name, 'skip-protocol-compatibility')) + + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Setup python + uses: actions/setup-python@v5 + with: + python-version: 3.11 + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install click coloredlogs lark + - name: Create old/new copies + run: | + mkdir -p out + cp src/controller/data_model/controller-clusters.matter out/new_version.matter + wget '${{github.event.pull_request.diff_url}}' --output-document out/patch.diff + patch -p1 --reverse /dev/null || (sudo apt update && sudo apt install curl -y) + curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg \ + && sudo chmod go+r /usr/share/keyrings/githubcli-archive-keyring.gpg \ + && echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null \ + && sudo apt update \ + && sudo apt install gh -y + + - name: Tag Release & Generate Notes + env: + GH_TOKEN: ${{ github.token }} + run: | + export BRANCH_NAME=$(git rev-parse --abbrev-ref HEAD) + echo "Tagging against branch: $BRANCH_NAME" + ./scripts/tagging/tag_new_release.sh --generate-notes --target "$BRANCH_NAME" -d # Note this is a draft for now. + + diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml new file mode 100644 index 0000000000..2c68b91222 --- /dev/null +++ b/.github/workflows/tests.yaml @@ -0,0 +1,627 @@ +# 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: Tests + +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: + test_suites_linux: + name: Test Suites - Linux + + strategy: + matrix: + build_variant: [no-ble-tsan-clang] + chip_tool: [""] + env: + BUILD_VARIANT: ${{matrix.build_variant}} + CHIP_TOOL_VARIANT: ${{matrix.chip_tool}} + TSAN_OPTIONS: "halt_on_error=1 suppressions=scripts/tests/chiptest/tsan-linux-suppressions.txt" + LSAN_OPTIONS: detect_leaks=1 + + if: github.actor != 'restyled-io[bot]' + runs-on: ubuntu-latest + + container: + image: ghcr.io/project-chip/chip-build:74 + options: --privileged --sysctl "net.ipv6.conf.all.disable_ipv6=0 + net.ipv4.conf.all.forwarding=1 net.ipv6.conf.all.forwarding=1" + + steps: + - name: Checkout + uses: actions/checkout@v4 + # To use act like: + # act -j test_suites_linux + # + # Note you likely still need to have non submodules setup for the + # local machine, like: + # git submodule deinit --all + - uses: actions/checkout@v4 + if: ${{ env.ACT }} + name: Checkout (ACT for local build) + - name: Checkout submodules & Bootstrap + uses: ./.github/actions/checkout-submodules-and-bootstrap + with: + platform: linux + bootstrap-log-name: bootstrap-logs-linux-${{ matrix.build_variant }}${{ matrix.chip_tool }} + - name: Try to ensure the directories for core dumping exist and we + can write them. + run: | + mkdir /tmp/cores || true + sysctl -w kernel.core_pattern=/tmp/cores/core.%u.%p.%t || true + mkdir objdir-clone || true + + - name: Validate that xml are parsable + # The sub-items being run here are the same as the input XMLs listed + # at src/app/zap-templates/zcl/zcl.json + # + # This ensures that the syntax of the XML can always be parsed/validated, however it + # does not enforce that the content is understood (that part is covered by parser + # unit tests) + # + run: | + ./scripts/run_in_build_env.sh \ + "./scripts/py_matter_idl/matter_idl/zapxml_parser.py \ + --no-print \ + --log-level info \ + src/app/zap-templates/zcl/data-model/chip/global-attributes.xml \ + src/app/zap-templates/zcl/data-model/chip/global-bitmaps.xml \ + src/app/zap-templates/zcl/data-model/chip/global-enums.xml \ + src/app/zap-templates/zcl/data-model/chip/global-structs.xml \ + src/app/zap-templates/zcl/data-model/chip/semantic-tag-namespace-enums.xml \ + src/app/zap-templates/zcl/data-model/chip/access-control-definitions.xml \ + src/app/zap-templates/zcl/data-model/chip/access-control-cluster.xml \ + src/app/zap-templates/zcl/data-model/chip/account-login-cluster.xml \ + src/app/zap-templates/zcl/data-model/chip/administrator-commissioning-cluster.xml \ + src/app/zap-templates/zcl/data-model/chip/air-quality-cluster.xml \ + src/app/zap-templates/zcl/data-model/chip/application-basic-cluster.xml \ + src/app/zap-templates/zcl/data-model/chip/application-launcher-cluster.xml \ + src/app/zap-templates/zcl/data-model/chip/audio-output-cluster.xml \ + src/app/zap-templates/zcl/data-model/chip/ballast-configuration-cluster.xml \ + src/app/zap-templates/zcl/data-model/chip/basic-information-cluster.xml \ + src/app/zap-templates/zcl/data-model/chip/binding-cluster.xml \ + src/app/zap-templates/zcl/data-model/chip/boolean-state-cluster.xml \ + src/app/zap-templates/zcl/data-model/chip/actions-cluster.xml \ + src/app/zap-templates/zcl/data-model/chip/bridged-device-basic-information.xml \ + src/app/zap-templates/zcl/data-model/chip/chip-ota.xml \ + src/app/zap-templates/zcl/data-model/chip/chip-types.xml \ + src/app/zap-templates/zcl/data-model/chip/channel-cluster.xml \ + src/app/zap-templates/zcl/data-model/chip/clusters-extensions.xml \ + src/app/zap-templates/zcl/data-model/chip/color-control-cluster.xml \ + src/app/zap-templates/zcl/data-model/chip/commissioner-control-cluster.xml \ + src/app/zap-templates/zcl/data-model/chip/concentration-measurement-cluster.xml \ + src/app/zap-templates/zcl/data-model/chip/content-launch-cluster.xml \ + src/app/zap-templates/zcl/data-model/chip/content-app-observer-cluster.xml \ + src/app/zap-templates/zcl/data-model/chip/content-control-cluster.xml \ + src/app/zap-templates/zcl/data-model/chip/descriptor-cluster.xml \ + src/app/zap-templates/zcl/data-model/chip/device-energy-management-cluster.xml \ + src/app/zap-templates/zcl/data-model/chip/device-energy-management-mode-cluster.xml \ + src/app/zap-templates/zcl/data-model/chip/diagnostic-logs-cluster.xml \ + src/app/zap-templates/zcl/data-model/chip/dishwasher-alarm-cluster.xml \ + src/app/zap-templates/zcl/data-model/chip/dishwasher-mode-cluster.xml \ + src/app/zap-templates/zcl/data-model/chip/measurement-and-sensing.xml \ + src/app/zap-templates/zcl/data-model/chip/microwave-oven-mode-cluster.xml \ + src/app/zap-templates/zcl/data-model/chip/microwave-oven-control-cluster.xml \ + src/app/zap-templates/zcl/data-model/chip/door-lock-cluster.xml \ + src/app/zap-templates/zcl/data-model/chip/ecosystem-information-cluster.xml \ + src/app/zap-templates/zcl/data-model/chip/energy-evse-cluster.xml \ + src/app/zap-templates/zcl/data-model/chip/energy-evse-mode-cluster.xml \ + src/app/zap-templates/zcl/data-model/chip/ethernet-network-diagnostics-cluster.xml \ + src/app/zap-templates/zcl/data-model/chip/fan-control-cluster.xml \ + src/app/zap-templates/zcl/data-model/chip/fault-injection-cluster.xml \ + src/app/zap-templates/zcl/data-model/chip/fixed-label-cluster.xml \ + src/app/zap-templates/zcl/data-model/chip/flow-measurement-cluster.xml \ + src/app/zap-templates/zcl/data-model/chip/general-commissioning-cluster.xml \ + src/app/zap-templates/zcl/data-model/chip/general-diagnostics-cluster.xml \ + src/app/zap-templates/zcl/data-model/chip/global-attributes.xml \ + src/app/zap-templates/zcl/data-model/chip/groups-cluster.xml \ + src/app/zap-templates/zcl/data-model/chip/group-key-mgmt-cluster.xml \ + src/app/zap-templates/zcl/data-model/chip/identify-cluster.xml \ + src/app/zap-templates/zcl/data-model/chip/illuminance-measurement-cluster.xml \ + src/app/zap-templates/zcl/data-model/chip/keypad-input-cluster.xml \ + src/app/zap-templates/zcl/data-model/chip/laundry-washer-mode-cluster.xml \ + src/app/zap-templates/zcl/data-model/chip/laundry-dryer-controls-cluster.xml \ + src/app/zap-templates/zcl/data-model/chip/level-control-cluster.xml \ + src/app/zap-templates/zcl/data-model/chip/localization-configuration-cluster.xml \ + src/app/zap-templates/zcl/data-model/chip/low-power-cluster.xml \ + src/app/zap-templates/zcl/data-model/chip/media-input-cluster.xml \ + src/app/zap-templates/zcl/data-model/chip/media-playback-cluster.xml \ + src/app/zap-templates/zcl/data-model/chip/messages-cluster.xml \ + src/app/zap-templates/zcl/data-model/chip/mode-base-cluster.xml \ + src/app/zap-templates/zcl/data-model/chip/mode-select-cluster.xml \ + src/app/zap-templates/zcl/data-model/chip/network-commissioning-cluster.xml \ + src/app/zap-templates/zcl/data-model/chip/occupancy-sensing-cluster.xml \ + src/app/zap-templates/zcl/data-model/chip/onoff-cluster.xml \ + src/app/zap-templates/zcl/data-model/chip/operational-credentials-cluster.xml \ + src/app/zap-templates/zcl/data-model/chip/operational-state-cluster.xml \ + src/app/zap-templates/zcl/data-model/chip/operational-state-oven-cluster.xml \ + src/app/zap-templates/zcl/data-model/chip/operational-state-rvc-cluster.xml \ + src/app/zap-templates/zcl/data-model/chip/oven-mode-cluster.xml \ + src/app/zap-templates/zcl/data-model/chip/power-topology-cluster.xml \ + src/app/zap-templates/zcl/data-model/chip/pressure-measurement-cluster.xml \ + src/app/zap-templates/zcl/data-model/chip/power-source-cluster.xml \ + src/app/zap-templates/zcl/data-model/chip/power-source-configuration-cluster.xml \ + src/app/zap-templates/zcl/data-model/chip/proxy-configuration-cluster.xml \ + src/app/zap-templates/zcl/data-model/chip/proxy-discovery-cluster.xml \ + src/app/zap-templates/zcl/data-model/chip/proxy-valid-cluster.xml \ + src/app/zap-templates/zcl/data-model/chip/pump-configuration-and-control-cluster.xml \ + src/app/zap-templates/zcl/data-model/chip/pwm-cluster.xml \ + src/app/zap-templates/zcl/data-model/chip/refrigerator-and-temperature-controlled-cabinet-mode-cluster.xml \ + src/app/zap-templates/zcl/data-model/chip/refrigerator-alarm.xml \ + src/app/zap-templates/zcl/data-model/chip/relative-humidity-measurement-cluster.xml \ + src/app/zap-templates/zcl/data-model/chip/rvc-clean-mode-cluster.xml \ + src/app/zap-templates/zcl/data-model/chip/rvc-run-mode-cluster.xml \ + src/app/zap-templates/zcl/data-model/chip/scene.xml \ + src/app/zap-templates/zcl/data-model/chip/smoke-co-alarm-cluster.xml \ + src/app/zap-templates/zcl/data-model/chip/software-diagnostics-cluster.xml \ + src/app/zap-templates/zcl/data-model/chip/switch-cluster.xml \ + src/app/zap-templates/zcl/data-model/chip/target-navigator-cluster.xml \ + src/app/zap-templates/zcl/data-model/chip/temperature-measurement-cluster.xml \ + src/app/zap-templates/zcl/data-model/chip/test-cluster.xml \ + src/app/zap-templates/zcl/data-model/chip/thermostat-user-interface-configuration-cluster.xml \ + src/app/zap-templates/zcl/data-model/chip/thermostat-cluster.xml \ + src/app/zap-templates/zcl/data-model/chip/thread-border-router-management-cluster.xml \ + src/app/zap-templates/zcl/data-model/chip/thread-network-diagnostics-cluster.xml \ + src/app/zap-templates/zcl/data-model/chip/thread-network-directory-cluster.xml \ + src/app/zap-templates/zcl/data-model/chip/time-format-localization-cluster.xml \ + src/app/zap-templates/zcl/data-model/chip/time-synchronization-cluster.xml \ + src/app/zap-templates/zcl/data-model/chip/timer-cluster.xml \ + src/app/zap-templates/zcl/data-model/chip/user-label-cluster.xml \ + src/app/zap-templates/zcl/data-model/chip/unit-localization-cluster.xml \ + src/app/zap-templates/zcl/data-model/chip/wake-on-lan-cluster.xml \ + src/app/zap-templates/zcl/data-model/chip/washer-controls-cluster.xml \ + src/app/zap-templates/zcl/data-model/chip/water-heater-management-cluster.xml \ + src/app/zap-templates/zcl/data-model/chip/wifi-network-diagnostics-cluster.xml \ + src/app/zap-templates/zcl/data-model/chip/wifi-network-management-cluster.xml \ + src/app/zap-templates/zcl/data-model/chip/window-covering.xml \ + src/app/zap-templates/zcl/data-model/chip/temperature-control-cluster.xml \ + src/app/zap-templates/zcl/data-model/chip/matter-devices.xml \ + src/app/zap-templates/zcl/data-model/draft/barrier-control-cluster.xml \ + src/app/zap-templates/zcl/data-model/draft/electrical-measurement-cluster.xml \ + src/app/zap-templates/zcl/data-model/draft/input-output-value-clusters.xml \ + src/app/zap-templates/zcl/data-model/draft/onoff-switch-configuration-cluster.xml \ + src/app/zap-templates/zcl/data-model/chip/resource-monitoring-cluster.xml \ + src/app/zap-templates/zcl/data-model/chip/sample-mei-cluster.xml \ + src/app/zap-templates/zcl/data-model/chip/electrical-energy-measurement-cluster.xml \ + src/app/zap-templates/zcl/data-model/chip/electrical-power-measurement-cluster.xml \ + " + - name: Build Apps + run: | + scripts/run_in_build_env.sh './scripts/build_python.sh --install_virtual_env out/venv' + ./scripts/run_in_build_env.sh \ + "./scripts/build/build_examples.py \ + --target linux-x64-chip-tool${CHIP_TOOL_VARIANT}-${BUILD_VARIANT} \ + --target linux-x64-all-clusters-${BUILD_VARIANT} \ + --target linux-x64-lock-${BUILD_VARIANT} \ + --target linux-x64-ota-provider-${BUILD_VARIANT} \ + --target linux-x64-ota-requestor-${BUILD_VARIANT} \ + --target linux-x64-tv-app-${BUILD_VARIANT} \ + --target linux-x64-bridge-${BUILD_VARIANT} \ + --target linux-x64-lit-icd-${BUILD_VARIANT} \ + --target linux-x64-microwave-oven-${BUILD_VARIANT} \ + --target linux-x64-rvc-${BUILD_VARIANT} \ + --target linux-x64-network-manager-${BUILD_VARIANT} \ + build \ + --copy-artifacts-to objdir-clone \ + " + + - name: Run Tests using the python parser sending commands to chip-tool + run: | + ./scripts/run_in_build_env.sh \ + "./scripts/tests/run_test_suite.py \ + --runner chip_tool_python \ + --chip-tool ./out/linux-x64-chip-tool${CHIP_TOOL_VARIANT}-${BUILD_VARIANT}/chip-tool \ + run \ + --iterations 1 \ + --test-timeout-seconds 120 \ + --all-clusters-app ./out/linux-x64-all-clusters-${BUILD_VARIANT}/chip-all-clusters-app \ + --lock-app ./out/linux-x64-lock-${BUILD_VARIANT}/chip-lock-app \ + --ota-provider-app ./out/linux-x64-ota-provider-${BUILD_VARIANT}/chip-ota-provider-app \ + --ota-requestor-app ./out/linux-x64-ota-requestor-${BUILD_VARIANT}/chip-ota-requestor-app \ + --tv-app ./out/linux-x64-tv-app-${BUILD_VARIANT}/chip-tv-app \ + --bridge-app ./out/linux-x64-bridge-${BUILD_VARIANT}/chip-bridge-app \ + --lit-icd-app ./out/linux-x64-lit-icd-${BUILD_VARIANT}/lit-icd-app \ + --microwave-oven-app ./out/linux-x64-microwave-oven-${BUILD_VARIANT}/chip-microwave-oven-app \ + --rvc-app ./out/linux-x64-rvc-${BUILD_VARIANT}/chip-rvc-app \ + --network-manager-app ./out/linux-x64-network-manager-${BUILD_VARIANT}/matter-network-manager-app \ + " + + - name: Run purposeful failure tests using the python parser sending commands to chip-tool + run: | + ./scripts/run_in_build_env.sh \ + "./scripts/tests/run_test_suite.py \ + --runner chip_tool_python \ + --include-tags PURPOSEFUL_FAILURE \ + --chip-tool ./out/linux-x64-chip-tool${CHIP_TOOL_VARIANT}-${BUILD_VARIANT}/chip-tool \ + run \ + --iterations 1 \ + --expected-failures 3 \ + --keep-going \ + --test-timeout-seconds 120 \ + --all-clusters-app ./out/linux-x64-all-clusters-${BUILD_VARIANT}/chip-all-clusters-app \ + " + + - name: Run Tests using chip-repl (skip slow) + if: github.event_name == 'pull_request' + run: | + ./scripts/run_in_python_env.sh out/venv \ + "./scripts/tests/run_test_suite.py \ + --runner chip_repl_python \ + --exclude-tags MANUAL \ + --exclude-tags FLAKY \ + --exclude-tags IN_DEVELOPMENT \ + --exclude-tags EXTRA_SLOW \ + --exclude-tags SLOW \ + --exclude-tags PURPOSEFUL_FAILURE \ + run \ + --iterations 1 \ + --test-timeout-seconds 120 \ + --all-clusters-app ./out/linux-x64-all-clusters-${BUILD_VARIANT}/chip-all-clusters-app \ + --lock-app ./out/linux-x64-lock-${BUILD_VARIANT}/chip-lock-app \ + --ota-provider-app ./out/linux-x64-ota-provider-${BUILD_VARIANT}/chip-ota-provider-app \ + --ota-requestor-app ./out/linux-x64-ota-requestor-${BUILD_VARIANT}/chip-ota-requestor-app \ + --tv-app ./out/linux-x64-tv-app-${BUILD_VARIANT}/chip-tv-app \ + --bridge-app ./out/linux-x64-bridge-${BUILD_VARIANT}/chip-bridge-app \ + --lit-icd-app ./out/linux-x64-lit-icd-${BUILD_VARIANT}/lit-icd-app \ + --microwave-oven-app ./out/linux-x64-microwave-oven-${BUILD_VARIANT}/chip-microwave-oven-app \ + --rvc-app ./out/linux-x64-rvc-${BUILD_VARIANT}/chip-rvc-app \ + --network-manager-app ./out/linux-x64-network-manager-${BUILD_VARIANT}/matter-network-manager-app \ + " + - name: Run Tests using chip-repl (including slow) + if: github.event_name == 'push' + run: | + ./scripts/run_in_python_env.sh out/venv \ + "./scripts/tests/run_test_suite.py \ + --runner chip_repl_python \ + run \ + --iterations 1 \ + --test-timeout-seconds 120 \ + --all-clusters-app ./out/linux-x64-all-clusters-${BUILD_VARIANT}/chip-all-clusters-app \ + --lock-app ./out/linux-x64-lock-${BUILD_VARIANT}/chip-lock-app \ + --ota-provider-app ./out/linux-x64-ota-provider-${BUILD_VARIANT}/chip-ota-provider-app \ + --ota-requestor-app ./out/linux-x64-ota-requestor-${BUILD_VARIANT}/chip-ota-requestor-app \ + --tv-app ./out/linux-x64-tv-app-${BUILD_VARIANT}/chip-tv-app \ + --bridge-app ./out/linux-x64-bridge-${BUILD_VARIANT}/chip-bridge-app \ + --lit-icd-app ./out/linux-x64-lit-icd-${BUILD_VARIANT}/lit-icd-app \ + --microwave-oven-app ./out/linux-x64-microwave-oven-${BUILD_VARIANT}/chip-microwave-oven-app \ + --rvc-app ./out/linux-x64-rvc-${BUILD_VARIANT}/chip-rvc-app \ + --network-manager-app ./out/linux-x64-network-manager-${BUILD_VARIANT}/matter-network-manager-app \ + " + - name: Uploading core files + uses: actions/upload-artifact@v4 + if: ${{ failure() && !env.ACT }} + with: + name: crash-core-linux-${{ matrix.build_variant }}${{ matrix.chip_tool }} + path: /tmp/cores/ + # Cores are big; don't hold on to them too long. + retention-days: 5 + - name: Uploading objdir for debugging + uses: actions/upload-artifact@v4 + if: ${{ failure() && !env.ACT }} + with: + name: crash-objdir-linux-${{ matrix.build_variant }}${{ matrix.chip_tool }} + path: objdir-clone/ + # objdirs are big; don't hold on to them too long. + retention-days: 5 + + test_suites_darwin: + name: Test Suites - Darwin + + strategy: + matrix: + build_variant: [no-ble-asan-clang, no-ble-tsan-clang] + chip_tool: [""] + env: + BUILD_VARIANT: ${{matrix.build_variant}} + CHIP_TOOL_VARIANT: ${{matrix.chip_tool}} + TSAN_OPTIONS: "halt_on_error=1" + LSAN_OPTIONS: detect_leaks=1 suppressions=scripts/tests/chiptest/lsan-mac-suppressions.txt + + if: github.actor != 'restyled-io[bot]' + runs-on: macos-13 + + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Setup Environment + # coreutils for stdbuf + run: brew install coreutils + - name: + Try to ensure the directories for core dumping and diagnostic + log collection exist and we can write them. + run: | + sudo chown ${USER} /cores || true + mkdir -p ~/Library/Logs/DiagnosticReports || true + mkdir objdir-clone || true + - name: Checkout submodules & Bootstrap + uses: ./.github/actions/checkout-submodules-and-bootstrap + with: + platform: darwin + bootstrap-log-name: bootstrap-logs-darwin-${{ matrix.build_variant }}${{ matrix.chip_tool }} + + + - name: Build Apps + run: | + ./scripts/run_in_build_env.sh \ + "./scripts/build/build_examples.py \ + --target darwin-x64-chip-tool${CHIP_TOOL_VARIANT}-${BUILD_VARIANT} \ + --target darwin-x64-all-clusters-${BUILD_VARIANT} \ + --target darwin-x64-lock-${BUILD_VARIANT} \ + --target darwin-x64-ota-provider-${BUILD_VARIANT} \ + --target darwin-x64-ota-requestor-${BUILD_VARIANT} \ + --target darwin-x64-tv-app-${BUILD_VARIANT} \ + --target darwin-x64-bridge-${BUILD_VARIANT} \ + --target darwin-x64-lit-icd-${BUILD_VARIANT} \ + --target darwin-x64-microwave-oven-${BUILD_VARIANT} \ + --target darwin-x64-rvc-${BUILD_VARIANT} \ + --target darwin-x64-network-manager-${BUILD_VARIANT} \ + build \ + --copy-artifacts-to objdir-clone \ + " + + - name: Run Tests using the python parser sending commands to chip-tool + run: | + ./scripts/run_in_build_env.sh \ + "./scripts/tests/run_test_suite.py \ + --runner chip_tool_python \ + --chip-tool ./out/darwin-x64-chip-tool${CHIP_TOOL_VARIANT}-${BUILD_VARIANT}/chip-tool \ + --target-skip-glob '{Test_TC_DGTHREAD_2_1,Test_TC_DGTHREAD_2_2,Test_TC_DGTHREAD_2_3,Test_TC_DGTHREAD_2_4}' \ + run \ + --iterations 1 \ + --test-timeout-seconds 120 \ + --all-clusters-app ./out/darwin-x64-all-clusters-${BUILD_VARIANT}/chip-all-clusters-app \ + --lock-app ./out/darwin-x64-lock-${BUILD_VARIANT}/chip-lock-app \ + --ota-provider-app ./out/darwin-x64-ota-provider-${BUILD_VARIANT}/chip-ota-provider-app \ + --ota-requestor-app ./out/darwin-x64-ota-requestor-${BUILD_VARIANT}/chip-ota-requestor-app \ + --tv-app ./out/darwin-x64-tv-app-${BUILD_VARIANT}/chip-tv-app \ + --bridge-app ./out/darwin-x64-bridge-${BUILD_VARIANT}/chip-bridge-app \ + --lit-icd-app ./out/darwin-x64-lit-icd-${BUILD_VARIANT}/lit-icd-app \ + --microwave-oven-app ./out/darwin-x64-microwave-oven-${BUILD_VARIANT}/chip-microwave-oven-app \ + --rvc-app ./out/darwin-x64-rvc-${BUILD_VARIANT}/chip-rvc-app \ + --network-manager-app ./out/darwin-x64-network-manager-${BUILD_VARIANT}/matter-network-manager-app \ + " + + - name: Run purposeful failure tests using the python parser sending commands to chip-tool + run: | + ./scripts/run_in_build_env.sh \ + "./scripts/tests/run_test_suite.py \ + --runner chip_tool_python \ + --include-tags PURPOSEFUL_FAILURE \ + --chip-tool ./out/darwin-x64-chip-tool${CHIP_TOOL_VARIANT}-${BUILD_VARIANT}/chip-tool \ + run \ + --iterations 1 \ + --expected-failures 3 \ + --keep-going \ + --test-timeout-seconds 120 \ + --all-clusters-app ./out/darwin-x64-all-clusters-${BUILD_VARIANT}/chip-all-clusters-app \ + " + + - name: Uploading core files + uses: actions/upload-artifact@v4 + if: ${{ failure() && !env.ACT }} + with: + name: crash-core-darwin-${{ matrix.build_variant }}${{ matrix.chip_tool }} + path: /cores/ + # Cores are big; don't hold on to them too long. + retention-days: 5 + - name: Uploading diagnostic logs + uses: actions/upload-artifact@v4 + if: ${{ failure() && !env.ACT }} + with: + name: crash-log-darwin-${{ matrix.build_variant }}${{ matrix.chip_tool }} + path: ~/Library/Logs/DiagnosticReports/ + - name: Uploading objdir for debugging + uses: actions/upload-artifact@v4 + if: ${{ failure() && !env.ACT }} + with: + name: crash-objdir-darwin-${{ matrix.build_variant }}${{ matrix.chip_tool }} + path: objdir-clone/ + # objdirs are big; don't hold on to them too long. + retention-days: 5 + + repl_tests_linux: + name: REPL Tests - Linux + + env: + TSAN_OPTIONS: "halt_on_error=1 suppressions=scripts/tests/chiptest/tsan-linux-suppressions.txt" + + if: github.actor != 'restyled-io[bot]' + runs-on: ubuntu-latest + + container: + image: ghcr.io/project-chip/chip-build:74 + options: --privileged --sysctl "net.ipv6.conf.all.disable_ipv6=0 + net.ipv4.conf.all.forwarding=0 net.ipv6.conf.all.forwarding=0" + + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Checkout submodules & Bootstrap + uses: ./.github/actions/checkout-submodules-and-bootstrap + with: + platform: linux + bootstrap-log-name: bootstrap-logs-linux-${{ matrix.build_variant }}${{ matrix.chip_tool }} + - name: Try to ensure the directories for core dumping exist and we + can write them. + run: | + mkdir /tmp/cores || true + sysctl -w kernel.core_pattern=/tmp/cores/core.%u.%p.%t || true + mkdir objdir-clone || true + + - name: Build Python REPL and example apps + # NOTE: the data-mode-check + check-failure-die is not 100% perfect as different + # encoding sizes for data that keeps changing may alter over time (e.g. anything relating to time + # or resources such as packet counts or other similar counters) + # + # This may result in invalid errors, however for most purposes of our testing, we are unlikely to + # hit such cases so we remain very strict on testing here. + run: | + scripts/run_in_build_env.sh './scripts/build_python.sh --install_virtual_env out/venv' + ./scripts/run_in_build_env.sh \ + "./scripts/build/build_examples.py \ + --target linux-x64-all-clusters-ipv6only-no-ble-no-wifi-tsan-clang-test-data-model-check-check-failure-die \ + --target linux-x64-lock-ipv6only-no-ble-no-wifi-tsan-clang-test \ + --target linux-x64-lit-icd-ipv6only-no-ble-no-wifi-tsan-clang-test \ + --target linux-x64-energy-management-ipv6only-no-ble-no-wifi-tsan-clang-test \ + --target linux-x64-microwave-oven-ipv6only-no-ble-no-wifi-tsan-clang-test \ + --target linux-x64-rvc-ipv6only-no-ble-no-wifi-tsan-clang-test \ + --target linux-x64-network-manager-ipv6only-no-ble-no-wifi-tsan-clang-test \ + --target linux-x64-fabric-admin-rpc-ipv6only-clang \ + --target linux-x64-fabric-bridge-rpc-ipv6only-no-ble-no-wifi-clang \ + --target linux-x64-light-data-model-no-unique-id-ipv6only-no-ble-no-wifi-clang \ + --target linux-x64-python-bindings \ + build \ + --copy-artifacts-to objdir-clone \ + " + - name: Generate an argument environment file + run: | + echo -n "" >/tmp/test_env.yaml + echo "ALL_CLUSTERS_APP: out/linux-x64-all-clusters-ipv6only-no-ble-no-wifi-tsan-clang-test-data-model-check-check-failure-die/chip-all-clusters-app" >> /tmp/test_env.yaml + echo "CHIP_LOCK_APP: out/linux-x64-lock-ipv6only-no-ble-no-wifi-tsan-clang-test/chip-lock-app" >> /tmp/test_env.yaml + echo "ENERGY_MANAGEMENT_APP: out/linux-x64-energy-management-ipv6only-no-ble-no-wifi-tsan-clang-test/chip-energy-management-app" >> /tmp/test_env.yaml + echo "LIT_ICD_APP: out/linux-x64-lit-icd-ipv6only-no-ble-no-wifi-tsan-clang-test/lit-icd-app" >> /tmp/test_env.yaml + echo "CHIP_MICROWAVE_OVEN_APP: out/linux-x64-microwave-oven-ipv6only-no-ble-no-wifi-tsan-clang-test/chip-microwave-oven-app" >> /tmp/test_env.yaml + echo "CHIP_RVC_APP: out/linux-x64-rvc-ipv6only-no-ble-no-wifi-tsan-clang-test/chip-rvc-app" >> /tmp/test_env.yaml + echo "NETWORK_MANAGEMENT_APP: out/linux-x64-network-manager-ipv6only-no-ble-no-wifi-tsan-clang-test/matter-network-manager-app" >> /tmp/test_env.yaml + echo "FABRIC_ADMIN_APP: out/linux-x64-fabric-admin-rpc-ipv6only-clang/fabric-admin" >> /tmp/test_env.yaml + echo "FABRIC_BRIDGE_APP: out/linux-x64-fabric-bridge-rpc-ipv6only-no-ble-no-wifi-clang/fabric-bridge-app" >> /tmp/test_env.yaml + echo "LIGHTING_APP_NO_UNIQUE_ID: out/linux-x64-light-data-model-no-unique-id-ipv6only-no-ble-no-wifi-clang/chip-lighting-app" >> /tmp/test_env.yaml + echo "TRACE_APP: out/trace_data/app-{SCRIPT_BASE_NAME}" >> /tmp/test_env.yaml + echo "TRACE_TEST_JSON: out/trace_data/test-{SCRIPT_BASE_NAME}" >> /tmp/test_env.yaml + echo "TRACE_TEST_PERFETTO: out/trace_data/test-{SCRIPT_BASE_NAME}" >> /tmp/test_env.yaml + + - name: Run Tests + run: | + mkdir -p out/trace_data + scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --load-from-env /tmp/test_env.yaml --script src/controller/python/test/test_scripts/mobile-device-test.py' + scripts/run_in_python_env.sh out/venv 'python3 ./src/python_testing/execute_python_tests.py --env-file /tmp/test_env.yaml --search-directory src/python_testing' + scripts/run_in_python_env.sh out/venv './scripts/tests/TestTimeSyncTrustedTimeSourceRunner.py --all-clusters out/linux-x64-all-clusters-ipv6only-no-ble-no-wifi-tsan-clang-test-data-model-check-check-failure-die/chip-all-clusters-app' + scripts/run_in_python_env.sh out/venv 'python3 ./src/python_testing/TestIdChecks.py' + scripts/run_in_python_env.sh out/venv 'python3 ./src/python_testing/TestSpecParsingDeviceType.py' + scripts/run_in_python_env.sh out/venv 'python3 ./src/python_testing/TestConformanceSupport.py' + scripts/run_in_python_env.sh out/venv 'python3 ./src/python_testing/TestConformanceTest.py' + scripts/run_in_python_env.sh out/venv 'python3 ./src/python_testing/TestChoiceConformanceSupport.py' + scripts/run_in_python_env.sh out/venv 'python3 ./src/python_testing/TestMatterTestingSupport.py' + scripts/run_in_python_env.sh out/venv 'python3 ./src/python_testing/TestSpecParsingSupport.py' + scripts/run_in_python_env.sh out/venv 'python3 ./src/python_testing/test_testing/test_TC_ICDM_2_1.py' + scripts/run_in_python_env.sh out/venv 'python3 ./src/python_testing/test_testing/test_IDM_10_4.py' + scripts/run_in_python_env.sh out/venv 'python3 ./src/python_testing/test_testing/test_TC_SC_7_1.py' + scripts/run_in_python_env.sh out/venv 'python3 ./src/python_testing/test_testing/TestDecorators.py' + + + - name: Uploading core files + uses: actions/upload-artifact@v4 + if: ${{ failure() && !env.ACT }} + with: + name: crash-core-linux-python-repl + path: /tmp/cores/ + # Cores are big; don't hold on to them too long. + retention-days: 5 + - name: Uploading objdir for debugging + uses: actions/upload-artifact@v4 + if: ${{ failure() && !env.ACT }} + with: + name: crash-objdir-linux-python-repl + path: objdir-clone/ + # objdirs are big; don't hold on to them too long. + retention-days: 5 + + repl_tests_darwin: + name: REPL Tests - Darwin + + strategy: + matrix: + build_variant: [no-ble-no-wifi-tsan-clang] + env: + BUILD_VARIANT: ${{matrix.build_variant}} + TSAN_OPTIONS: "halt_on_error=1" + + if: github.actor != 'restyled-io[bot]' && false + runs-on: macos-13 + + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Setup Environment + # coreutils for stdbuf + run: brew install coreutils + - name: + Try to ensure the directories for core dumping and diagnostic + log collection exist and we can write them. + run: | + sudo chown ${USER} /cores || true + mkdir -p ~/Library/Logs/DiagnosticReports || true + mkdir objdir-clone || true + - name: Checkout submodules & Bootstrap + uses: ./.github/actions/checkout-submodules-and-bootstrap + with: + platform: darwin + bootstrap-log-name: bootstrap-logs-darwin-${{ matrix.build_variant }}${{ matrix.chip_tool }} + + - name: Build Python REPL and example apps + run: | + scripts/run_in_build_env.sh './scripts/build_python.sh --install_virtual_env out/venv' + ./scripts/run_in_build_env.sh \ + "./scripts/build/build_examples.py \ + --target darwin-x64-all-clusters-${BUILD_VARIANT}-test \ + build \ + --copy-artifacts-to objdir-clone \ + " + - name: Run Tests + run: | + scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --app out/darwin-x64-all-clusters-no-ble-no-wifi-tsan-clang-test/chip-all-clusters-app --factoryreset --quiet --app-args "--discriminator 3840 --interface-id -1" --script-args "-t 3600 --disable-test ClusterObjectTests.TestTimedRequestTimeout"' + - name: Uploading core files + uses: actions/upload-artifact@v4 + if: ${{ failure() && !env.ACT }} + with: + name: crash-core-darwin-python-repl + path: /cores/ + # Cores are big; don't hold on to them too long. + retention-days: 5 + - name: Uploading traces on failure + uses: actions/upload-artifact@v4 + if: ${{ failure() && !env.ACT }} + with: + name: trace-data-python-repl + path: out/trace_data/ + retention-days: 5 + - name: Uploading diagnostic logs + uses: actions/upload-artifact@v4 + if: ${{ failure() && !env.ACT }} + with: + name: crash-log-darwin-python-repl + path: ~/Library/Logs/DiagnosticReports/ + - name: Uploading objdir for debugging + uses: actions/upload-artifact@v4 + if: ${{ failure() && !env.ACT }} + with: + name: crash-objdir-darwin-python-repl + path: objdir-clone/ + # objdirs are big; don't hold on to them too long. + retention-days: 5 diff --git a/.github/workflows/third-party-check.yaml b/.github/workflows/third-party-check.yaml new file mode 100644 index 0000000000..beda0af41b --- /dev/null +++ b/.github/workflows/third-party-check.yaml @@ -0,0 +1,39 @@ +# Copyright (c) 2024 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: Check for Unintentional Submodule Updates + +on: + pull_request: + branches-ignore: + - "dependabot/**" + paths: + - "third_party/**" + - ".gitmodules" + +jobs: + check-submodule-update-label: + name: Check For Submodule Update Label + runs-on: ubuntu-latest + steps: + - if: ${{ !contains(github.event.pull_request.labels.*.name, 'changing-submodules-on-purpose') }} + name: Fail + run: | + echo This pull request attempts to update submodules without the changing-submodules-on-purpose label. Please apply that label if the changes are intentional, or remove those changes. + exit 1 + - if: ${{ contains(github.event.pull_request.labels.*.name, 'changing-submodules-on-purpose') }} + name: Success + run: | + echo PR looks good. + exit 0 diff --git a/.github/workflows/todos.yaml b/.github/workflows/todos.yaml new file mode 100644 index 0000000000..cc2148da4e --- /dev/null +++ b/.github/workflows/todos.yaml @@ -0,0 +1,38 @@ +name: Create issues from To-Dos + +on: + workflow_dispatch: + inputs: + importAll: + default: "false" + required: false + type: boolean + description: Enable, if you want to import all TODOs. Runs on checked out branch! Only use if you're sure what you are doing. +# push: Will move this to a cadence +# branches: +# - master + +permissions: + issues: write + repository-projects: read + contents: read + +jobs: + todos: + name: Scan for To-Dos + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Run Issue Bot + uses: derjuulsn/todo-issue@main + with: + # autoAssign: false + reopenClosed: false + # label: "todo" + # disabled until this works: https://github.com/DerJuulsn/todo-issue/issues/9 + keywords: "todo,fixme,bug,TODO,FIXME,BUG" + excludePattern: "^(node_modules/|third_party/|zzz_generated/|docs/|.vscode/)" + env: + GITHUB_TOKEN: ${{ secrets.MATTER_PAT }} diff --git a/.github/workflows/unit_integration_test.yaml b/.github/workflows/unit_integration_test.yaml new file mode 100644 index 0000000000..040e50f153 --- /dev/null +++ b/.github/workflows/unit_integration_test.yaml @@ -0,0 +1,88 @@ +# Copyright (c) 2020 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: Unit / Integration Tests + +on: + push: + branches-ignore: + - 'dependabot/**' + pull_request: + merge_group: + +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: + unit_tests: + name: Unit / Integration Tests + if: github.actor != 'restyled-io[bot]' + + strategy: + matrix: + type: [main, clang, mbedtls, rotating_device_id, icd] + env: + BUILD_TYPE: ${{ matrix.type }} + + runs-on: ubuntu-latest + + container: + image: ghcr.io/project-chip/chip-build:74 + volumes: + - "/:/runner-root-volume" + - "/tmp/log_output:/tmp/test_logs" + options: --privileged --sysctl "net.ipv6.conf.all.disable_ipv6=0 net.ipv4.conf.all.forwarding=1 net.ipv6.conf.all.forwarding=1" + + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Checkout submodules & Bootstrap + uses: ./.github/actions/checkout-submodules-and-bootstrap + with: + platform: linux + bootstrap-log-name: bootstrap-logs-unittest-${{ matrix.type }} + - name: Artifact suffix + id: outsuffix + uses: haya14busa/action-cond@v1 + if: ${{ !env.ACT }} + with: + cond: ${{ github.event.pull_request.number == '' }} + if_true: "${{ github.sha }}" + if_false: "pull-${{ github.event.pull_request.number }}" + - name: Setup Build + # TODO: If rotating_device_id is ever removed/combined, we have to cover boringssl otherwise + run: | + case $BUILD_TYPE in + "main") GN_ARGS='';; + "clang") GN_ARGS='is_clang=true';; + "mbedtls") GN_ARGS='chip_crypto="mbedtls"';; + "rotating_device_id") GN_ARGS='chip_crypto="boringssl" chip_enable_rotating_device_id=true';; + "icd") GN_ARGS='chip_enable_icd_server=true chip_enable_icd_lit=true';; + *) ;; + esac + + scripts/build/gn_gen.sh --args="$GN_ARGS chip_data_model_check_die_on_failure=true" + - name: Run Build + run: scripts/run_in_build_env.sh "ninja -C out/$BUILD_TYPE" + - name: Run Tests + run: scripts/tests/gn_tests.sh + # TODO Log Upload https://github.com/project-chip/connectedhomeip/issues/2227 + # TODO https://github.com/project-chip/connectedhomeip/issues/1512 + # - name: Run Code Coverage + # if: ${{ contains('main', env.BUILD_TYPE) }} + # run: scripts/tools/codecoverage.sh + # - name: Upload Code Coverage + # if: ${{ contains('main', env.BUILD_TYPE) }} + # run: bash <(curl -s https://codecov.io/bash) diff --git a/.github/workflows/zap_regeneration.yaml b/.github/workflows/zap_regeneration.yaml new file mode 100644 index 0000000000..dca68cc94e --- /dev/null +++ b/.github/workflows/zap_regeneration.yaml @@ -0,0 +1,54 @@ +# Copyright (c) 2020 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: ZAP - Regenerate + +on: + 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: + zap_regeneration: + name: ZAP Regeneration + + runs-on: ubuntu-20.04 + container: + image: ghcr.io/project-chip/chip-build:74 + defaults: + run: + shell: sh + if: github.actor != 'restyled-io[bot]' + + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + submodules: true + - name: Checkout submodules & Bootstrap + uses: ./.github/actions/checkout-submodules-and-bootstrap + with: + platform: linux + + - name: Generate all + run: ./scripts/run_in_build_env.sh scripts/tools/zap_regen_all.py + - uses: EndBug/add-and-commit@v9 + with: + default_author: github_actions + message: Regenerating ZAP diff --git a/.github/workflows/zap_templates.yaml b/.github/workflows/zap_templates.yaml new file mode 100644 index 0000000000..5ed20b29ad --- /dev/null +++ b/.github/workflows/zap_templates.yaml @@ -0,0 +1,75 @@ +# Copyright (c) 2020 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: ZAP + +on: + push: + branches-ignore: + - 'dependabot/**' + pull_request: + merge_group: + +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: + zap_templates: + name: ZAP templates generation + + runs-on: ubuntu-20.04 + container: + image: ghcr.io/project-chip/chip-build:74 + defaults: + run: + shell: sh + if: github.actor != 'restyled-io[bot]' + + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Checkout submodules & Bootstrap + uses: ./.github/actions/checkout-submodules-and-bootstrap + with: + platform: linux + # Java formatting requires a newer java to run ktfmt + # TODO: this should be eventually inside Docker files + - name: Update java + run: | + apt-get update + DEBIAN_FRONTEND=noninteractive apt-get install -fy --fix-missing openjdk-17-jre + # Clean out java generated files: since java codegen will generate one file per + # structure/cluster, if clusters and structures are ever changed (for in progress work) + # this may leave obsolete files. Ensure we always check for clean regen. + - name: Ensure clean java + run: rm -rf src/controller/java/generated/ + - name: Generate all + run: ./scripts/run_in_build_env.sh scripts/tools/zap_regen_all.py + - name: Generate script-maintained items (ERROR_CODES.md) + run: ./scripts/run_in_build_env.sh "scripts/error_table.py > docs/ERROR_CODES.md" + - name: Ensure git works in current working directory + run: git config --global --add safe.directory `pwd` + - name: Check for uncommited changes + run: | + git add . + # Show the full diff + git diff-index -p HEAD -- + # Also show just the files that are different, to make it easy + # to tell at a glance what might be going on. And throw in + # --exit-code to make this job fail if there is a difference. + git diff-index --exit-code HEAD --