Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
msinn committed Oct 31, 2022
2 parents cc57a0a + a958a46 commit aa143b8
Show file tree
Hide file tree
Showing 87 changed files with 2,797 additions and 1,069 deletions.
73 changes: 73 additions & 0 deletions .github/workflows/builddevdoc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: "Build doc from develop"
#on: [workflow_dispatch, push]
on:
workflow_dispatch:
push:
branches:
- 'develop'

jobs:
build:
runs-on: ubuntu-20.04 #latest
strategy:
fail-fast: false
matrix:
python-version: [ '3.8' ]
name: Python ${{ matrix.python-version }}
steps:
- name: update OS (Ubuntu)
run: sudo apt-get update
- run: sudo apt-get install libudev-dev
- run: sudo apt-get install librrd-dev libpython3-dev
- run: sudo apt-get install gcc --only-upgrade
- uses: actions/checkout@v2
- name: Checkout SmartHomeNG DEVELOP Branch
uses: actions/checkout@v2
with:
repository: smarthomeNG/smarthome
ref: develop
path: smarthomeng
- name: Checkout SmartHomeNG/plugins DEVELOP Branch
uses: actions/checkout@v2
with:
repository: smarthomeNG/plugins
ref: develop
path: smarthomeng/plugins
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
architecture: x64
- name: Print Python Version
run: python --version
- run: python3 -m pip install --upgrade pip #==19.3.1
#- run: pip install tox-travis virtualenv>=20.0.8 --upgrade
#- run: pip install sphinx sphinx_rtd_theme recommonmark ruamel.yaml pytest
- name: Install requirements for documentation build
run: pip install -r smarthomeng/doc/requirements.txt

- name: Build Requirements for SmartHomeNG
run: python3 smarthomeng/tools/build_requirements.py
- name: Install SmartHomeNG base requirements
# base requirements are needed for building of documentation
run: pip install -r smarthomeng/requirements/base.txt
- name: List installed packages
run: pip list

- name: Build documentation
working-directory: ./smarthomeng/doc
run: bash ./build_doc_local.sh

#- name: Deploy documentation
# uses: JamesIves/[email protected]
# with:
# branch: develop_doc # The branch the action should deploy to.
# folder: ./smarthomeng/doc/user/build/html # The folder the action should deploy.

- name: Deploy documentation to seperate repo dev_doc
uses: JamesIves/[email protected]
with:
branch: gh-pages # The branch the action should deploy to.
folder: ./smarthomeng/doc/user/build/html # The folder the action should deploy.
repository-name: 'smarthomeNG/dev_doc'
token: ${{ secrets.PAT_TOKEN }}
74 changes: 74 additions & 0 deletions .github/workflows/buildreleasedoc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: "Build doc from master"
#on: [workflow_dispatch, push]
on:
workflow_dispatch:
push:
branches:
- 'master'

jobs:
build:
runs-on: ubuntu-20.04 #latest
strategy:
fail-fast: false
matrix:
python-version: [ '3.8' ]
name: Python ${{ matrix.python-version }}
steps:
- name: update OS (Ubuntu)
run: sudo apt-get update
- run: sudo apt-get install libudev-dev
- run: sudo apt-get install librrd-dev libpython3-dev
- run: sudo apt-get install gcc --only-upgrade
- uses: actions/checkout@v2
- name: Checkout SmartHomeNG DEVELOP Branch
uses: actions/checkout@v2
with:
repository: smarthomeNG/smarthome
ref: master
path: smarthomeng
- name: Checkout SmartHomeNG/plugins DEVELOP Branch
uses: actions/checkout@v2
with:
repository: smarthomeNG/plugins
ref: master
path: smarthomeng/plugins
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
architecture: x64
- name: Print Python Version
run: python --version
- run: python3 -m pip install --upgrade pip #==19.3.1
#- run: pip install tox-travis virtualenv>=20.0.8 --upgrade

- name: Install requirements for documentation build
run: pip install -r smarthomeng/doc/requirements.txt
- run: pip install attrs # install seperatly until requirements in master branch are updated

- name: Build Requirements for SmartHomeNG
run: python3 smarthomeng/tools/build_requirements.py
- name: Install SmartHomeNG base requirements
# base requirements are needed for building of documentation
run: pip install -r smarthomeng/requirements/base.txt
- name: List installed packages
run: pip list

