-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Publish code coverage on CodeClimate
- Loading branch information
Showing
4 changed files
with
115 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,23 +18,24 @@ jobs: | |
with: | ||
python-version: "3.10" | ||
|
||
- name: Install Poetry | ||
uses: snok/install-poetry@v1 | ||
with: | ||
virtualenvs-create: true | ||
virtualenvs-in-project: true | ||
installer-parallel: true | ||
|
||
- name: Load cached venv | ||
id: cached-poetry-dependencies | ||
uses: actions/cache@v3 | ||
with: | ||
path: .venv | ||
key: venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }} | ||
|
||
- name: Install Poetry | ||
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' | ||
uses: snok/install-poetry@v1 | ||
with: | ||
virtualenvs-create: true | ||
virtualenvs-in-project: true | ||
installer-parallel: true | ||
|
||
- name: Install dependencies | ||
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' | ||
run: poetry install --no-interaction --no-root | ||
run: poetry install --with=ci --without=docs --no-interaction --no-root | ||
|
||
test: | ||
runs-on: ubuntu-latest | ||
|
@@ -58,15 +59,45 @@ jobs: | |
path: .venv | ||
key: venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }} | ||
|
||
- name: Testing | ||
- name: Linting | ||
run: | | ||
source .venv/bin/activate | ||
pytest | ||
ruff check . --output-format=full | ||
- name: Linting | ||
coverage: | ||
runs-on: ubuntu-latest | ||
needs: test | ||
concurrency: | ||
group: "coverage" | ||
cancel-in-progress: true | ||
env: | ||
CC_TEST_REPORTER_ID: ${{secrets.CC_TEST_REPORTER_ID}} | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Load cached venv | ||
id: cached-poetry-dependencies | ||
uses: actions/cache@v3 | ||
with: | ||
path: .venv | ||
key: venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }} | ||
|
||
- name: Testing | ||
run: | | ||
source .venv/bin/activate | ||
ruff check . --output-format=full | ||
MODULE_DIR=$(dirname "$(ls */__init__.py)") | ||
coverage run --source "$MODULE_DIR" -m pytest | ||
coverage report --skip-covered --fail-under=80 | ||
coverage xml --ignore-errors | ||
- name: Publish code coverage | ||
if: ${{ github.ref == 'refs/heads/main' || github.ref == 'refs/heads/dev' }} | ||
uses: paambaati/[email protected] | ||
env: | ||
CC_TEST_REPORTER_ID: ${{secrets.CC_TEST_REPORTER_ID}} | ||
with: | ||
coverageLocations: coverage.xml:coverage.py | ||
|
||
build: | ||
runs-on: ubuntu-latest | ||
needs: test | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,6 +11,10 @@ node_modules/ | |
dist/ | ||
venv/ | ||
|
||
# Code coverage | ||
.coverage | ||
coverage.xml | ||
|
||
# Build artifacts | ||
site/ | ||
build/ | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters