Add test suite #2
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Tests | |
| on: | |
| - push | |
| - pull_request | |
| - workflow_dispatch # Running workflow manually | |
| jobs: | |
| test: | |
| runs-on: ubuntu-22.04 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python 3.11 | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: "3.11" | |
| cache: 'pip' | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -e . | |
| pip install pytest pytest-mock pytest-cov ipython | |
| - name: Run tests with coverage | |
| run: | | |
| pytest --cov=jumper_extension --cov-report=xml tests/ | |
| - name: Generate coverage badge | |
| uses: tj-actions/coverage-badge-py@v2 | |
| with: | |
| output: coverage.svg | |
| - name: Commit coverage badge | |
| run: | | |
| git config --local user.email "action@github.com" | |
| git config --local user.name "GitHub Action" | |
| git add coverage.svg | |
| git diff --staged --quiet || git commit -m "Update coverage badge" | |
| git push |