Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add .github/workflows/build.yml #32

Merged
merged 1 commit into from
Dec 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 58 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Build Matter Examples

on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
schedule:
# Build on Mondays at 9am PST every week
- cron: '0 17 * * 1'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build:
runs-on: ubuntu-latest
container: espressif/esp-matter:latest

strategy:
fail-fast: false
matrix:
example: [empty-template, led-blink, smart-light]
swift: [swift-DEVELOPMENT-SNAPSHOT-2024-12-13-a]

steps:
- name: Checkout repo
uses: actions/checkout@v4

- name: Install Swift ${{ matrix.swift }} & CMake
run: |
set -vex

wget -q https://download.swift.org/development/ubuntu2404/${{ matrix.swift }}/${{ matrix.swift }}-ubuntu24.04.tar.gz
tar xzf ${{ matrix.swift }}-ubuntu24.04.tar.gz
export PATH="$PATH:`pwd`/${{ matrix.swift }}-ubuntu24.04/usr/bin/"
swiftc --version

wget https://github.com/Kitware/CMake/releases/download/v3.30.2/cmake-3.30.2-linux-x86_64.tar.gz
tar xzf cmake-3.30.2-linux-x86_64.tar.gz
export PATH="`pwd`/cmake-3.30.2-linux-x86_64/bin:$PATH"
cmake --version

echo "PATH=$PATH" >> $GITHUB_ENV

- name: Build with idf.py
run: |
pwd
cd /opt/espressif/esp-idf
. ./export.sh
cd -
cd /opt/espressif/esp-matter
. ./export.sh
cd -
cd ${{ matrix.example }}/
idf.py set-target esp32c6 &&
idf.py build
2 changes: 2 additions & 0 deletions empty-template/main/BridgingHeader.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@
//
// connectedhomeip/src/credentials/FabricTable.h:82:69: error: use of undeclared identifier 'strnlen'
extern "C" size_t strnlen(const char *s, size_t maxlen);
// esp-matter/components/esp_matter/esp_matter_client.h:57:26: error: use of undeclared identifier 'strdup'
extern "C" char *strdup(const char *s1);

#include <esp_matter.h>
#include <esp_matter_cluster.h>
Expand Down
2 changes: 2 additions & 0 deletions led-blink/main/BridgingHeader.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@
//
// connectedhomeip/src/credentials/FabricTable.h:82:69: error: use of undeclared identifier 'strnlen'
extern "C" size_t strnlen(const char *s, size_t maxlen);
// esp-matter/components/esp_matter/esp_matter_client.h:57:26: error: use of undeclared identifier 'strdup'
extern "C" char *strdup(const char *s1);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason to do this instead of #include <string.h>

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't spend time investigating why, but #include <string.h> didn't resolve the problem.


#include <esp_matter.h>
#include <esp_matter_cluster.h>
Expand Down
4 changes: 3 additions & 1 deletion smart-light/Matter/Matter.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ extension Matter {
endpoints.append(endpoint)
}

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

init() {
// Initialize persistent storage.
Expand Down
2 changes: 2 additions & 0 deletions smart-light/main/BridgingHeader.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@
//
// connectedhomeip/src/credentials/FabricTable.h:82:69: error: use of undeclared identifier 'strnlen'
extern "C" size_t strnlen(const char *s, size_t maxlen);
// esp-matter/components/esp_matter/esp_matter_client.h:57:26: error: use of undeclared identifier 'strdup'
extern "C" char *strdup(const char *s1);

#include <esp_matter.h>
#include <esp_matter_cluster.h>
Expand Down
Loading