Update python-ci.yml
This commit is contained in:
1 parent
f46796d121
commit
415b9357b0
1 file changed
+19
-6
@@ -1,3 +1,6 @@
|
|||||||
|
# This workflow will install Python dependencies, run tests and lint with a single version of Python
|
||||||
|
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
|
||||||
|
|
||||||
name: Python CI
|
name: Python CI
|
||||||
|
|
||||||
on:
|
on:
|
||||||
@@ -16,31 +19,41 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- uses: actions/checkout@v4
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Set up Python 3.11.9
|
- name: Set up Python 3.11.9
|
||||||
uses: actions/setup-python@v3
|
uses: actions/setup-python@v3
|
||||||
|
if: ${{ hashFiles('./test') != '' }}
|
||||||
with:
|
with:
|
||||||
python-version: "3.11.9"
|
python-version: "3.11.9"
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
|
if: ${{ hashFiles('./test') != '' }}
|
||||||
run: |
|
run: |
|
||||||
python -m pip install --upgrade pip
|
python -m pip install --upgrade pip
|
||||||
if [ -f system/requirements/requirements_unit_test.txt ]; then
|
if [ -f system/requirements/requirements_unit_test.txt ]; then
|
||||||
pip install -r system/requirements/requirements_unit_test.txt;
|
pip install -r system/requirements/requirements_unit_test.txt;
|
||||||
fi
|
fi
|
||||||
|
|
||||||
- name: Test with pytest
|
- name: Test with pytest
|
||||||
|
if: ${{ hashFiles('./test') != '' }}
|
||||||
run: |
|
run: |
|
||||||
pytest test --doctest-modules --junitxml=junit/test-results.xml --cov=com --cov-report=xml --cov-report=html
|
pytest test --doctest-modules --junitxml=junit/test-results.xml --cov=com --cov-report=xml --cov-report=html
|
||||||
|
|
||||||
- name: Surface failing tests
|
- name: Surface failing tests
|
||||||
if: always()
|
if: always()
|
||||||
uses: pmeier/pytest-results-action@v0.6.0
|
uses: pmeier/pytest-results-action@v0.6.0
|
||||||
with:
|
with:
|
||||||
|
# A list of JUnit XML files, directories containing the former, and wildcard
|
||||||
|
# patterns to process.
|
||||||
|
# See @actions/glob for supported patterns.
|
||||||
path: junit/test-results.xml
|
path: junit/test-results.xml
|
||||||
|
|
||||||
|
# (Optional) Add a summary of the results at the top of the report
|
||||||
summary: true
|
summary: true
|
||||||
|
|
||||||
|
# (Optional) Select which results should be included in the report.
|
||||||
|
# Follows the same syntax as `pytest -r`
|
||||||
display-options: fEX
|
display-options: fEX
|
||||||
|
|
||||||
|
# (Optional) Fail the workflow if no JUnit XML was found.
|
||||||
fail-on-empty: false
|
fail-on-empty: false
|
||||||
|
|
||||||
|
# (Optional) Title of the test results section in the workflow summary
|
||||||
title: Test results
|
title: Test results
|
||||||
Reference in new issue
Block a user