Add Deepsource (#12)
This commit is contained in:
110
.github/workflows/ci-development.yml
vendored
110
.github/workflows/ci-development.yml
vendored
@ -1,110 +0,0 @@
|
||||
name: CI - Development
|
||||
on:
|
||||
workflow_dispatch:
|
||||
push:
|
||||
branches:
|
||||
- '!main'
|
||||
paths-ignore:
|
||||
- 'README.md'
|
||||
- 'LICENSE.md'
|
||||
- 'CHANGELOG.md'
|
||||
- '.gitignore'
|
||||
- 'renovate.json'
|
||||
- 'CODEOWNERS'
|
||||
|
||||
jobs:
|
||||
skip_duplicate:
|
||||
name: Skip if duplicate run
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
should_skip: ${{ steps.skip_check.outputs.should_skip }}
|
||||
steps:
|
||||
- id: skip_check
|
||||
uses: fkirc/skip-duplicate-actions@v4.0.0
|
||||
with:
|
||||
github_token: ${{ github.token }}
|
||||
|
||||
analyze:
|
||||
name: Analyze
|
||||
needs: skip_duplicate
|
||||
if: ${{ needs.skip_duplicate.outputs.should_skip == 'false' }}
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
actions: read
|
||||
contents: read
|
||||
security-events: write
|
||||
strategy:
|
||||
fail-fast: false
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v3
|
||||
- name: Initialize CodeQL
|
||||
uses: github/codeql-action/init@v2
|
||||
with:
|
||||
languages: python
|
||||
- name: Autobuild
|
||||
uses: github/codeql-action/autobuild@v2
|
||||
- name: Perform CodeQL Analysis
|
||||
uses: github/codeql-action/analyze@v2
|
||||
|
||||
lint:
|
||||
name: Lint
|
||||
needs: skip_duplicate
|
||||
if: ${{ needs.skip_duplicate.outputs.should_skip == 'false' }}
|
||||
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: Lint
|
||||
run: pylint --recursive=yes .
|
||||
|
||||
test:
|
||||
name: Run unit tests
|
||||
needs: skip_duplicate
|
||||
if: ${{ needs.skip_duplicate.outputs.should_skip == 'false' }}
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
python-version: [ '3.10' ]
|
||||
steps:
|
||||
- name: Check out repository code
|
||||
uses: actions/checkout@v3
|
||||
- name: Setup Python ${{ matrix.python-version }}
|
||||
uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
- 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
|
||||
- name: Upload Coverage to Codecov
|
||||
uses: codecov/codecov-action@v3
|
||||
|
||||
build:
|
||||
name: Build
|
||||
needs:
|
||||
- lint
|
||||
- test
|
||||
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/
|
67
.github/workflows/ci-pull-request.yml
vendored
67
.github/workflows/ci-pull-request.yml
vendored
@ -1,67 +0,0 @@
|
||||
name: CI - Pull request
|
||||
on:
|
||||
pull_request:
|
||||
paths-ignore:
|
||||
- 'README.md'
|
||||
- 'LICENSE.md'
|
||||
- 'CHANGELOG.md'
|
||||
- '.gitignore'
|
||||
- 'renovate.json'
|
||||
- 'CODEOWNERS'
|
||||
|
||||
jobs:
|
||||
analyze:
|
||||
name: Analyze
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
actions: read
|
||||
contents: read
|
||||
security-events: write
|
||||
strategy:
|
||||
fail-fast: false
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v3
|
||||
- name: Initialize CodeQL
|
||||
uses: github/codeql-action/init@v2
|
||||
with:
|
||||
languages: python
|
||||
- name: Autobuild
|
||||
uses: github/codeql-action/autobuild@v2
|
||||
- name: Perform CodeQL Analysis
|
||||
uses: github/codeql-action/analyze@v2
|
||||
|
||||
lint:
|
||||
name: Lint
|
||||
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: Lint
|
||||
run: pylint --recursive=yes .
|
||||
|
||||
test:
|
||||
name: Run unit tests
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
python-version: [ '3.10' ]
|
||||
steps:
|
||||
- name: Check out repository code
|
||||
uses: actions/checkout@v3
|
||||
- name: Setup Python ${{ matrix.python-version }}
|
||||
uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
- 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
|
||||
- name: Upload Coverage to Codecov
|
||||
uses: codecov/codecov-action@v3
|
@ -1,19 +1,11 @@
|
||||
name: CI - Merge to main
|
||||
name: Merge to main
|
||||
on:
|
||||
workflow_dispatch:
|
||||
push:
|
||||
branches:
|
||||
- "main"
|
||||
paths-ignore:
|
||||
- 'README.md'
|
||||
- 'LICENSE.md'
|
||||
- 'CHANGELOG.md'
|
||||
- '.gitignore'
|
||||
- 'renovate.json'
|
||||
- 'CODEOWNERS'
|
||||
- main
|
||||
|
||||
jobs:
|
||||
lint:
|
||||
coverage:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check out repository code
|
||||
@ -24,32 +16,19 @@ jobs:
|
||||
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 .
|
||||
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
python-version: [ '3.10' ]
|
||||
steps:
|
||||
- name: Check out repository code
|
||||
uses: actions/checkout@v3
|
||||
- name: Setup Python ${{ matrix.python-version }}
|
||||
uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
- 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
|
||||
- name: Upload Coverage to Codecov
|
||||
uses: codecov/codecov-action@v3
|
||||
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:
|
||||
- lint
|
||||
- test
|
||||
needs: coverage
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check out repository code
|
||||
@ -58,8 +37,6 @@ jobs:
|
||||
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: Install build dependencies
|
||||
run: pip install setuptools wheel
|
||||
- name: Build wheel file
|
||||
@ -76,8 +53,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Create dist folder
|
||||
run: |
|
||||
mkdir -p dist
|
||||
run: mkdir -p dist
|
||||
- uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: whl
|
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 }}
|
Reference in New Issue
Block a user