Add deepsource code coverage (#5717)

* added deepsource coverage settings

* Ignore missing coverage

* trigger full CI run

* only run when upstream, master and push
This commit is contained in:
Matthias Mair 2023-10-29 20:58:48 +01:00 committed by GitHub
parent 5d6d847328
commit 7ff3f99dc9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 0 deletions

View File

@ -31,3 +31,7 @@ name = "python"
[[analyzers]]
name = "docker"
[[analyzers]]
name = "test-coverage"
enabled = true

View File

@ -195,6 +195,7 @@ jobs:
INVENTREE_DB_ENGINE: sqlite3
INVENTREE_PLUGINS_ENABLED: true
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DEEPSOURCE_DSN: ${{ secrets.DEEPSOURCE_DSN }}
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # pin@v4.1.1
@ -216,6 +217,14 @@ jobs:
uses: coverallsapp/github-action@3dfc5567390f6fa9267c0ee9c251e4c8c3f18949 # pin@v2.2.3
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Upload Coverage to Deepsource
if: ${{ github.repository == 'inventree/InvenTree' && github.event_name == 'push' && github.ref == 'refs/heads/master' }}
env:
DEEPSOURCE_DSN: ${{ secrets.DEEPSOURCE_DSN }}
run: |
coverage xml -i
curl -sSL https://deepsource.io/cli | sh
./bin/deepsource report --analyzer test-coverage --key python --value-file coverage.xml
postgres:
name: Tests - DB [PostgreSQL]

View File

@ -847,6 +847,7 @@ LANGUAGES = [
('zh-hant', _('Chinese (Traditional)')),
]
# Testing interface translations
if get_boolean_setting('TEST_TRANSLATIONS', default_value=False): # pragma: no cover
# Set default language