Skip to content

Commit

Permalink
Regenerating ZAP
Browse files Browse the repository at this point in the history
  • Loading branch information
woody-apple committed Oct 27, 2021
2 parents a2305f5 + 2149dae commit dada6df
Show file tree
Hide file tree
Showing 57 changed files with 3,678 additions and 2,466 deletions.
70 changes: 44 additions & 26 deletions .github/workflows/zap_regeneration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,40 +16,58 @@ name: ZAP - Regenerate

on:
workflow_dispatch:
issue_comment:
types: [created]

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:
zap_regenerate:
name: ZAP - Regenerate
zap_regeneration:
name: ZAP Regeneration
timeout-minutes: 60

runs-on: ubuntu-18.04
if: (github.event.issue.pull_request != '' && contains(github.event.comment.body, '/regenerate')) || (github.event_name == 'workflow_dispatch')
if: github.actor != 'restyled-io[bot]'

steps:
- name: Checkout the latest code
uses: actions/checkout@v2
with:
token: ${{ secrets.APPLE_PERSONAL_ACCESS_TOKEN }}
fetch-depth: 0 # otherwise, you will fail to push refs to dest repo
- name: Use Node.js 14.x
uses: actions/setup-node@v2
with:
node-version: '14'
- name: Use Java
uses: actions/setup-java@v2
with:
distribution: 'zulu'
java-version: '11'
java-package: jre
- run: sudo apt-get update
- run: sudo apt-get install -fy --fix-missing libpixman-1-dev libcairo-dev libsdl-pango-dev libjpeg-dev libgif-dev python-autopep8
- name: Rebase and regenerate
run: scripts/helpers/rebase_and_regenerate_zap.sh
env:
GITHUB_TOKEN: ${{ secrets.APPLE_PERSONAL_ACCESS_TOKEN }}
- name: Checkout
uses: actions/checkout@v2
with:
submodules: true
- name: Use Node.js 14.x
uses: actions/setup-node@v1
with:
node-version: '14.x'
- name: Use Java
uses: actions/setup-java@v2
with:
distribution: 'zulu'
java-version: '11'
java-package: jre
- run: sudo apt-get update
- run: sudo apt-get install --fix-missing libpixman-1-dev libcairo-dev libsdl-pango-dev libjpeg-dev libgif-dev python-autopep8
- name: Setup ZAP
timeout-minutes: 5
run: |
cd third_party/zap/repo/
npm ci
npm run version-stamp
npm rebuild canvas --update-binary
npm run build-spa
- name: Generate all
timeout-minutes: 5
run: scripts/tools/zap_regen_all.py
- name: Add uncommitted changes
run: git add .
- name: Fix upstream
run: |
git remote set-url origin https://x-access-token:[email protected]/$GITHUB_REPOSITORY.git
git config --global user.email "$USER_EMAIL"
git config --global user.name "$USER_NAME"
env:
COMMITTER_TOKEN: ${{ secrets.MATTER_PAT }}
USER_EMAIL: ${{ secrets.MATTER_PAT_EMAIL }}
USER_NAME: ${{ secrets.MATTER_PAT_NAME }}
GITHUB_REPOSITORY: ${{ github.GITHUB_REPOSITORY }}
- name: Push
run: git push
8 changes: 6 additions & 2 deletions .github/workflows/zap_templates.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,5 +61,9 @@ jobs:
- name: Check for uncommited changes
run: |
git add .
git diff-index HEAD --
git diff-index --quiet HEAD --
# 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 --
77 changes: 62 additions & 15 deletions config/mbed/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -225,8 +225,12 @@ if (CONFIG_CHIP_PW_RPC)
list(APPEND CHIP_LIBRARIES -lPwRpc)
if (${APP_TARGET} MATCHES "pigweed-app")
set(CONFIG_CHIP_PW_RPC_ECHO_PROTO "y")
else()
set(CONFIG_CHIP_PW_RPC_ECHO_PROTO "n")
elseif (${APP_TARGET} MATCHES "lighting-app")
set(CONFIG_CHIP_PW_RPC_COMMON_PROTO "y")
set(CONFIG_CHIP_PW_RPC_LIGHTING_PROTO "y")
elseif (${APP_TARGET} MATCHES "lock-app")
set(CONFIG_CHIP_PW_RPC_COMMON_PROTO "y")
set(CONFIG_CHIP_PW_RPC_LOCKING_PROTO "y")
endif()
endif(CONFIG_CHIP_PW_RPC)

