diff --git a/.github/release-drafter.yml b/.github/release-drafter.yml index 00adb41..f2a1bf5 100644 --- a/.github/release-drafter.yml +++ b/.github/release-drafter.yml @@ -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 \ No newline at end of file diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..0a1f3dc --- /dev/null +++ b/.github/workflows/ci.yml @@ -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 }} diff --git a/.github/workflows/pythontests.yml b/.github/workflows/pythontests.yml new file mode 100644 index 0000000..eac0da2 --- /dev/null +++ b/.github/workflows/pythontests.yml @@ -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 diff --git a/.github/workflows/release-drafter.yml b/.github/workflows/release-drafter.yml new file mode 100644 index 0000000..01abdf6 --- /dev/null +++ b/.github/workflows/release-drafter.yml @@ -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 }} diff --git a/.github/workflows/wip.yml b/.github/workflows/wip.yml new file mode 100644 index 0000000..559330e --- /dev/null +++ b/.github/workflows/wip.yml @@ -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 diff --git a/.sonarcloud.properties b/.sonarcloud.properties deleted file mode 100644 index 885b066..0000000 --- a/.sonarcloud.properties +++ /dev/null @@ -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= diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..897feb8 --- /dev/null +++ b/requirements.txt @@ -0,0 +1 @@ +librouteros==3.0.0 \ No newline at end of file diff --git a/sonar-project.properties b/sonar-project.properties new file mode 100644 index 0000000..0c5fba5 --- /dev/null +++ b/sonar-project.properties @@ -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=. \ No newline at end of file