Skip to content
This repository has been archived by the owner on Nov 19, 2023. It is now read-only.

Commit

Permalink
Merge pull request #255 from snok/sondrelg/fixes
Browse files Browse the repository at this point in the history
Update version to v2
  • Loading branch information
sondrelg authored Dec 29, 2021
2 parents 6a72ade + 61e03b2 commit d0dd312
Show file tree
Hide file tree
Showing 5 changed files with 106 additions and 89 deletions.
8 changes: 4 additions & 4 deletions .codecov.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Docs: https://docs.codecov.io/docs/codecovyml-reference

codecov:
require_ci_to_pass: yes
require_ci_to_pass: true

coverage:
precision: 1
Expand All @@ -10,9 +10,9 @@ coverage:
project:
default:
target: auto
patch: no
changes: no
patch: false
changes: false

comment:
layout: "diff,files"
require_changes: yes
require_changes: true
33 changes: 15 additions & 18 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,15 @@ jobs:
path: .venv
key: venv-0 # increment to reset
- run: |
pip install virtualenv
virtualenv .venv
python -m venv .venv --upgrade-deps
source .venv/bin/activate
pip install pre-commit
if: steps.cache-venv.outputs.cache-hit != 'true'
- uses: actions/cache@v2
id: pre-commit-cache
with:
path: ~/.cache/pre-commit
key: key-0
key: key-0 # increment to reset
- run: |
source .venv/bin/activate
pre-commit run --all-files
Expand All @@ -55,8 +54,7 @@ jobs:
with:
path: ~/.local
key: key-3
- name: Install poetry
uses: snok/install-poetry@v1
- uses: snok/install-poetry@v1
with:
virtualenvs-create: false
- uses: actions/cache@v2
Expand All @@ -65,33 +63,31 @@ jobs:
path: .venv
key: ${{ matrix.python-version }}-${{ hashFiles('**/poetry.lock') }}-2
- run: |
pip install virtualenv
virtualenv .venv
python -m venv .venv
source .venv/bin/activate
pip install pip setuptools wheel -U
pip install wheel setuptools pip -U
poetry install --no-interaction --no-root
if: steps.cache-venv.outputs.cache-hit != 'true'
- name: Install django version
run: |
- run: |
source .venv/bin/activate
pip install "Django==${{ matrix.django-version }}"
- name: Run tests
run: |
- run: |
source .venv/bin/activate
pytest --cov=. --cov-report xml --cov-report term-missing
- name: Archive coverage
uses: actions/upload-artifact@v2
coverage run -m pytest
coverage xml
coverage report
- uses: actions/upload-artifact@v2
with:
name: coverage-xml
path: coverage.xml
if: matrix.python-version == '3.10' && matrix.django-version == '4.0'

coverage:
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Get coverage
uses: actions/download-artifact@v2
- uses: actions/download-artifact@v2
with:
name: coverage-xml
- uses: codecov/codecov-action@v2
Expand All @@ -101,7 +97,8 @@ jobs:
token: ${{ secrets.CODECOV_TOKEN }}
- name: Fix coverage file for sonarcloud
run: |
sed -i "s/<source>\/home\/runner\/work\/drf-openapi-tester\//<source>/g" coverage.xml
sed -i "s/<source>\/home\/runner\/work\/drf-openapi-tester\/drf-openapi-tester\//<source>/g" coverage.xml
cat coverage.xml
- uses: sonarsource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
38 changes: 31 additions & 7 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@ repos:
rev: 21.12b0
hooks:
- id: black
args: ['--quiet']
args: [ '--quiet' ]

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.0.1
rev: v4.1.0
hooks:
- id: check-case-conflict
- id: end-of-file-fixer
Expand All @@ -14,6 +15,7 @@ repos:
- id: check-json
- id: check-yaml
- id: check-merge-conflict

- repo: https://gitlab.com/pycqa/flake8
rev: 3.9.2
hooks:
Expand All @@ -28,20 +30,30 @@ repos:
'flake8-pytest-style',
'flake8-type-checking',
]

- repo: https://github.com/asottile/pyupgrade
rev: v2.29.1
rev: v2.30.0
hooks:
- id: pyupgrade
args: ["--py36-plus", "--py37-plus"]
args: [ "--py3-plus", "--py36-plus", "--py37-plus" ]

- repo: https://github.com/pycqa/isort
rev: 5.10.1
hooks:
- id: isort

- repo: https://github.com/pre-commit/mirrors-mypy
rev: 'v0.920'
rev: 'v0.930'
hooks:
- id: mypy
additional_dependencies: [django, djangorestframework, inflection, openapi-spec-validator, prance, pyYAML, django-stubs, djangorestframework-stubs, drf_yasg, drf-spectacular, types-PyYAML]
additional_dependencies:
- django-stubs
- djangorestframework
- djangorestframework-stubs
- types-PyYAML
- drf-yasg
- drf-spectacular

- repo: local
hooks:
- id: pylint
Expand All @@ -50,4 +62,16 @@ repos:
language: python
types: [ python ]
exclude: tests|test_project|manage.py
additional_dependencies: [django, djangorestframework, inflection, openapi-spec-validator, prance, pyYAML, django-stubs, djangorestframework-stubs, drf_yasg, drf-spectacular, pylint, faker]
additional_dependencies:
- django
- djangorestframework
- inflection
- openapi-spec-validator
- prance
- pyYAML
- django-stubs
- djangorestframework-stubs
- drf_yasg
- drf-spectacular
- pylint
- faker
Loading

0 comments on commit d0dd312

Please sign in to comment.