Merge pull request #341 from cclauss/patch-1

GitHub Action to lint and test Python code
pull/342/head
Shengdun Hua 2023-04-05 16:34:40 +08:00 committed by GitHub
commit bf76954874
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 28 additions and 19 deletions

28
.github/workflows/python.yml vendored Normal file
View File

@ -0,0 +1,28 @@
# https://beta.ruff.rs
name: python
on:
push:
branches: [master]
pull_request:
branches: [master]
jobs:
ruff:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: pip install --user ruff
- run: ruff --format=github --ignore=F401 --target-version=py38 .
pytest:
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"] # , "pypy-3.9"]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
# - run: pip install --upgrade pip setuptools wheel
- run: pip install pytest -r requirements.txt # cov pytest-cov
- run: pytest # --cov=webssh

View File

@ -1,19 +0,0 @@
dist: xenial
language: python
python:
- "3.8"
- "3.9"
- "3.10"
- "3.11"
install:
- pip install -r requirements.txt
- pip install pytest pytest-cov codecov flake8
script:
- pytest --cov=webssh
- flake8
after_success:
- codecov