Skip to content
Open
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
26 changes: 26 additions & 0 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ on:
types: [opened, synchronize, labeled, unlabeled]
paths:
- 'drivers/**'
- 'tools/run_driver_tests.py'
- 'tools/run_driver_tests_p.py'

jobs:
# Two separate jobs for finding the right artifact to run tests with
Expand Down Expand Up @@ -91,11 +93,35 @@ jobs:
- run: echo ${{ steps.changed-drivers.outputs.all_modified_files }}
- name: Install Python requirements
run: pip install -r tools/requirements.txt
- name: Fetch capability definitions
continue-on-error: true
run: |
python3 tools/fetch_capability_definitions.py \
--drivers-dir ${{ github.workspace }}/drivers \
--output-dir ${{ github.workspace }}/capability_json \
--failed-output-file ${{ github.workspace }}/capability_failures_comment.md
env:
CAPABILITY_PAT: ${{ secrets.CAPABILITY_DEFINITIONS_PAT }}
- name: Report capability download failures
if: github.event_name == 'pull_request' && hashFiles('capability_failures_comment.md') != '' && always()

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

github.event_name == 'pull_request' is unnecessary as this workflow will only fire on PRs

uses: mshick/add-pr-comment@v2
with:
message-path: ${{ github.workspace }}/capability_failures_comment.md
message-id: capability-download-failures
- name: Clear capability download failures comment
if: github.event_name == 'pull_request' && hashFiles('capability_failures_comment.md') == '' && always()
uses: mshick/add-pr-comment@v2
with:
message: "All capability definitions downloaded successfully."
message-id: capability-download-failures
delete-on-status: success
status: success
- name: Run the tests
id: run-tests
run: python tools/run_driver_tests_p.py ${{ steps.changed-drivers.outputs.all_modified_files }}
env:
LUA_PATH: ${{ steps.lua_path.outputs.lua_path }}
ST_CAPABILITY_JSON_DIR: ${{ github.workspace }}/capability_json
- name: Upload test artifact
if: always()
uses: actions/upload-artifact@v4
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ local cluster_base = require "st.zigbee.cluster_base"
local data_types = require "st.zigbee.data_types"
local t_utils = require "integration_test.utils"
local zigbee_test_utils = require "integration_test.zigbee_test_utils"
local custom_capabilities = require "shus-mattress/custom_capabilities"

local shus_mattress_profile_def = t_utils.get_profile_definition("shus-smart-mattress.yml")
test.add_package_capability("aiMode.yaml")
Expand All @@ -18,6 +17,8 @@ test.add_package_capability("strongExpMode.yaml")
test.add_package_capability("yoga.yaml")
test.add_package_capability("mattressHardness.yaml")

local custom_capabilities = require "shus-mattress/custom_capabilities"

local PRIVATE_CLUSTER_ID = 0xFCC2
local MFG_CODE = 0x1235

Expand Down
Loading
Loading