added workflows

This commit is contained in:
tomaae 2020-04-12 08:45:50 +02:00
parent e00b461b0d
commit a5361b37bb
8 changed files with 119 additions and 25 deletions

View file

@ -1,14 +1,19 @@
name-template: v$NEXT_PATCH_VERSION
tag-template: v$NEXT_PATCH_VERSION
name-template: 'v$NEXT_PATCH_VERSION'
tag-template: 'v$NEXT_PATCH_VERSION'
categories:
- title: 🚀 Features
label: enhancement
- title: 🐛 Bug Fixes
label: bug
- title: 🧰 Maintenance
label: chore
tag-template: - $TITLE @$AUTHOR (#$NUMBER)
- title: '🚀 Features'
labels:
- 'feature'
- 'enhancement'
- title: '🐛 Bug Fixes'
labels:
- 'fix'
- 'bugfix'
- 'bug'
- title: '🧰 Maintenance'
label: 'chore'
change-template: '- $TITLE @$AUTHOR (#$NUMBER)'
template: |
## Changes
$CHANGES
$CHANGES

32
.github/workflows/ci.yml vendored Normal file
View file

@ -0,0 +1,32 @@
name: CI
on:
push:
branches:
- dev
- master
pull_request:
branches:
- dev
- master
jobs:
black:
name: Black
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Black Code Format Check
uses: lgeiger/black-action@master
with:
args: ". --check --fast --diff"
sonarcloud:
name: SonarCloud
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: SonarCloud Code Analysis
uses: sonarsource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

36
.github/workflows/pythontests.yml vendored Normal file
View file

@ -0,0 +1,36 @@
# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: Python Tests
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
name: Python Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.8
uses: actions/setup-python@v1
with:
python-version: 3.8
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Lint with flake8
run: |
pip install flake8
# 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: |
# pip install pytest
# pytest

17
.github/workflows/release-drafter.yml vendored Normal file
View file

@ -0,0 +1,17 @@
name: Release Drafter
on:
push:
branches:
- master
jobs:
update_release_draft:
name: Release Drafter
runs-on: ubuntu-latest
steps:
- uses: release-drafter/release-drafter@v5
with:
config-name: release-drafter.yml
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

12
.github/workflows/wip.yml vendored Normal file
View file

@ -0,0 +1,12 @@
name: WIP
on:
pull_request:
types: [ opened, synchronize, reopened, edited ]
jobs:
wip:
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: wip/action@v1.0.0

View file

@ -1,15 +0,0 @@
# Path to sources
sonar.sources=custom_components/mikrotik_router
sonar.exclusions=custom_components/mikrotik_router/librouteros_custom/*
#sonar.inclusions=
# Path to tests
#sonar.tests=
#sonar.test.exclusions=
#sonar.test.inclusions=
# Source encoding
#sonar.sourceEncoding=UTF-8
# Exclusions for copy-paste detection
#sonar.cpd.exclusions=

1
requirements.txt Normal file
View file

@ -0,0 +1 @@
librouteros==3.0.0

6
sonar-project.properties Normal file
View file

@ -0,0 +1,6 @@
sonar.organization=tomaae
sonar.projectKey=tomaae_homeassistant-mikrotik_router
# relative paths to source directories. More details and properties are described
# in https://sonarcloud.io/documentation/project-administration/narrowing-the-focus/
sonar.sources=.