Expand Down Expand Up @@ -271,6 +275,9 @@ chip_gn_arg_bool ("chip_bypass_rendezvous" CONFIG_CHIP_BYPASS_REN
chip_gn_arg_bool ("chip_build_pw_rpc_lib" CONFIG_CHIP_PW_RPC)
if (CONFIG_CHIP_PW_RPC)
chip_gn_arg_bool ("chip_build_pw_rpc_echo_proto" CONFIG_CHIP_PW_RPC_ECHO_PROTO)
chip_gn_arg_bool ("chip_build_pw_rpc_common_proto" CONFIG_CHIP_PW_RPC_COMMON_PROTO)
chip_gn_arg_bool ("chip_build_pw_rpc_lighting_proto" CONFIG_CHIP_PW_RPC_LIGHTING_PROTO)
chip_gn_arg_bool ("chip_build_pw_rpc_locking_proto" CONFIG_CHIP_PW_RPC_LOCKING_PROTO)
endif(CONFIG_CHIP_PW_RPC)

file(GENERATE OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/args.gn CONTENT ${CHIP_GN_ARGS})
Expand Down Expand Up @@ -335,26 +342,18 @@ endif()
if (CONFIG_CHIP_PW_RPC)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++17" PARENT_SCOPE)
list(APPEND CHIP_DEFINES
CONFIG_CHIP_PW_RPC=1
CHIP_PW_RPC=1
)
endif()

target_include_directories(${APP_TARGET} PRIVATE
${CHIP_INCLUDES}
)

target_compile_definitions(${APP_TARGET} PRIVATE
${CHIP_DEFINES}
)


if (CONFIG_CHIP_PW_RPC)

set(PIGWEED_ROOT "${CHIP_ROOT}/third_party/pigweed/repo")

target_sources(${APP_TARGET} PRIVATE
${CHIP_ROOT}/examples/common/pigweed/RpcService.cpp
${CHIP_ROOT}/examples/common/pigweed/mbed/PigweedLoggerMutex.cpp
${CHIP_ROOT}/examples/common/pigweed/mbed/Rpc.cpp
${MBED_COMMON}/util/PigweedLogger.cpp
)

Expand Down Expand Up @@ -389,16 +388,64 @@ target_include_directories(${APP_TARGET} PRIVATE
${CHIP_ROOT}/third_party/nanopb/repo

${CHIP_ROOT}/examples/common
${CHIP_ROOT}/examples//common/pigweed/mbed
${CHIP_ROOT}/examples/common/pigweed
${CHIP_ROOT}/examples/common/pigweed/mbed
${MBED_COMMON}/pw_sys_io/public

${CMAKE_CURRENT_BINARY_DIR}/protocol_buffer/gen/third_party/connectedhomeip/third_party/pigweed/repo/pw_rpc/protos.proto_library/pwpb
${CMAKE_CURRENT_BINARY_DIR}/protocol_buffer/gen/third_party/connectedhomeip/third_party/pigweed/repo/pw_protobuf/common_protos.proto_library/nanopb
)

if (CONFIG_CHIP_PW_RPC_ECHO_PROTO)
target_include_directories(${APP_TARGET} PRIVATE
${CMAKE_CURRENT_BINARY_DIR}/protocol_buffer/gen/third_party/connectedhomeip/third_party/pigweed/repo/pw_rpc/protos.proto_library/nanopb_rpc
${CMAKE_CURRENT_BINARY_DIR}/protocol_buffer/gen/third_party/connectedhomeip/third_party/pigweed/repo/pw_rpc/protos.proto_library/nanopb
${CMAKE_CURRENT_BINARY_DIR}/protocol_buffer/gen/third_party/connectedhomeip/third_party/pigweed/repo/pw_rpc/protos.proto_library/pwpb
)
list(APPEND CHIP_DEFINES
CHIP_PW_RPC_ECHO_PROTO=1
)
endif(CONFIG_CHIP_PW_RPC_ECHO_PROTO)

endif(CONFIG_CHIP_PW_RPC)
if (CONFIG_CHIP_PW_RPC_COMMON_PROTO)
target_include_directories(${APP_TARGET} PRIVATE
${CMAKE_CURRENT_BINARY_DIR}/protocol_buffer/gen/third_party/connectedhomeip/examples/common/pigweed/button_service.proto_library/nanopb
${CMAKE_CURRENT_BINARY_DIR}/protocol_buffer/gen/third_party/connectedhomeip/examples/common/pigweed/button_service.proto_library/nanopb_rpc

${CMAKE_CURRENT_BINARY_DIR}/protocol_buffer/gen/third_party/connectedhomeip/examples/common/pigweed/device_service.proto_library/nanopb
${CMAKE_CURRENT_BINARY_DIR}/protocol_buffer/gen/third_party/connectedhomeip/examples/common/pigweed/device_service.proto_library/nanopb_rpc
)
list(APPEND CHIP_DEFINES
CHIP_PW_RPC_COMMON_PROTO=1
)
endif(CONFIG_CHIP_PW_RPC_COMMON_PROTO)

if (CONFIG_CHIP_PW_RPC_LIGHTING_PROTO)
target_include_directories(${APP_TARGET} PRIVATE
${CMAKE_CURRENT_BINARY_DIR}/protocol_buffer/gen/third_party/connectedhomeip/examples/common/pigweed/lighting_service.proto_library/nanopb
${CMAKE_CURRENT_BINARY_DIR}/protocol_buffer/gen/third_party/connectedhomeip/examples/common/pigweed/lighting_service.proto_library/nanopb_rpc
)
list(APPEND CHIP_DEFINES
CHIP_PW_RPC_LIGHTING_PROTO=1
)
endif(CONFIG_CHIP_PW_RPC_LIGHTING_PROTO)

if (CONFIG_CHIP_PW_RPC_LOCKING_PROTO)
target_include_directories(${APP_TARGET} PRIVATE
${CMAKE_CURRENT_BINARY_DIR}/protocol_buffer/gen/third_party/connectedhomeip/examples/common/pigweed/locking_service.proto_library/nanopb
${CMAKE_CURRENT_BINARY_DIR}/protocol_buffer/gen/third_party/connectedhomeip/examples/common/pigweed/locking_service.proto_library/nanopb_rpc
)
list(APPEND CHIP_DEFINES
CHIP_PW_RPC_LOCKING_PROTO=1
)
endif(CONFIG_CHIP_PW_RPC_LOCKING_PROTO)

endif(CONFIG_CHIP_PW_RPC)


target_include_directories(${APP_TARGET} PRIVATE
${CHIP_INCLUDES}
)

target_compile_definitions(${APP_TARGET} PRIVATE
${CHIP_DEFINES}
)
20 changes: 20 additions & 0 deletions config/mbed/chip-gn/lib/pw_rpc/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ import("$dir_pw_build/target_types.gni")

declare_args() {
chip_build_pw_rpc_echo_proto = false
chip_build_pw_rpc_common_proto = false
chip_build_pw_rpc_lighting_proto = false
chip_build_pw_rpc_locking_proto = false
}

static_library("pw_rpc") {
Expand All @@ -37,6 +40,23 @@ static_library("pw_rpc") {
deps += [ "$dir_pw_rpc/nanopb:echo_service" ]
}

if (chip_build_pw_rpc_common_proto) {
deps += [
"${chip_root}/examples/common/pigweed:button_service.nanopb_rpc",
"${chip_root}/examples/common/pigweed:device_service.nanopb_rpc",
]
}

if (chip_build_pw_rpc_lighting_proto) {
deps +=
[ "${chip_root}/examples/common/pigweed:lighting_service.nanopb_rpc" ]
}

if (chip_build_pw_rpc_locking_proto) {
deps +=
[ "${chip_root}/examples/common/pigweed:locking_service.nanopb_rpc" ]
}

deps += pw_build_LINK_DEPS

output_dir = "${root_out_dir}/lib"
Expand Down
7 changes: 7 additions & 0 deletions examples/chip-tool/templates/tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,12 @@ function getTests()

const MediaControl = [
'Test_TC_MC_1_1',
'Test_TC_MC_3_6',
'Test_TC_MC_3_7',
'Test_TC_MC_3_8',
'Test_TC_MC_3_9',
'Test_TC_MC_3_10',
'Test_TC_MC_3_11',
];

const OnOff = [
Expand Down Expand Up @@ -132,6 +138,7 @@ function getTests()
'TestLogCommands',
'TestDescriptorCluster',
'TestBasicInformation',
'TestIdentifyCluster',
'TestOperationalCredentialsCluster',
];

Expand Down
Loading

0 comments on commit dada6df

Please sign in to comment.