Skip to content

Commit

Permalink
Merge pull request #323 from albertogeniola/albertogeniola-patch-ha-env
Browse files Browse the repository at this point in the history
Update build-dev.yml
  • Loading branch information
albertogeniola authored Sep 25, 2023
2 parents 86308f7 + 2551e9b commit 1a1bd0d
Showing 1 changed file with 5 additions and 32 deletions.
37 changes: 5 additions & 32 deletions .github/workflows/build-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,25 +43,11 @@ jobs:
name: Turn on test environment
runs-on: ubuntu-latest
env:
TPLINK_USER: ${{ secrets.TPLINK_USER }}
TPLINK_PASS: ${{ secrets.TPLINK_PASS }}
HOMEASSISTANT_TOKEN: ${{ secrets.HOMEASSISTANT_TOKEN }}
steps:
- name: Setup Node.js environment
uses: actions/setup-node@v2-beta
with:
node-version: 11.x
- uses: actions/checkout@v2
- name: Install npm dependencies
run: |
pushd ext-res/tests
npm install
popd
- name: Powering on the dev-environment
run: |
pushd ext-res/tests
node ./switch.js --dev MEROSS_LAB --toggle=on
popd
curl -X POST -k --header "Content-Type: application/json" --header "Authorization: Bearer $HOMEASSISTANT_TOKEN" https://milano.geniola.it/api/services/switch/turn_on -d "{\"entity_id\":\"switch.meross_lab\"}"
# ---------------------------------
# Testing
# ---------------------------------
Expand Down Expand Up @@ -136,28 +122,15 @@ jobs:
# Turn off ENV
# ------------------------------
turn-off-env:
name: Turn off test environment
runs-on: ubuntu-latest
needs: [test]
env:
TPLINK_USER: ${{ secrets.TPLINK_USER }}
TPLINK_PASS: ${{ secrets.TPLINK_PASS }}
HOMEASSISTANT_TOKEN: ${{ secrets.HOMEASSISTANT_TOKEN }}
steps:
- name: Setup Node.js environment
uses: actions/setup-node@v2-beta
with:
node-version: 11.x
- uses: actions/checkout@v2
- name: Install npm dependencies
run: |
pushd ext-res/tests
npm install
popd
- name: Powering on the dev-environment
run: |
pushd ext-res/tests
node ./switch.js --dev MEROSS_LAB --toggle=off
popd
curl -X POST -k --header "Content-Type: application/json" --header "Authorization: Bearer $HOMEASSISTANT_TOKEN" https://milano.geniola.it/api/services/switch/turn_on -d "{\"entity_id\":\"switch.meross_lab\"}"
name: Turn off test environment
if: ${{ always() }}

# ------------------------------
Expand Down

0 comments on commit 1a1bd0d

Please sign in to comment.