add github workflow
Some checks failed
Python package / lint (push) Successful in 10s
Python package / test (3.10) (push) Failing after 25s
Python package / test (3.11) (push) Failing after 24s
Python package / test (3.8) (push) Failing after 26s
Python package / test (3.9) (push) Has been cancelled
Some checks failed
Python package / lint (push) Successful in 10s
Python package / test (3.10) (push) Failing after 25s
Python package / test (3.11) (push) Failing after 24s
Python package / test (3.8) (push) Failing after 26s
Python package / test (3.9) (push) Has been cancelled
This commit is contained in:
parent
a3dd4a6dbf
commit
379b5d360c
61
.github/workflows/python.yml
vendored
Normal file
61
.github/workflows/python.yml
vendored
Normal file
|
@ -0,0 +1,61 @@
|
||||||
|
name: Python package
|
||||||
|
|
||||||
|
on: [push]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
lint:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Set up Python
|
||||||
|
uses: actions/setup-python@v5
|
||||||
|
|
||||||
|
- name: Display Python version
|
||||||
|
run: python -c "import sys; print(sys.version)"
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: |
|
||||||
|
python -m pip install --upgrade pip
|
||||||
|
pip install flake8 black
|
||||||
|
|
||||||
|
- name: Format
|
||||||
|
run: black --check .
|
||||||
|
|
||||||
|
- name: Lint
|
||||||
|
run: flake8
|
||||||
|
|
||||||
|
test:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
python-version: ["3.8", "3.9", "3.10", "3.11"]
|
||||||
|
env:
|
||||||
|
RUNNER_TOOL_CACHE: /toolcache # https://about.gitea.com/resources/tutorials/enable-gitea-actions-cache-to-accelerate-cicd
|
||||||
|
AGENT_TOOLSDIRECTORY: /toolcache # https://github.com/actions/setup-python/issues/824
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Set up Python ${{ matrix.python-version }}
|
||||||
|
uses: actions/setup-python@v5
|
||||||
|
with:
|
||||||
|
python-version: ${{ matrix.python-version }}
|
||||||
|
|
||||||
|
# You can test your matrix by printing the current Python version
|
||||||
|
- name: Display Python version
|
||||||
|
run: python -c "import sys; print(sys.version)"
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: |
|
||||||
|
python -m pip install --upgrade pip
|
||||||
|
pip install pipenv
|
||||||
|
pipenv verify
|
||||||
|
pipenv --python ${{ matrix.python-version }} install --dev --skip-lock
|
||||||
|
pipenv run pip install pytest pytest-cov
|
||||||
|
|
||||||
|
- name: Checking dependencies
|
||||||
|
run: pipenv run pip list
|
||||||
|
|
||||||
|
- name: Running tests
|
||||||
|
run: pipenv run pytest --doctest-modules --junitxml=junit/test-results.xml --cov=com --cov-report=xml --cov-report=html
|
||||||
|
|
Loading…
Reference in New Issue
Block a user