Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
79 changes: 48 additions & 31 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,41 +1,58 @@
name: GH
name: PyCodeQualityAnalysis

on:
workflow_dispatch:
pull_request:
branches: '*'
branches: [master]
push:
branches: 'master'
tags: '*'
branches: [master]

jobs:
CI:
DevOps:
runs-on: ubuntu-latest
strategy:
max-parallel: 8
fail-fast: true
matrix:
python-version: [3.5, 3.6, 3.7, 3.8, 3.9, 3.10]
python-version: ["3.9", "3.10", "3.11"]
steps:
- uses: actions/checkout@v2

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Pip cache
uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements/*.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install dependencies
run: pip install -e ".[test]"

- name: Lint
run: |
isort --recursive --diff validators tests && isort --recursive --check-only validators tests
flake8 validators tests

- name: Test
run: py.test --doctest-glob="*.rst" --doctest-modules --ignore=setup.py
#----------------------------------------------
# check-out repo and set-up python
#----------------------------------------------
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
# id: setup-python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
#----------------------------------------------
# install & configure poetry
#----------------------------------------------
- name: Install Poetry
uses: snok/install-poetry@v1
with:
version: 1.3.2
virtualenvs-create: true
virtualenvs-in-project: true
#----------------------------------------------
# load cached venv if cache exists
#----------------------------------------------
# - name: Load cached venv
# id: cached-poetry-dependencies
# uses: actions/cache@v3
# with:
# path: .venv
# key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
#----------------------------------------------
# install dependencies if cache does not exist
#----------------------------------------------
- name: Install dependencies
# if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: poetry install --no-interaction --no-root
#----------------------------------------------
# run test suite
#----------------------------------------------
- name: Test
run: |
source .venv/bin/activate
pytest tests/
188 changes: 159 additions & 29 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@ classifiers = [

[tool.poetry.dependencies]
python = "^3.9"
decorator = "^5.1.1"

[tool.poetry.group.dev.dependencies]
bandit = "^1.7.4"
black = "^23.1.0"
flake8 = "^6.0.0"
pyright = "^1.1.293"
pytest = "^7.2.1"
setuptools = "^67.1.0"
pyright = "^1.1.292"
setuptools = "^67.2.0"

[build-system]
requires = ["poetry-core"]
Expand Down
Loading