- name: Build documentation
working-directory: ./smarthomeng/doc
run: bash ./build_doc_local.sh

- name: Deploy documentation
uses: JamesIves/[email protected]
with:
branch: release_doc # The branch the action should deploy to.
folder: ./smarthomeng/doc/user/build/html # The folder the action should deploy.

#- name: Deploy documentation to seperate repo smarthome
# uses: JamesIves/[email protected]
# with:
# branch: release_doc # The branch the action should deploy to.
# folder: ./smarthomeng/doc/user/build/html # The folder the action should deploy.
# repository-name: 'smarthomeNG/smarthome'
# token: ${{ secrets.PAT_TOKEN }}
83 changes: 83 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL"

on:
workflow_dispatch:
push:

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
language: [ 'python' ]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
# Learn more about CodeQL language support at https://git.io/codeql-language-support

steps:

- name: Extract branch name
shell: bash
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
id: extract_branch

- name: Checkout repository SMARTHOME ${{steps.extract_branch.outputs.branch}} Branch
uses: actions/checkout@v3
with:
repository: smarthomeNG/smarthome
ref: ${{steps.extract_branch.outputs.branch}}
path: smarthomeng

- name: Checkout repository PLUGINS ${{steps.extract_branch.outputs.branch}} Branch
uses: actions/checkout@v3
with:
repository: smarthomeNG/smarthome
ref: ${{steps.extract_branch.outputs.branch}}
path: plugins

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
queries: security-and-quality #,octo-org/python-qlpack/show_ifs.ql@main
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# queries: ./path/to/local/query, your-org/your-repo/queries@main

# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v2

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl

# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
# uses a compiled language

#- run: |
# make bootstrap
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
21 changes: 21 additions & 0 deletions .github/workflows/comment_pr_to_wrong_branch.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: "Comment if PR goes to wrong branch"

on:
pull_request:
types: [opened]
branches:
- '*'
- '!develop'

jobs:
comment_pr:
runs-on: ubuntu-latest
name: Comment on wrong branch
steps:
- name: Comment PR
uses: thollander/actions-comment-pull-request@v1
with:
message: 'Pull requests should only be placed against the develop branch'
reactions: '-1'
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

66 changes: 66 additions & 0 deletions .github/workflows/unittests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: "Unittests Core"
#on: [workflow_dispatch, push]
on:
workflow_dispatch:
pull_request:
branches:
- 'develop'
push:
branches:
- '*'
- '!release_doc'

jobs:
build:
runs-on: ubuntu-20.04 #latest
strategy:
fail-fast: false
matrix:
python-version: [ '3.7', '3.8', '3.9', '3.10' ]
name: Python ${{ matrix.python-version }}
steps:
- name: Setup OS (Ubuntu)
run: |
sudo apt-get update
sudo apt-get install libudev-dev
sudo apt-get install librrd-dev libpython3-dev
sudo apt-get install gcc --only-upgrade
- name: Get branch name
run: |
echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
echo ${GITHUB_REF#refs/heads/}
id: extract_branch

- name: Checkout core from ${{steps.extract_branch.outputs.branch}} branch
uses: actions/checkout@v3
with:
repository: smarthomeNG/smarthome
ref: ${{steps.extract_branch.outputs.branch}}
- name: Checkout plugins from ${{steps.extract_branch.outputs.branch}} branch
uses: actions/checkout@v3
with:
repository: smarthomeNG/plugins
ref: ${{steps.extract_branch.outputs.branch}}
path: plugins

- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
architecture: x64
- run: python3 -m pip install --upgrade pip

- name: Install requirements for unit testing
run: pip install -r tests/requirements.txt
- name: Build Requirements for SmartHomeNG
run: python3 tools/build_requirements.py
- name: Install SmartHomeNG base requirements
# base requirements are needed for pytest to run
run: pip install -r requirements/base.txt

# --- up to here, the workflow is identical for CORE and PLUGINS ---

- name: '>>> Run Python Unittests for CORE <<<'
working-directory: ./tests
run: pytest
Loading

0 comments on commit aa143b8

Please sign in to comment.