Skip to content

Commit 51d633b

Browse files
committed
Add .github/workflows/build.yml, fix CI build failures
1 parent 416dc40 commit 51d633b

File tree

3 files changed

+66
-1
lines changed

3 files changed

+66
-1
lines changed

.github/workflows/build.yml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: Build Matter Examples
2+
3+
on:
4+
push:
5+
branches: ["main"]
6+
pull_request:
7+
branches: ["main"]
8+
schedule:
9+
# Build on Mondays at 9am PST every week
10+
- cron: '0 17 * * 1'
11+
12+
concurrency:
13+
group: ${{ github.workflow }}-${{ github.ref }}
14+
cancel-in-progress: true
15+
16+
jobs:
17+
build:
18+
runs-on: ubuntu-latest
19+
container: espressif/esp-matter:latest
20+
21+
strategy:
22+
fail-fast: false
23+
matrix:
24+
example: [empty-template, led-blink, smart-light]
25+
26+
steps:
27+
- name: Checkout repo
28+
uses: actions/checkout@v4
29+
30+
- name: Install Swift & CMake
31+
run: |
32+
set -vex
33+
34+
# TODO: swap for an official downloadable toolchain once it's out
35+
SWIFT_TOOLCHAIN_VERSION=swift-DEVELOPMENT-SNAPSHOT-2024-12-13-a
36+
#wget https://download.swift.org/development/ubuntu2204/${SWIFT_TOOLCHAIN_VERSION}/${SWIFT_TOOLCHAIN_VERSION}-ubuntu22.04.tar.gz
37+
wget https://download.swift.org/tmp-ci-nightly/development/swift-DEVELOPMENT-SNAPSHOT-2024-12-13-a-4019/ubuntu2204/swift-DEVELOPMENT-SNAPSHOT-2024-12-13-a/swift-DEVELOPMENT-SNAPSHOT-2024-12-13-a-ubuntu2204.tar.gz
38+
39+
tar vxzf ${SWIFT_TOOLCHAIN_VERSION}-ubuntu2204.tar.gz
40+
export PATH="`pwd`/usr/bin/:$PATH"
41+
swiftc --version
42+
43+
wget https://github.com/Kitware/CMake/releases/download/v3.30.2/cmake-3.30.2-linux-x86_64.tar.gz
44+
tar xzf cmake-3.30.2-linux-x86_64.tar.gz
45+
export PATH="`pwd`/cmake-3.30.2-linux-x86_64/bin:$PATH"
46+
cmake --version
47+
48+
echo "PATH=$PATH" >> $GITHUB_ENV
49+
50+
- name: Build with idf.py
51+
run: |
52+
pwd
53+
cd /opt/espressif/esp-idf
54+
. ./export.sh
55+
cd -
56+
cd /opt/espressif/esp-matter
57+
. ./export.sh
58+
cd -
59+
cd ${{ matrix.example }}/
60+
idf.py set-target esp32c6 &&
61+
idf.py build

smart-light/Matter/Matter.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@ extension Matter {
2121
endpoints.append(endpoint)
2222
}
2323

24-
var innerNode: RootNode
24+
// swift-format-ignore: NeverUseImplicitlyUnwrappedOptionals
25+
// This is never actually nil after init(), and inside init we want to form a callback closure that references self.
26+
var innerNode: RootNode!
2527

2628
init() {
2729
// Initialize persistent storage.

smart-light/main/BridgingHeader.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@
3838
//
3939
// connectedhomeip/src/credentials/FabricTable.h:82:69: error: use of undeclared identifier 'strnlen'
4040
extern "C" size_t strnlen(const char *s, size_t maxlen);
41+
// esp-matter/components/esp_matter/esp_matter_client.h:57:26: error: use of undeclared identifier 'strdup'
42+
extern "C" char *strdup(const char *s1);
4143

4244
#include <esp_matter.h>
4345
#include <esp_matter_cluster.h>

0 commit comments

Comments
 (0)