automation: add coverage report

Add coverage report for performed tests.

Signed-off-by: Sandro Bonazzola <sbonazzo@redhat.com>
This commit is contained in:
Sandro Bonazzola
2022-09-13 07:35:58 +02:00
committed by Sandro Bonazzola
parent 9de6c7350e
commit 51a2fbd77d
14 changed files with 29 additions and 15 deletions
+14 -1
View File
@@ -23,9 +23,22 @@ jobs:
sudo apt-get install build-essential python3-dev
pip install -r requirements.txt
- name: Run unit tests
run: python -m unittest discover -s tests
run: python -m coverage run -a -m unittest discover -s tests
- name: Run CI
run: ./CI/run.sh
- name: Collect coverage report
run: |
python -m coverage html
- name: Publish coverage report to job summary
run: |
pip install html2text
html2text --ignore-images --ignore-links -b 0 htmlcov/index.html >> $GITHUB_STEP_SUMMARY
- name: Upload coverage data
uses: actions/upload-artifact@v3
with:
name: coverage
path: htmlcov
if-no-files-found: error
- name: Build the Docker images
run: docker build --no-cache -t quay.io/chaos-kubox/krkn containers/
- name: Login in quay