Run python tests #793
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Run python tests | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
schedule: | |
- cron: "0 5 * * *" | |
permissions: | |
contents: read | |
jobs: | |
test: | |
runs-on: ubuntu-20.04 | |
strategy: | |
matrix: | |
python-version: [ "3.6", "3.7", "3.8", "3.9", "3.10" ] | |
name: Testing Python ${{ matrix.python-version }} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v3 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install flake8 pytest pylint | |
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi | |
if [ -f test-requirements.txt ]; then pip install -r test-requirements.txt; fi | |
- name: Analysing the code with pylint | |
run: | | |
pylint motionblinds | |
- name: Lint with flake8 | |
run: | | |
# stop the build if there are Python syntax errors or undefined names | |
flake8 motionblinds --count --select=E9,F63,F7,F82 --show-source --statistics | |
# exit-zero treats all errors as warnings. | |
flake8 motionblinds --count --exit-zero --max-line-length=79 --statistics |