ci: add automated testing/linting
- fix bugs - disable some tests from running in CPU only mode since github actions can't handle itpull/28/head
parent
2f959c7394
commit
eaad0a15e4
@ -0,0 +1,18 @@
|
||||
{
|
||||
"problemMatcher": [
|
||||
{
|
||||
"owner": "lint-error",
|
||||
"severity": "error",
|
||||
"pattern": [
|
||||
{
|
||||
"regexp": "^\\s*([^:]*):(\\d+):(\\d+): ([A-Z]{1,3}\\d\\d\\d) (.*)$",
|
||||
"file": 1,
|
||||
"line": 2,
|
||||
"column": 3,
|
||||
"code": 4,
|
||||
"message": 5
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
@ -0,0 +1,56 @@
|
||||
name: Python Checks
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
workflow_dispatch:
|
||||
jobs:
|
||||
lint:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-python@v2
|
||||
with:
|
||||
python-version: 3.9
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install --disable-pip-version-check -r requirements-dev.txt
|
||||
python -m pip install --disable-pip-version-check --no-deps .
|
||||
- name: Lint
|
||||
run: |
|
||||
echo "::add-matcher::.github/pylama_matcher.json"
|
||||
pylama --options tox.ini
|
||||
autoformat:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-python@v2
|
||||
with:
|
||||
python-version: 3.9
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install --disable-pip-version-check black isort
|
||||
- name: Autoformatter
|
||||
run: |
|
||||
black --diff .
|
||||
isort --atomic --profile black --check-only .
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
python-version: ["3.8", "3.10"]
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Set up Python ${{ matrix.python-version }}
|
||||
uses: actions/setup-python@v2
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install --disable-pip-version-check -r requirements-dev.txt
|
||||
python -m pip install --disable-pip-version-check .
|
||||
- name: Test with pytest
|
||||
timeout-minutes: 10
|
||||
run: |
|
||||
pytest
|
Loading…
Reference in New Issue