diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 9200174..1ae2159 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -31,5 +31,30 @@ jobs: run: | pip install .[dev] pip list + - name: Run pytest - run: pytest + run: pytest --cov=alfred3_interact tests/ + + - name: coverage.py badge + uses: tj-actions/coverage-badge-py@v1.8 + + - name: Verify Changed files + uses: tj-actions/verify-changed-files@v9 + id: changed_files + with: + files: coverage.svg + + - name: Commit files + if: steps.changed_files.outputs.files_changed == 'true' + run: | + git config --local user.email "github-actions[bot]@users.noreply.github.com" + git config --local user.name "github-actions[bot]" + git add coverage.svg + git commit -m "Updated coverage.svg" + + - name: Push changes + if: steps.changed_files.outputs.files_changed == 'true' + uses: ad-m/github-push-action@master + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + branch: ${{ github.ref }} diff --git a/README.md b/README.md index 67165d4..431b946 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # alfred3-interact: Interactive web-experiments in alfred3 -![GitHub](https://img.shields.io/github/license/jobrachem/alfred3-interact) [![DOI](https://zenodo.org/badge/340368707.svg)](https://zenodo.org/badge/latestdoi/340368707) [![Run tests](https://github.com/jobrachem/alfred3-interact/actions/workflows/pytest.yml/badge.svg)](https://github.com/jobrachem/alfred3-interact/actions/workflows/pytest.yml) [![pre-commit](https://github.com/jobrachem/alfred3-interact/actions/workflows/pre-commit.yml/badge.svg)](https://github.com/jobrachem/alfred3-interact/actions/workflows/pre-commit.yml) +![GitHub](https://img.shields.io/github/license/jobrachem/alfred3-interact) [![DOI](https://zenodo.org/badge/340368707.svg)](https://zenodo.org/badge/latestdoi/340368707) [![pre-commit](https://github.com/jobrachem/alfred3-interact/actions/workflows/pre-commit.yml/badge.svg)](https://github.com/jobrachem/alfred3-interact/actions/workflows/pre-commit.yml) [![Run tests](https://github.com/jobrachem/alfred3-interact/actions/workflows/pytest.yml/badge.svg)](https://github.com/jobrachem/alfred3-interact/actions/workflows/pytest.yml) [![pytest-coverage](coverage.svg)](https://github.com/jobrachem/alfred3-interact/actions/workflows/pytest.yml) Alfred3-interact is a plugin for [alfred3](https://github.com/ctreffe/alfred). It allows for the creation of interactive web experiments, predominantly diff --git a/coverage.svg b/coverage.svg new file mode 100644 index 0000000..7a18c7f --- /dev/null +++ b/coverage.svg @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + coverage + coverage + 80% + 80% + + diff --git a/setup.py b/setup.py index 1ca3997..48016ff 100644 --- a/setup.py +++ b/setup.py @@ -37,6 +37,7 @@ "mongomock", "bs4", "selenium", + "pytest-cov", ] }, classifiers=[