Skip to content

Commit

Permalink
test pr
Browse files Browse the repository at this point in the history
Signed-off-by: Piotr Narajowski <[email protected]>
  • Loading branch information
piotrnarajowski committed Apr 22, 2024
1 parent 53512bb commit 3600808
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 21 deletions.
57 changes: 36 additions & 21 deletions .github/workflows/check_pr_changes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,39 +8,54 @@ on:
jobs:
check_changes:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: List changed files
id: list_files
run: |
git diff --name-only origin/master...HEAD > changed_files.txt
uses: actions/checkout@v3
with:
fetch-depth: 2

- name: Check for changes in autopts/wid directory
id: check_changes
run: |
if grep -q "^autopts/wid/" changed_files.txt; then
echo "::set-output name=changes_detected::true"
if git diff --name-only HEAD^ HEAD -- autopts/wid/ | grep -q "."; then
echo "changes_detected=true" >> GITHUB_ENV
else
echo "::set-output name=changes_detected::false"
echo "changes_detected=false" >> GITHUB_ENV
exit 0
fi
- name: Extract filenames
id: extract_filenames
if: env.changes_detected == 'true'
run: |
changed_files=$(git diff --name-only HEAD^ HEAD -- autopts/wid/)
echo "::set-output name=filenames::$(echo "$changed_files" | tr '\n' ',')"
- name: Parse filenames
id: parse_filenames
if: steps.check_changes.outputs.changes_detected == 'true'
run: |
filenames=$(echo "${{ steps.extract_filenames.outputs.filenames }}" | tr ',' '\n')
extracted_names=""
for filename in $filenames; do
name_wo_extension=$(basename "$filename" .py)
name_formatted=$(echo "$name_wo_extension" | tr '[:lower:]' '[:upper:]')
extracted_names="$extracted_names $name_formatted"
done
extracted_names=$(echo "$extracted_names" | xargs)
echo "::set-output name=extracted_names::$extracted_names"
- name: Post comment on PR if changes detected
if: steps.check_changes.outputs.changes_detected == 'true'
uses: actions/github-script@v4
uses: actions/github-script@v6
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const context = github.context;
const owner = context.payload.repository.owner.login;
const repo = context.payload.repository.name;
const prNumber = context.payload.pull_request.number;
const commentBody = '#AutoPTS run zephyr MCP';
github.issues.createComment({
owner,
repo,
issue_number: prNumber,
const extractedNames = '${{ steps.parse_filenames.outputs.extracted_names }}'.trim();
const commentBody = `#AutoPTS run zephyr ${extractedNames}`;
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: commentBody
});
})
1 change: 1 addition & 0 deletions autopts/wid/gatt_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ def hdl_wid_1(_: WIDParams):

def hdl_wid_2(_: WIDParams):
"""
#test
Please initiate a GATT connection to the PTS.
Description: Verify that the Implementation Under Test (IUT) can
Expand Down
2 changes: 2 additions & 0 deletions autopts/wid/hap.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ def hdl_wid_477(_: WIDParams):
"""
stack = get_stack()

# test

stack.ias.wait_for_high_alert()

return stack.ias.alert_lvl == 2
Expand Down
2 changes: 2 additions & 0 deletions autopts/wid/mcp.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ def hdl_wid_15(params: WIDParams):

stack = get_stack()

# test

if stack.mcp.error_opcodes != [2, 3, 4]:
return False

Expand Down

0 comments on commit 3600808

Please sign in to comment.