Skip to content

Commit

Permalink
fix pipeline (#103)
Browse files Browse the repository at this point in the history
* add upload to code cov

* add secret input

* fail ci if error

* force xml coverage report

* update settings

* delete fail check

* Merge branch 'main' into polish_test

* assert code coverage

* look in current directory

* files

* remove intermediate steps

* remove working directory

* remove file name

* use diff env var

* fix pipeline

* no cov when debugging

* Merge branch 'main' into polish_test

* remove script
  • Loading branch information
SKairinos authored Apr 19, 2024
1 parent 3daa1f5 commit aee8ba5
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
11 changes: 8 additions & 3 deletions .github/workflows/test-python-code.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,15 @@ on:
default: "./codecov.yml"
secrets:
CODECOV_TOKEN:
required: true
description: "The token used to gain access to Codecov."
required: false

jobs:
test-py-code:
runs-on: ubuntu-latest
env:
PYPROJECT_TOML: ${{ inputs.pyproject-toml-directory }}/pyproject.toml
COVERAGE_REPORT: coverage.xml # NOTE: COVERAGE_FILE is reserved - do not use.
steps:
- name: 🛫 Checkout
uses: actions/checkout@v4
Expand Down Expand Up @@ -105,13 +107,16 @@ jobs:

- name: 🧪 Test Code Units
working-directory: ${{ inputs.working-directory }}
run: pipenv run pytest -n=auto --cov --cov-report=xml -c=${{ env.PYPROJECT_TOML }} ${{ inputs.source-path }}
run: pipenv run pytest -n=auto --cov --cov-report=xml:${{ env.COVERAGE_REPORT }} -c=${{ env.PYPROJECT_TOML }} ${{ inputs.source-path }}

# TODO: check if target is asserted
- name: 📈 Upload Coverage Reports to Codecov
# Only run step if the event is triggered from within the original repo.
# NOTE: Forked repos will not be able to set the CODECOV_TOKEN secret
if: github.event.repository.full_name == github.repository
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
slug: ${{ inputs.codecov-slug }}
codecov_yml_path: ${{ inputs.codecov-yml-path }}
working-directory: ${{ inputs.working-directory }}
file: ${{ env.COVERAGE_REPORT }}
3 changes: 3 additions & 0 deletions .submodules/configs.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,9 @@
"justMyCode": false,
"presentation": {
"hidden": true
},
"env": {
"PYTEST_ADDOPTS": "--no-cov"
}
}
]
Expand Down

0 comments on commit aee8ba5

Please sign in to comment.