Add Deepsource (#12)
This commit is contained in:
parent
88cd116781
commit
fcdb8784e1
30
.deepsource.toml
Normal file
30
.deepsource.toml
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
version = 1
|
||||||
|
|
||||||
|
test_patterns = ["tests/**"]
|
||||||
|
|
||||||
|
exclude_patterns = [
|
||||||
|
".github/workflows/**",
|
||||||
|
".gitignore",
|
||||||
|
"CODEOWNERS",
|
||||||
|
"LICENSE.md",
|
||||||
|
"README.md",
|
||||||
|
"codecov.yml",
|
||||||
|
"renovate.json",
|
||||||
|
"requirements-dev.txt",
|
||||||
|
"requirements.txt"
|
||||||
|
]
|
||||||
|
|
||||||
|
[[analyzers]]
|
||||||
|
name = "python"
|
||||||
|
enabled = true
|
||||||
|
|
||||||
|
[analyzers.meta]
|
||||||
|
runtime_version = "3.x.x"
|
||||||
|
|
||||||
|
[[analyzers]]
|
||||||
|
name = "test-coverage"
|
||||||
|
enabled = true
|
||||||
|
|
||||||
|
[[transformers]]
|
||||||
|
name = "black"
|
||||||
|
enabled = true
|
65
.github/workflows/merge-to-main.yml
vendored
Normal file
65
.github/workflows/merge-to-main.yml
vendored
Normal file
@ -0,0 +1,65 @@
|
|||||||
|
name: Merge to main
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
coverage:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Check out repository code
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
- name: Setup Python
|
||||||
|
uses: actions/setup-python@v4
|
||||||
|
with:
|
||||||
|
python-version: "3.10"
|
||||||
|
- name: Install dependencies
|
||||||
|
run: pip install -r requirements.txt && pip install -r requirements-dev.txt
|
||||||
|
- name: Run test suite
|
||||||
|
run: |
|
||||||
|
coverage run -m py.test -v
|
||||||
|
coverage xml
|
||||||
|
- name: Report results to DeepSource
|
||||||
|
run: |
|
||||||
|
curl https://deepsource.io/cli | sh
|
||||||
|
./bin/deepsource report --analyzer test-coverage --key python --value-file ./coverage.xml
|
||||||
|
env:
|
||||||
|
DEEPSOURCE_DSN: ${{ secrets.DEEPSOURCE_DSN }}
|
||||||
|
|
||||||
|
build:
|
||||||
|
needs: coverage
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Check out repository code
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
- name: Setup Python 3.10
|
||||||
|
uses: actions/setup-python@v4
|
||||||
|
with:
|
||||||
|
python-version: "3.10"
|
||||||
|
- name: Install build dependencies
|
||||||
|
run: pip install setuptools wheel
|
||||||
|
- name: Build wheel file
|
||||||
|
run: python setup.py bdist_wheel
|
||||||
|
- id: skip_check
|
||||||
|
uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: whl
|
||||||
|
path: dist/
|
||||||
|
|
||||||
|
publish:
|
||||||
|
needs: build
|
||||||
|
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Create dist folder
|
||||||
|
run: mkdir -p dist
|
||||||
|
- uses: actions/download-artifact@v3
|
||||||
|
with:
|
||||||
|
name: whl
|
||||||
|
path: dist
|
||||||
|
- name: Publish to PyPI
|
||||||
|
uses: pypa/gh-action-pypi-publish@release/v1
|
||||||
|
with:
|
||||||
|
user: __token__
|
||||||
|
password: ${{ secrets.PYPI_API_TOKEN }}
|
36
.github/workflows/pull-request.yml
vendored
Normal file
36
.github/workflows/pull-request.yml
vendored
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
name: CI
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
paths-ignore:
|
||||||
|
- 'README.md'
|
||||||
|
- 'LICENSE.md'
|
||||||
|
- '.gitignore'
|
||||||
|
- 'CODEOWNERS'
|
||||||
|
- 'renovate.json'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
ci:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Check out repository code
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
with:
|
||||||
|
ref: ${{ github.event.pull_request.head.sha }}
|
||||||
|
- name: Setup Python
|
||||||
|
uses: actions/setup-python@v4
|
||||||
|
with:
|
||||||
|
python-version: "3.10"
|
||||||
|
- name: Install dependencies
|
||||||
|
run: pip install -r requirements.txt && pip install -r requirements-dev.txt
|
||||||
|
- name: Lint
|
||||||
|
run: pylint --recursive=yes .
|
||||||
|
- name: Run test suite
|
||||||
|
run: |
|
||||||
|
coverage run -m py.test -v
|
||||||
|
coverage xml
|
||||||
|
- name: Report results to DeepSource
|
||||||
|
run: |
|
||||||
|
curl https://deepsource.io/cli | sh
|
||||||
|
./bin/deepsource report --analyzer test-coverage --key python --value-file ./coverage.xml
|
||||||
|
env:
|
||||||
|
DEEPSOURCE_DSN: ${{ secrets.DEEPSOURCE_DSN }}
|
@ -1,4 +1,4 @@
|
|||||||
# iPilot [![CI](https://github.com/luketainton/pypilot/actions/workflows/ci-branch-main.yml/badge.svg)](https://github.com/luketainton/pypilot/actions/workflows/ci-branch-main.yml)
|
# iPilot [![CI](https://github.com/luketainton/pypilot/actions/workflows/ci-branch-main.yml/badge.svg)](https://github.com/luketainton/pypilot/actions/workflows/ci-branch-main.yml) [![DeepSource](https://deepsource.io/gh/luketainton/pypilot.svg/?label=active+issues&show_trend=true&token=8utkyLrh7RPelvS-BNX1O8hZ)](https://deepsource.io/gh/luketainton/pypilot/?ref=repository-badge)
|
||||||
|
|
||||||
## Description
|
## Description
|
||||||
IP Information Lookup Tool
|
IP Information Lookup Tool
|
||||||
|
@ -1,8 +1,42 @@
|
|||||||
{
|
{
|
||||||
"labels": ["dependencies"],
|
|
||||||
"assignAutomerge": true,
|
|
||||||
"assigneesFromCodeOwners": true,
|
|
||||||
"extends": [
|
"extends": [
|
||||||
"config:base"
|
"config:base"
|
||||||
|
],
|
||||||
|
"platformCommit": true,
|
||||||
|
"dependencyDashboardAutoclose": true,
|
||||||
|
"assignAutomerge": true,
|
||||||
|
"assigneesFromCodeOwners": true,
|
||||||
|
"rebaseWhen": "behind-base-branch",
|
||||||
|
"rollbackPrs": true,
|
||||||
|
"labels": [
|
||||||
|
"dependencies"
|
||||||
|
],
|
||||||
|
"packageRules": [
|
||||||
|
{
|
||||||
|
"matchPackagePatterns": [
|
||||||
|
"black",
|
||||||
|
"pylint"
|
||||||
|
],
|
||||||
|
"labels": [
|
||||||
|
"linting"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"matchPackagePatterns": [
|
||||||
|
"coverage",
|
||||||
|
"pytest"
|
||||||
|
],
|
||||||
|
"labels": [
|
||||||
|
"unit-tests"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
],
|
||||||
|
"vulnerabilityAlerts": {
|
||||||
|
"enabled": true,
|
||||||
|
"labels": [
|
||||||
|
"security"
|
||||||
|
],
|
||||||
|
"commitMessagePrefix": "[SECURITY] ",
|
||||||
|
"prCreation": "immediate"
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user