mtkclient/.github/workflows/python-app.yml

35 lines
1.1 KiB
YAML
Raw Normal View History

2022-08-21 16:47:35 -04:00
# 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 application
on:
push:
2023-09-26 12:24:12 -04:00
branches:
- main
2022-08-21 16:47:35 -04:00
pull_request:
2023-09-26 12:24:12 -04:00
workflow_dispatch:
2022-08-21 16:47:35 -04:00
jobs:
build:
2023-09-26 12:24:12 -04:00
name: Test
2022-08-21 16:47:35 -04:00
runs-on: ubuntu-latest
steps:
2023-09-26 12:24:12 -04:00
- name: Checkout
uses: actions/checkout@v4
2023-09-26 12:30:43 -04:00
- name: Set up Python3
uses: actions/setup-python@v4
2022-08-21 16:47:35 -04:00
with:
2023-09-26 12:24:12 -04:00
python-version: "3.x"
2023-09-26 12:30:43 -04:00
cache: 'pip'
2022-08-21 16:47:35 -04:00
- name: Install dependencies
run: |
python -m pip install --upgrade pip
2023-09-26 12:24:12 -04:00
pip install flake8 -r requirements.txt
2022-08-21 16:47:35 -04:00
- name: Lint with flake8
run: |
# 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