tomaae.homeassistant-mikrot.../.github/workflows/ci.yml

56 lines
1.5 KiB
YAML

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"
tests:
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 --ignore W503,E722 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=15 --max-line-length=127 --statistics
#- name: Test with pytest
# run: |
# pip install pytest
# pytest
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 }}