Skip to content

Commit 1bf35f9

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

File tree

5 files changed

+67
-1
lines changed

5 files changed

+67
-1
lines changed

.github/workflows/build.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
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+
swift: [swift-DEVELOPMENT-SNAPSHOT-2024-12-13-a]
26+
27+
steps:
28+
- name: Checkout repo
29+
uses: actions/checkout@v4
30+
31+
- name: Install Swift ${{ matrix.swift }} & CMake
32+
run: |
33+
set -vex
34+
35+
wget -q https://download.swift.org/development/ubuntu2404/${{ matrix.swift }}/${{ matrix.swift }}-ubuntu24.04.tar.gz
36+
tar xzf ${{ matrix.swift }}-ubuntu24.04.tar.gz
37+
export PATH="$PATH:`pwd`/${{ matrix.swift }}-ubuntu24.04/usr/bin/"
38+
swiftc --version
39+
40+
wget https://github.com/Kitware/CMake/releases/download/v3.30.2/cmake-3.30.2-linux-x86_64.tar.gz
41+
tar xzf cmake-3.30.2-linux-x86_64.tar.gz
42+
export PATH="`pwd`/cmake-3.30.2-linux-x86_64/bin:$PATH"
43+
cmake --version
44+
45+
echo "PATH=$PATH" >> $GITHUB_ENV
46+
47+
- name: Build with idf.py
48+
run: |
49+
pwd
50+
cd /opt/espressif/esp-idf
51+
. ./export.sh
52+
cd -
53+
cd /opt/espressif/esp-matter
54+
. ./export.sh
55+
cd -
56+
cd ${{ matrix.example }}/
57+
idf.py set-target esp32c6 &&
58+
idf.py build

empty-template/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>

led-blink/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>

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)