Merge pull request #16 from jxg81/fan-only-mode-support #39
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node | |
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions | |
name: Build and Test | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
workflow_dispatch: | |
jobs: | |
build: | |
environment: predeployment | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [16.x] | |
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/ | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node-version }} | |
cache: 'npm' | |
- name: Create directories for config.json file and clientId file | |
run: sudo mkdir -p /var/lib/homebridge/ && sudo mkdir -p /var/lib/homebridge/homebridge-actron-que-persist/ | |
- name: Create files for config file and clientId file | |
run: sudo touch /var/lib/homebridge/config.json && sudo touch /var/lib/homebridge/homebridge-actron-que-persist/clientid.token | |
- name: Update permissions for created directories | |
run: sudo chmod -R 0777 /var/lib/homebridge/ && sudo chmod -R 0777 /var/lib/homebridge/homebridge-actron-que-persist/ | |
- name: Populate clientId file | |
uses: devops-actions/json-to-file@v1.0.0 | |
with: | |
json: '[{"name": "homebridgeQueCommitTest", "id": "homebridgeQueCommitTest-12345"}]' | |
filename: /var/lib/homebridge/homebridge-actron-que-persist/clientid.token | |
- name: Populate Homebridge config.json file | |
uses: devops-actions/json-to-file@v1.0.0 | |
with: | |
json: '{ | |
"bridge": { | |
"name": "Homebridge Test", | |
"username": "FF:FF:FF:FF:FF:FF", | |
"port": 54321, | |
"pin": "123-45-678" | |
}, | |
"platforms": [ | |
{ | |
"name": "ActronQue", | |
"username": "${{ secrets.USERNAME }}", | |
"password": "${{ secrets.PASSWORD }}", | |
"zonesFollowMaster": true, | |
"zonesPushMaster": true, | |
"clientName": "homebridgeQueCommitTest", | |
"refreshInterval": 60, | |
"platform": "ActronQue" | |
} | |
] | |
}' | |
filename: /var/lib/homebridge/config.json | |
- name: Clean install npm | |
run: npm ci | |
- name: Run commit script to test Homebridge integration of plugin - always exits cleanly | |
run: timeout --preserve-status -k 120s 120s npm run commit || true | |
- name: Check log to confirm login to ActronQue Cloud | |
run: cat /var/lib/homebridge/homebridge.log | egrep 'located serial number .{8} with ID of .*' | |
- name: Check log to confirm status retrieved from ActronQue Cloud | |
run: cat /var/lib/homebridge/homebridge.log | egrep 'Got current status from Actron Cloud' | |
- name: Check log to confirm no API error | |
run: cat /var/lib/homebridge/homebridge.log | egrep '{"apiError":false,' | |
- name: Check log to confirm creation of Actron master controller | |
run: cat /var/lib/homebridge/homebridge.log | egrep 'Adding new accessory. homebridgeQueCommitTest$' | |
- name: Check log to confirm creation of Actron outdoor unit | |
run: cat /var/lib/homebridge/homebridge.log | egrep 'Adding new accessory. homebridgeQueCommitTest-outdoorUnit' |