Fix/force saving session updates (#570) #1277
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
name: Main | |
on: | |
schedule: | |
- cron: '0 1 * * *' | |
push: | |
branches: | |
- develop | |
- main | |
pull_request: | |
jobs: | |
validate: | |
runs-on: "ubuntu-latest" | |
steps: | |
- uses: "actions/checkout@v2" | |
- uses: "home-assistant/actions/hassfest@master" | |
- name: HACS Action | |
uses: "hacs/action@main" | |
with: | |
category: "integration" | |
unit_tests: | |
name: Unit Tests | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- name: asdf_install | |
uses: asdf-vm/actions/install@v1 | |
- name: Install Python modules | |
run: | | |
pip install -r requirements.test.txt | |
- name: Run unit tests | |
run: | | |
python -m pytest tests/unit | |
integration_tests: | |
name: Integration Tests | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- name: asdf_install | |
uses: asdf-vm/actions/install@v1 | |
- name: Install Python modules | |
run: | | |
pip install -r requirements.test.txt | |
- name: Run integration tests | |
run: | | |
python -m pytest tests/integration | |
env: | |
API_KEY: ${{ secrets.OCTOPUS_ENERGY_API_TOKEN }} | |
GAS_MPRN: ${{ secrets.OCTOPUS_ENERGY_GAS_MPRN }} | |
GAS_SN: ${{ secrets.OCTOPUS_ENERGY_GAS_SN }} | |
ELECTRICITY_MPAN: ${{ secrets.OCTOPUS_ENERGY_ELECTRICITY_MPAN }} | |
ELECTRICITY_SN: ${{ secrets.OCTOPUS_ENERGY_ELECTRICITY_SN }} | |
ACCOUNT_ID: ${{ secrets.OCTOPUS_ENERGY_ACCOUNT_ID }} | |
release: | |
name: Release | |
if: github.ref == 'refs/heads/main' | |
needs: | |
- validate | |
- unit_tests | |
- integration_tests | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- name: asdf_install | |
uses: asdf-vm/actions/install@v1 | |
- name: Install dependencies | |
run: npm ci | |
- name: Release | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
RELEASE_BODY_APPENDIX: "---\nEnjoying the integration? Why not make a one time or monthly [GitHub sponsorship](https://github.com/sponsors/bottlecapdave) or use my [Octopus Energy referral link](https://share.octopus.energy/gray-jade-372)?" | |
run: npm run release | |
- name: Merge main into develop | |
uses: devmasx/merge-branch@master | |
with: | |
type: now | |
message: "chore: Merged main into develop" | |
from_branch: main | |
target_branch: develop | |
github_token: ${{ secrets.GITHUB_TOKEN }} |