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
5 changes: 3 additions & 2 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// See https://aka.ms/vscode-remote/devcontainer.json for format details.
{
"image": "ludeeus/container:integration-debian",
//"image": "ludeeus/container:integration-debian",
"image": "ghcr.io/ludeeus/devcontainer/integration:stable",
"name": "Nordpool integration development",
"context": "..",
"appPort": [
Expand All @@ -16,7 +17,7 @@
"settings": {
"files.eol": "\n",
"editor.tabSize": 4,
"terminal.integrated.shell.linux": "/bin/bash",
//"terminal.integrated.shell.linux": "/bin/bash",
"python.pythonPath": "/usr/bin/python3",
"python.analysis.autoSearchPaths": false,
"python.linting.pylintEnabled": true,
Expand Down
57 changes: 31 additions & 26 deletions .github/workflows/pull.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
name: Pull actions
name: Pull request

on:
pull_request:
on: [pull_request]

jobs:
validate:
Expand Down Expand Up @@ -30,26 +29,32 @@ jobs:
- run: python3 -m pip install black
- run: black .

# tests:
# runs-on: "ubuntu-latest"
# name: Run tests
# steps:
# - name: Check out code from GitHub
# uses: "actions/checkout@v2"
# - name: Setup Python
# uses: "actions/setup-python@v1"
# with:
# python-version: "3.8"
# - name: Install requirements
# run: python3 -m pip install -r requirements_test.txt
# - name: Run tests
# run: |
# pytest \
# -qq \
# --timeout=9 \
# --durations=10 \
# -n auto \
# --cov custom_components.integration_blueprint \
# -o console_output_style=count \
# -p no:sugar \
# tests
tests:
runs-on: "ubuntu-latest"
strategy:
matrix:
python-version: ["3.9"]
name: Run tests
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install requirements
run: |
python -m pip install --upgrade pip
pip install flake8 pytest
if [ -f requirements_dev.txt ]; then pip install -r requirements_dev.txt; fi

- name: Run tests
run: |
pytest \
-vv \
--timeout=9 \
--durations=10 \
-n auto \
--cov custom_components.nordpool \
-o console_output_style=count \
-p no:sugar \
tests\
79 changes: 26 additions & 53 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
@@ -1,58 +1,31 @@
name: Push actions
name: Python package

on:
push:
branches:
- master
- dev
on: [push]

jobs:
validate:
runs-on: "ubuntu-latest"
name: Validate
steps:
- uses: "actions/checkout@v2"

- name: HACS validation
uses: "hacs/action@main"
with:
category: "integration"
ignore: brands
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.9"]

- name: Hassfest validation
uses: "home-assistant/actions/hassfest@master"

style:
runs-on: "ubuntu-latest"
name: Check style formatting
steps:
- uses: "actions/checkout@v2"
- uses: "actions/setup-python@v1"
with:
python-version: "3.x"
- run: python3 -m pip install black
- run: black .

# tests:
# runs-on: "ubuntu-latest"
# name: Run tests
# steps:
# - name: Check out code from GitHub
# uses: "actions/checkout@v2"
# - name: Setup Python
# uses: "actions/setup-python@v1"
# with:
# python-version: "3.8"
# - name: Install requirements
# run: python3 -m pip install -r requirements_test.txt
# - name: Run tests
# run: |
# pytest \
# -qq \
# --timeout=9 \
# --durations=10 \
# -n auto \
# --cov custom_components.integration_blueprint \
# -o console_output_style=count \
# -p no:sugar \
# tests
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 pytest
if [ -f requirements_dev.txt ]; then pip install -r requirements_dev.txt; fi
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with pytest
run: |
pytest tests\
Empty file added custom_components/__init__.py
Empty file.
Loading