Skip to content

Commit

Permalink
Merge pull request #27 from HLasse/clean-ci
Browse files Browse the repository at this point in the history
updated ci workflow
  • Loading branch information
HLasse authored Apr 5, 2022
2 parents 294b6dd + e8739a0 commit 29d0041
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 99 deletions.
42 changes: 33 additions & 9 deletions .github/workflows/pytest-cov-comment.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

name: CI Pytest
on:
push:
Expand All @@ -8,9 +7,34 @@ on:

jobs:
pytest:
runs-on: ubuntu-latest
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest, windows-latest, ubuntu-latest]
python-version: ['3.9', '3.8', '3.7']
exclude:
- os: ubuntu-latest
python-version: '3.9'

steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 pytest pytest-cov
pip install -r requirements.txt
- name: Run and write pytest
run: |
echo "[run]\nomit =\n\ttextdescriptives/tests/*" > .coveragerc
python -m pytest --cov=textdescriptives --cov-config=.coveragerc --cov-report term-missing | tee pytest-coverage.txt
pytest-coverage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.9
uses: actions/setup-python@v2
Expand All @@ -20,26 +44,26 @@ jobs:
run: |
python -m pip install --upgrade pip
pip install flake8 pytest pytest-cov
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
pip install -r requirements.txt
- name: Run and write pytest
run: |
python ./dev/pytest-coverage/run_coverage.py
echo "[run]\nomit =\n\ttextdescriptives/tests/*" > .coveragerc
python -m pytest --cov=textdescriptives --cov-config=.coveragerc --cov-report term-missing | tee pytest-coverage.txt
- name: Pytest coverage comment
id: coverage-comment
uses: MishaKav/pytest-coverage-comment@v1.0
uses: MishaKav/pytest-coverage-comment@v1.1.17
with:
pytest-coverage-path: ./dev/pytest-coverage/pytest-coverage.txt
pytest-coverage-path: ./pytest-coverage.txt

- name: Check the output coverage
run: |
echo "Coverage Report - ${{ steps.coverage-comment.outputs.coverage }}"
echo "Coverage Color - ${{ steps.coverage-comment.outputs.color }}"
- name: Create the Badge
uses: schneegans/dynamic-badges-action@v1.0.0
uses: schneegans/dynamic-badges-action@v1.1.0
with:
auth: ${{ secrets.PYTEST_COVERAGE }}
gistID: 24ee79064ca9d49616cbc410da65cee2
gistID: 4ee79064ca9d49616cbc410da65cee2
filename: badge-textdescriptives-pytest-coverage.json
label: Coverage
message: ${{ steps.coverage-comment.outputs.coverage }}
Expand Down
26 changes: 0 additions & 26 deletions .github/workflows/pytest_mac_catalina.yml

This file was deleted.

28 changes: 0 additions & 28 deletions .github/workflows/pytest_windows.yml

This file was deleted.

Empty file removed dev/__init__.py
Empty file.
3 changes: 0 additions & 3 deletions dev/pytest-coverage/.coveragerc

This file was deleted.

33 changes: 0 additions & 33 deletions dev/pytest-coverage/run_coverage.py

This file was deleted.

1 comment on commit 29d0041

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coverage

Coverage Report
FileStmtsMissCoverMissing
textdescriptives
   init.py40100% 
   about.py30100% 
   dataframe_extract.py86693%71, 128–132
   load_components.py120100% 
textdescriptives/components
   init.py40100% 
   dependency_distance.py320100% 
   descriptive_stats.py51198%112
   pos_stats.py25292%13, 44
   readability.py720100% 
   utils.py160100% 
textdescriptives/tests
   init.py00100% 
   books.py120100% 
   test_dependency_distance.py490100% 
   test_descriptive_stats.py600100% 
   test_extractor.py40392%21–26
   test_load_components.py150100% 
   test_pos_stats.py230100% 
   test_readability.py72297%41–42
TOTAL5761498% 

Please sign in to comment.