Skip to content

Commit

Permalink
Update pytest-ci.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
will-roscoe authored Dec 11, 2023
1 parent 907df20 commit 1791b9d
Showing 1 changed file with 45 additions and 5 deletions.
50 changes: 45 additions & 5 deletions .github/workflows/pytest-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ on:
- '*.py'
workflow_dispatch:
jobs:

build:
build-tests:
name: Pytest
runs-on: ubuntu-latest
strategy:
fail-fast: false
Expand All @@ -26,8 +26,48 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install flake8 pytest
python -m pip install pytest pytest-cov
pip install -r requirements.txt
- name: Pytest -> ${{ matrix.module-name }}$
- with:
test-file: ${{ matr.module-name }}
- name: Pytest -> ${{ test-file }}
run: |
pytest -v --disable-warnings -l **/tests/test_${{ matrix.module-name }}.py
pytest -v --disable-warnings -l **/tests/test_${{ test-file }}.py --doctest-modules --junitxml=junit/test-results.xml --cov=com --cov-report=xml --cov-report=html
- name: Upload pytest test results
uses: actions/upload-artifact@v3
with:
name: pytest-results-${{ matrix.python-version }}
path: junit/test-results-${{ matrix.python-version }}.xml
# Use always() to always run this step to publish test results when there are test failures
if: ${{ always() }}





build-linter:
name: Pylint
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.8","3.9", "3.12"]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
cache: pip
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install ruff
pip install -r requirements.txt
- name: Analysing the code with pylint
run: |
pip install ruff
ruff --output-format=github .
continue-on-error: true

0 comments on commit 1791b9d

Please sign in to comment.